public void SDOParse() { DateTime today = DateTime.Now; Demographics demo = new Demographics(); demo.CountriesOfCitizenship = new CountriesOfCitizenship(); demo.CountriesOfCitizenship.AddCountryOfCitizenship(CountryCode.US); demo.CountriesOfCitizenship.AddCountryOfCitizenship(CountryCode.Wrap("CA")); demo.CountriesOfResidency = new CountriesOfResidency(new Country(CountryCode.Wrap("CA"))); demo.CountryOfBirth = CountryCode.US.ToString(); // Create a StudentPlacement StudentPlacement sp = new StudentPlacement(); sp.RefId = Adk.MakeGuid(); sp.StudentParticipationRefId = Adk.MakeGuid(); sp.StudentPersonalRefId = Adk.MakeGuid(); sp.SetService(ServiceCode.STAFF_PROFESSIONAL_DEVELOPMENT, "foo", "test"); sp.ServiceProviderAgency = "ABSD"; sp.ServiceProviderName = "John Smithfield"; sp.SetServiceSetting("asdfasdf", ServiceSettingCode.REGULAR_SCHOOL_CAMPUS); sp.StartDate = today; sp.FrequencyTime = new FrequencyTime(); sp.SetIndirectTime(DurationUnit.MINUTES, 10); sp.TotalServiceDuration = new TimeUnit(DurationUnit.MINUTES, 5); sp.SpecialNeedsTransportation = false; sp.AssistiveTechnology = true; sp.SetDirectTime(DurationUnit.HOURS, 5); AdkObjectParseHelper.runParsingTest(sp, SifVersion.LATEST); }
/** * \brief <b>Brief Description</b> - Execute <b><i>class method</i></b> - Entry point into the search patient list menu * \details <b>Details</b> * * This takes in the scheduling, demographics and billing libraries * * \return <b>void</b> */ public void Execute(Scheduling scheduling, Demographics demographics, Billing billing) { // the menu that allows the user to select between searching by first and last names or HCN _searchMenu = new List <Pair <string, string> >() { { new Pair <string, string>(" > First & Last name", "") }, { new Pair <string, string>(" > Health Card Number", "") } }; // the menu for the searching by first and last names _namesSearchContent = new List <Pair <string, string> >() { { new Pair <string, string>("First Name", "") }, { new Pair <string, string>("Last Name", "") }, { new Pair <string, string>(" >> SEARCH PATIENT <<", "") } }; // the menu for the searching by health card number _hcnSearchContent = new List <Pair <string, string> >() { { new Pair <string, string>("Health Card Number", "") }, { new Pair <string, string>(" >> SEARCH PATIENT <<", "") } }; // format the input lines so they look like input lines FormatInputLines(_namesSearchContent); FormatInputLines(_hcnSearchContent); // display the search menu Container.DisplayContent(_searchMenu, 2, _selectedInputField, MenuCodes.PATIENTS, "Patients", Description); // run the main loop MainLoop(); }
public int Post([FromBody] Demographics demographics) { demographics.AssessmentId = Auth.AssessmentForUser(); AssessmentManager assessmentManager = new AssessmentManager(); return(assessmentManager.SaveDemographics(demographics)); }
public void IncreaseAndGetPopulationForTest() { var d = new Demographics(); Assert.AreEqual(0, d.Populations.Count); var r = MakeTestRace("test race"); d.IncreasePopulationFor(r); Assert.AreEqual(1, d.Populations.Count); Assert.AreEqual(Demographics.Population.Low, d.GetPopulationFor(r)); d.IncreasePopulationFor(r); Assert.AreEqual(1, d.Populations.Count); Assert.AreEqual(Demographics.Population.LowMid, d.GetPopulationFor(r)); var r2 = MakeTestRace("test race 2"); d.IncreasePopulationFor(r2); Assert.AreEqual(Demographics.Population.Low, d.GetPopulationFor(r2)); Assert.AreEqual(Demographics.Population.LowMid, d.GetPopulationFor(r)); d.IncreasePopulationFor(r); d.IncreasePopulationFor(r); d.IncreasePopulationFor(r); Assert.AreEqual(Demographics.Population.High, d.GetPopulationFor(r)); // Should not be able to increase population past high d.IncreasePopulationFor(r); Assert.AreEqual(Demographics.Population.High, d.GetPopulationFor(r)); Assert.AreEqual(Demographics.Population.Low, d.GetPopulationFor(r2)); }
public void Functional_GetPatientList() { try { Demographics d = new Demographics(); Patient p = new Patient(d); p.FirstName = "Divyangbhai"; p.LastName = "Dankhara"; p.HCN = "0987654321AB"; p.MInitial = "A"; p.DateOfBirth = "12111997"; p.Sex = "M"; p.HeadOfHouse = "1234567890AB"; d.AddNewPatient(p); int count = d.dPatientRoster.Count; if (count == 0) { Assert.Fail(); } } catch (Exception) { Assert.Fail(); } }
public void Functional_GetPatientbyID() { try { Demographics d = new Demographics(); Patient p = new Patient(d); p.FirstName = "alex"; p.LastName = "koxak"; p.HCN = "0987654321GF"; p.MInitial = "A"; p.DateOfBirth = "12111997"; p.Sex = "M"; p.HeadOfHouse = "1234567890AB"; d.AddNewPatient(p); int count = d.GetPatientIDByHCN(p.HCN); Patient dp = d.GetPatientByID(count); if (dp != null) { if (!(dp.HCN == p.HCN)) { Assert.Fail(); } } } catch (Exception) { Assert.Fail(); } }
public void Functional_UpdatePatient() { // in this test we test that demographics class actually add the patient to database try { Demographics d = new Demographics(); Patient p = new Patient(d); p.FirstName = "Divyangbhai"; p.LastName = "Dankhara"; p.HCN = "0987654321AB"; p.MInitial = "A"; p.DateOfBirth = "12111997"; p.Sex = "M"; p.HeadOfHouse = "1234567890AB"; d.AddNewPatient(p); p.LastName = "dankhara1"; // here we are updating the patient that we have just added with new last name. d.UpdatePatient(p); Patient Dp = d.GetPatientByHCN(p.HCN); if (!(Dp.LastName == p.LastName)) { Assert.Fail(); } } catch (Exception) { Assert.Fail(); } }
private async Task UpdateDynamicPrice(string filename) { // TODO 1. Retrieve storage account from connection string. CloudStorageAccount storageAccount = CloudStorageAccount.Parse(_storageConnectionString); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference("photos"); // TODO 2. Retrieve reference to a blob named with the value of fileName. string blobName = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(filename); CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName); // TODO 3. Create or overwrite the blob with contents from a local file. using (var fileStream = System.IO.File.OpenRead(filename)) { blockBlob.UploadFromStream(fileStream); } // Acquire a SAS Uri for the blob string sasUri = GetBlobSasUri(blockBlob); // Provide the SAS Uri to blob to the Face API Demographics d = await GetPhotoDemographics(sasUri); double suggestedPrice = 1.10; //TODO 10. Invoke the actual ML Model PricingModelService pricingModel = new PricingModelService(); string gender = d.gender == "Female" ? "F" : "M"; suggestedPrice = await pricingModel.GetSuggestedPrice((int)d.age, gender, _itemName); SetPromo(_itemName, suggestedPrice, _itemId, _imagePath); }
/** * \brief <b>Brief Description</b> - Execute <b><i>class method</i></b> - gets confirmation that the user does indeed want to exit * \details <b>Details</b> * * This method is there only for the structure of the menu. It is one of the major menu * selections therefore it has no code behind. It it mostly accessed for its description. * * \return <b>void</b> */ public void Execute(Scheduling scheduling, Demographics demographics, Billing billing) { if (ExitConfirmation()) { Environment.Exit(0); } }
/** * \brief <b>Brief Description</b> - Execute <b><i>class method</i></b> - Entry point into the reconcile month menu * \details <b>Details</b> * * This takes in the scheduling, demographics and billing libraries * * \return <b>void</b> */ public void Execute(Scheduling scheduling, Demographics demographics, Billing billing) { // display a clear screen Container.DisplayContent(new List <Pair <string, string> >() { { new Pair <string, string>("", "") } }, 1, 1, MenuCodes.BILLING, "Billing", Description); // get the month to generate the report for DateTime getMonth = DatePicker.GetDate(scheduling, DateTime.Today, false); // check if the user didnt cancel the month selection if (getMonth.Ticks != 0) { // format the name of the text file string date = string.Format("{0}{1}govFile.txt", getMonth.Year, getMonth.Month); // generate the report for the reconciled month List <string> report = billing.ReconcileMonthlyBilling(date); // display the success message Container.DisplayContent(new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("Report successfully generated!", "") }, 1, -1, MenuCodes.BILLING, "Billing", Description); // wait for confirmation from user that they read the message Console.ReadKey(); } }
/** * \brief <b>Brief Description</b> - Execute <b><i>class method</i></b> - Entry point into the generate monthly report menu * \details <b>Details</b> * * This takes in the scheduling, demographics and billing libraries * * \return <b>void</b> */ public void Execute(Scheduling scheduling, Demographics demographics, Billing billing) { // display a clear screen Container.DisplayContent(new List <Pair <string, string> >() { { new Pair <string, string>("", "") } }, 0, -1, MenuCodes.BILLING, "Billing", Description); // get the month to generate the report for DateTime getMonth = DatePicker.GetDate(scheduling, DateTime.Today, false); // check if the user didnt cancel the month selection if (getMonth.Ticks != 0) { // check if the report generation was successful if (billing.GenerateMonthlyBillingFile(scheduling, demographics, getMonth.Year, getMonth.Month)) { Container.DisplayContent(new List <Pair <string, string> >() { { new Pair <string, string>("Report successfuly generated!", "") } }, 0, -1, MenuCodes.BILLING, "Billing", Description); } else { Container.DisplayContent(new List <Pair <string, string> >() { { new Pair <string, string>("Report failed to generate.", "") } }, 0, -1, MenuCodes.BILLING, "Billing", Description); } // wait for confirmation from user that they read the message Console.ReadKey(); } }
} // referredBy public void CopyFrom(ClientData other) { if (other.Name != null) { Name = other.Name; } if (other.ReferenceId != null) { ReferenceId = other.ReferenceId; } if (other.Address.Id != Guid.Empty) { Address.CopyFrom(other.Address); } if (other.Demographics.Id != Guid.Empty) { Demographics.CopyFrom(other.Demographics); } if (other.ProjectId != Guid.Empty) { ProjectId = other.ProjectId; } if (other.LocationId != Guid.Empty) { LocationId = other.LocationId; } } // CopyFrom
public void GetPopulationForTest() { var d = new Demographics(); Assert.AreEqual(0, d.Populations.Count); var r = MakeTestRace("test race"); var r2 = MakeTestRace("test race 2"); Assert.AreEqual(Demographics.Population.None, d.GetPopulationFor(r)); Assert.AreEqual(Demographics.Population.None, d.GetPopulationFor(r2)); Assert.AreEqual(Demographics.Population.None, d[r]); Assert.AreEqual(Demographics.Population.None, d[r2]); d.IncreasePopulationFor(r); Assert.AreEqual(1, d.Populations.Count); Assert.AreEqual(Demographics.Population.Low, d.GetPopulationFor(r)); Assert.AreEqual(Demographics.Population.None, d.GetPopulationFor(r2)); Assert.AreEqual(Demographics.Population.Low, d[r]); Assert.AreEqual(Demographics.Population.None, d[r2]); d.IncreasePopulationFor(r); Assert.AreEqual(1, d.Populations.Count); Assert.AreEqual(Demographics.Population.LowMid, d.GetPopulationFor(r)); Assert.AreEqual(Demographics.Population.None, d.GetPopulationFor(r2)); Assert.AreEqual(Demographics.Population.LowMid, d[r]); Assert.AreEqual(Demographics.Population.None, d[r2]); }
/// <summary> /// Returns the Demographics instance for the assessment. /// </summary> /// <param name="assessmentId"></param> /// <returns></returns> public Demographics GetDemographics(int assessmentId) { Demographics demographics = new Demographics { AssessmentId = assessmentId }; using (var db = new CSET_Context()) { var query = from ddd in db.DEMOGRAPHICS from ds in db.DEMOGRAPHICS_SIZE.Where(x => x.Size == ddd.Size).DefaultIfEmpty() from dav in db.DEMOGRAPHICS_ASSET_VALUES.Where(x => x.AssetValue == ddd.AssetValue).DefaultIfEmpty() where ddd.Assessment_Id == assessmentId select new { ddd, ds, dav }; var hit = query.FirstOrDefault(); if (hit != null) { demographics.SectorId = hit.ddd.SectorId; demographics.IndustryId = hit.ddd.IndustryId; demographics.AssetValue = hit.dav?.DemographicsAssetId; demographics.Size = hit.ds?.DemographicId; } return(demographics); } }
public void SharedChildren() { Adk.SifVersion = SifVersion.LATEST; StudentPersonal sp = new StudentPersonal(Adk.MakeGuid(), new Name(NameType.LEGAL, "hello", "world")); // Replace the existing demographics so there is no confusion Demographics d = new Demographics(); sp.Demographics = d; d.SetCountryOfBirth(CountryCode.US); CountriesOfCitizenship countries = new CountriesOfCitizenship(); d.CountriesOfCitizenship = countries; CountriesOfResidency residencies = new CountriesOfResidency(); d.CountriesOfResidency = residencies; countries.AddCountryOfCitizenship(CountryCode.Wrap("UK")); residencies.AddCountryOfResidency(CountryCode.Wrap("AU")); // overwrite the country codes again, just to try to repro the issue d.SetCountryOfBirth(CountryCode.Wrap("AA")); // Should overwrite the existing one //Remove the existing CountryOfCitizenship, add three more, and remove the middle one Assert.IsTrue(countries.Remove(CountryCode.Wrap("UK"))); countries.AddCountryOfCitizenship(CountryCode.Wrap("BB1")); countries.AddCountryOfCitizenship(CountryCode.Wrap("BB2")); countries.AddCountryOfCitizenship(CountryCode.Wrap("BB3")); Assert.IsTrue(countries.Remove(CountryCode.Wrap("BB2"))); // Remove the existing CountryOfResidency, add three more, and remove the first one Assert.IsTrue(residencies.Remove(CountryCode.Wrap("AU"))); residencies.AddCountryOfResidency(CountryCode.Wrap("CC1")); residencies.AddCountryOfResidency(CountryCode.Wrap("CC2")); residencies.AddCountryOfResidency(CountryCode.Wrap("CC3")); Assert.IsTrue(residencies.Remove(CountryCode.Wrap("CC1"))); StudentPersonal sp2 = AdkObjectParseHelper.runParsingTest(sp, SifVersion.LATEST); // The runParsingTest() method will compare the objects after writing them and reading them // back in, but to be completely sure, let's assert the country codes again // NOTE: Due to the .Net Array.Sort algorithm, repeatable elements come out in reverse order. // This doesn't appear to be a problem yet, but may be fixed in a future release. // For now, these tests look for the elements in reverse order Demographics d2 = sp2.Demographics; Assert.AreEqual("AA", d2.CountryOfBirth.ToString(), "Country of Birth"); Country[] citizenships = d2.CountriesOfCitizenship.ToArray(); Assert.AreEqual(2, citizenships.Length, "Should be two CountryOfCitizenships"); Assert.AreEqual("BB1", citizenships[0].TextValue, "First CountryOfCitizenship"); Assert.AreEqual("BB3", citizenships[1].TextValue, "Second CountryOfCitizenship"); // assert Country[] resid = d2.CountriesOfResidency.ToArray(); Assert.AreEqual(2, resid.Length, "Should be two CountryOfResidencys"); Assert.AreEqual("CC2", resid[0].TextValue, "First CountryOfResidencys"); Assert.AreEqual("CC3", resid[1].TextValue, "Second CountryOfResidencys"); }
private void LoadZoneData() { Status = "Loading Zone System"; ZoneSystem.LoadData(); Status = "Loading Demographics"; Demographics.LoadData(); }
//set the class properties using the XElement public virtual void SetHealthBenefit1Properties(XElement currentCalculationsElement) { if (Demographics == null) { Demographics = new Demog1(); } Demographics.SetDemog1Properties(currentCalculationsElement); //don't set any input properties; each calculator should set what's needed separately this.OutputCost = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputCost); this.BenefitAdjustment = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cBenefitAdjustment); this.AdjustedBenefit = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAdjustedBenefit); this.OutputEffect1Name = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputEffect1Name); this.OutputEffect1Unit = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputEffect1Unit); this.OutputEffect1Amount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Amount); this.OutputEffect1Price = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Price); this.OutputEffect1Cost = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Cost); this.AverageBenefitRating = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAverageBenefitRating); this.PhysicalHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cPhysicalHealthRating); this.EmotionalHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cEmotionalHealthRating); this.SocialHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cSocialHealthRating); this.EconomicHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cEconomicHealthRating); this.HealthCareDeliveryRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cHealthCareDeliveryRating); this.BeforeQOLRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cBeforeQOLRating); this.AfterQOLRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cAfterQOLRating); this.BeforeYears = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cBeforeYears); this.AfterYears = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAfterYears); this.AfterYearsProb = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAfterYearsProb); this.TimeTradeoffYears = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimeTradeoffYears); this.EquityMultiplier = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cEquityMultiplier); this.BenefitAssessment = CalculatorHelpers.GetAttribute(currentCalculationsElement, cBenefitAssessment); this.QALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cQALY); this.ICERQALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cICERQALY); this.TTOQALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTTOQALY); this.WillDoSurvey = CalculatorHelpers.GetAttributeBool(currentCalculationsElement, cWillDoSurvey); }
public virtual void SetHealthBenefit1Attributes(string attNameExtension, ref XmlWriter writer) { if (Demographics == null) { Demographics = new Demog1(); } Demographics.SetDemog1Attributes(attNameExtension, ref writer); writer.WriteAttributeString(string.Concat(cOutputCost, attNameExtension), this.OutputCost.ToString()); writer.WriteAttributeString(string.Concat(cBenefitAdjustment, attNameExtension), this.BenefitAdjustment.ToString()); writer.WriteAttributeString(string.Concat(cAdjustedBenefit, attNameExtension), this.AdjustedBenefit.ToString()); writer.WriteAttributeString(string.Concat(cOutputEffect1Name, attNameExtension), this.OutputEffect1Name); writer.WriteAttributeString(string.Concat(cOutputEffect1Unit, attNameExtension), this.OutputEffect1Unit); writer.WriteAttributeString(string.Concat(cOutputEffect1Amount, attNameExtension), this.OutputEffect1Amount.ToString()); writer.WriteAttributeString(string.Concat(cOutputEffect1Price, attNameExtension), this.OutputEffect1Price.ToString()); writer.WriteAttributeString(string.Concat(cOutputEffect1Cost, attNameExtension), this.OutputEffect1Cost.ToString()); writer.WriteAttributeString(string.Concat(cAverageBenefitRating, attNameExtension), this.AverageBenefitRating.ToString()); writer.WriteAttributeString(string.Concat(cPhysicalHealthRating, attNameExtension), this.PhysicalHealthRating.ToString()); writer.WriteAttributeString(string.Concat(cEmotionalHealthRating, attNameExtension), this.EmotionalHealthRating.ToString()); writer.WriteAttributeString(string.Concat(cSocialHealthRating, attNameExtension), this.SocialHealthRating.ToString()); writer.WriteAttributeString(string.Concat(cEconomicHealthRating, attNameExtension), this.EconomicHealthRating.ToString()); writer.WriteAttributeString(string.Concat(cHealthCareDeliveryRating, attNameExtension), this.HealthCareDeliveryRating.ToString()); writer.WriteAttributeString(string.Concat(cBeforeQOLRating, attNameExtension), this.BeforeQOLRating.ToString()); writer.WriteAttributeString(string.Concat(cAfterQOLRating, attNameExtension), this.AfterQOLRating.ToString()); writer.WriteAttributeString(string.Concat(cBeforeYears, attNameExtension), this.BeforeYears.ToString()); writer.WriteAttributeString(string.Concat(cAfterYears, attNameExtension), this.AfterYears.ToString()); writer.WriteAttributeString(string.Concat(cAfterYearsProb, attNameExtension), this.AfterYearsProb.ToString()); writer.WriteAttributeString(string.Concat(cTimeTradeoffYears, attNameExtension), this.TimeTradeoffYears.ToString()); writer.WriteAttributeString(string.Concat(cEquityMultiplier, attNameExtension), this.EquityMultiplier.ToString()); writer.WriteAttributeString(string.Concat(cBenefitAssessment, attNameExtension), this.BenefitAssessment.ToString()); writer.WriteAttributeString(string.Concat(cQALY, attNameExtension), this.QALY.ToString()); writer.WriteAttributeString(string.Concat(cICERQALY, attNameExtension), this.ICERQALY.ToString()); writer.WriteAttributeString(string.Concat(cTTOQALY, attNameExtension), this.TTOQALY.ToString()); writer.WriteAttributeString(string.Concat(cWillDoSurvey, attNameExtension), this.WillDoSurvey.ToString()); }
public void Functional_GetDependants() { try { Demographics d = new Demographics(); Patient p = new Patient(d); p.FirstName = "Divyangbhai"; p.LastName = "Dankhara"; p.HCN = "1234567890AB"; p.MInitial = "A"; p.DateOfBirth = "12111997"; p.Sex = "M"; d.AddNewPatient(p); List <Patient> dp = d.GetDependants(p); if (!(dp == null)) { foreach (Patient a in dp) { if (!(a.HeadOfHouse == p.HCN)) { Assert.Fail(); } } } } catch (Exception) { Assert.Fail(); } }
/** * \brief <b>Brief Description</b> - Execute <b><i>class method</i></b> - An overload of the entry point into the reconcile summary viewing menu * \details <b>Details</b> * * This takes in the existing patient information, if it should return a patient and the demographics library * * \return <b>void</b> */ public void Execute(Scheduling scheduling, Demographics demographics, Billing billing) { Container.DisplayContent(new List <Pair <string, string> >() { { new Pair <string, string>("", "") } }, 2, 1, MenuCodes.BILLING, "Billing", Description); // let the user pick a month DateTime getMonth = DatePicker.GetDate(scheduling, DateTime.Today, false); // check if user did not cancel during month selection screen if (getMonth.Ticks != 0) { // generate the government file name string date = string.Format("{0}{1}govFile.txt", getMonth.Year, getMonth.Month); // get the list of the report contents List <string> report = billing.ReconcileMonthlyBilling(date); List <Pair <string, string> > content = new List <Pair <string, string> >(); // create the content using the lines in the report foreach (string line in report) { content.Add(new Pair <string, string>(line, "")); } // display the contents of the report Container.DisplayContent(content, 2, -1, MenuCodes.BILLING, "Billing", Description); Console.ReadKey(); } }
public void Functional_GetPatientbyHCN() { try { Demographics d = new Demographics(); Patient p = new Patient(d); p.FirstName = "Divyangbhai"; p.LastName = "Dankhara"; p.HCN = "0987654321AB"; p.MInitial = "A"; p.DateOfBirth = "12111997"; p.Sex = "M"; p.HeadOfHouse = "1234567890AB"; d.AddNewPatient(p); Patient dp = d.GetPatientByHCN(p.HCN); if (!(dp.HCN == p.HCN)) { Assert.Fail(); } } catch (Exception) { Assert.Fail(); } }
private async Task <Demographics> GetPhotoDemographics(string sasUri) { Demographics d = null; //TODO 6. Invoke Face API with URI to photo IFaceServiceClient faceServiceClient = new FaceServiceClient(_faceApiKey, _faceEndpoint); //TODO 7. Configure the desired attributes Age and Gender IEnumerable <FaceAttributeType> desiredAttributes = new FaceAttributeType[] { FaceAttributeType.Age, FaceAttributeType.Gender }; //TODO 8. Invoke the Face API Detect operation Face[] faces = await faceServiceClient.DetectAsync(sasUri, false, true, desiredAttributes); if (faces.Length > 0) { //TODO 9. Extract the age and gender from the Face API response double computedAge = faces[0].FaceAttributes.Age; string computedGender = faces[0].FaceAttributes.Gender; d = new Demographics() { age = faces[0].FaceAttributes.Age, gender = faces[0].FaceAttributes.Gender }; } return(d); }
/// <summary> /// Returns the Demographics instance for the assessment. /// </summary> /// <param name="assessmentId"></param> /// <returns></returns> public Demographics GetDemographics(int assessmentId) { Demographics demographics = new Demographics { AssessmentId = assessmentId }; using (var db = new CSET_Context()) { var query = from ddd in db.DEMOGRAPHICS from ds in db.DEMOGRAPHICS_SIZE.Where(x => x.Size == ddd.Size).DefaultIfEmpty() from dav in db.DEMOGRAPHICS_ASSET_VALUES.Where(x => x.AssetValue == ddd.AssetValue).DefaultIfEmpty() where ddd.Assessment_Id == assessmentId select new { ddd, ds, dav }; var hit = query.FirstOrDefault(); if (hit != null) { demographics.SectorId = hit.ddd.SectorId; demographics.IndustryId = hit.ddd.IndustryId; demographics.AssetValue = hit.dav?.DemographicsAssetId; demographics.Size = hit.ds?.DemographicId; demographics.PointOfContact = hit.ddd?.PointOfContact; demographics.Agency = hit.ddd?.Agency; demographics.Facilitator = hit.ddd?.Facilitator; demographics.IsScoped = hit.ddd?.IsScoped != false; demographics.OrganizationName = hit.ddd?.OrganizationName; demographics.OrganizationType = hit.ddd?.OrganizationType; } return(demographics); } }
public ActionResult Index(long geographicLocationId) { using (var context = ContextFactory.SizeUpContext) { var data = Demographics.Get(context, geographicLocationId); return(Json(data, JsonRequestBehavior.AllowGet)); } }
public ActionResult DeleteConfirmed(int id) { Demographics demographics = db.Demographics.Find(id); db.Demographics.Remove(demographics); db.SaveChanges(); return(RedirectToAction("Index")); }
static void Main(string[] args) { // start the console in full screen Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight); ShowWindow(ThisConsole, MAXIMIZE); // create the menu object Menu menu = new Menu(MenuCodes.MAINMENU, "main menu"); // set the default look of the console SetUpConsole("EMS SYSTEM 2.0"); // display the main header Container.DisplayHeader("EMS System 2.0 - A system by Attila, Alex, Divyang and Tudor"); // display the main menu menu.DisplayMenu(); // display the footer with only the quit button Container.DisplayFooterContent(FooterFlags.Quit); Scheduling scheduling = new Scheduling(); Demographics demographics = new Demographics(); Billing billing = new Billing(); ConsoleKey input = Console.ReadKey(true).Key; do { // if the key the user pressed changed something if (menu.ChangeMenu(input, scheduling, demographics, billing)) { // hide the cursor and reset its position Console.CursorTop = 0; Console.CursorLeft = 0; Console.CursorVisible = false; // re-display the header Container.DisplayHeader("EMS System 2.0 - A system by Attila, Alex, Divyang and Tudor"); // display the changed menu menu.DisplayMenu(); // display the right footer depending on what menu the user is on if (menu._selectedMenu == MenuCodes.MAINMENU) { Container.DisplayFooterContent(FooterFlags.Quit); } else { Container.DisplayFooterContent(FooterFlags.Back | FooterFlags.Quit); } } // read another key from the user input = Console.ReadKey(true).Key; } while (input != ConsoleKey.X); }
private void CreateEnumItem(CohortEnumLinkAPI linkAPI) { // enum item defined within link item. Must be created and used instead linkAPI.EnumItemId string newEnumItemId = Guid.NewGuid().ToString("B"); // owerwrite id anyway linkAPI.EnumItemId = newEnumItemId; switch (linkAPI.CohortEnumId) { case CohortEnumsDictionary.DiseaseStates: DiseaseStates dsItem = new DiseaseStates(); DirtyCopyEnumItem <DiseaseStates>(linkAPI.enumItem, dsItem, newEnumItemId); Program.MedialynxData.diseaseStatesDBAPI.Add(dsItem); break; case CohortEnumsDictionary.GeneticMatches: GeneticMatches gmItem = new GeneticMatches(); DirtyCopyEnumItem <GeneticMatches>(linkAPI.enumItem, gmItem, newEnumItemId); Program.MedialynxData.geneticMatchesDBAPI.Add(gmItem); break; case CohortEnumsDictionary.Biomarkers: Biomarkers bmItem = new Biomarkers(); DirtyCopyEnumItem <Biomarkers>(linkAPI.enumItem, bmItem, newEnumItemId); Program.MedialynxData.biomarkersDBAPI.Add(bmItem); break; case CohortEnumsDictionary.Demographics: Demographics dmItem = new Demographics(); DirtyCopyEnumItem <Demographics>(linkAPI.enumItem, dmItem, newEnumItemId); Program.MedialynxData.demographicsDBAPI.Add(dmItem); break; case CohortEnumsDictionary.Ethnicitys: Ethnicitys eItem = new Ethnicitys(); DirtyCopyEnumItem <Ethnicitys>(linkAPI.enumItem, eItem, newEnumItemId); Program.MedialynxData.ethnicitysDBAPI.Add(eItem); break; case CohortEnumsDictionary.StageOfDiseases: StageOfDiseases sdItem = new StageOfDiseases(); DirtyCopyEnumItem <StageOfDiseases>(linkAPI.enumItem, sdItem, newEnumItemId); Program.MedialynxData.stageOfDiseasesDBAPI.Add(sdItem); break; case CohortEnumsDictionary.Prognosis: Prognosis pItem = new Prognosis(); DirtyCopyEnumItem <Prognosis>(linkAPI.enumItem, pItem, newEnumItemId); Program.MedialynxData.prognosisDBAPI.Add(pItem); break; case CohortEnumsDictionary.PreviousTreatments: PreviousTreatments ptItem = new PreviousTreatments(); DirtyCopyEnumItem <PreviousTreatments>(linkAPI.enumItem, ptItem, newEnumItemId); Program.MedialynxData.previousTreatmentsDBAPI.Add(ptItem); break; } }
public void Add(object enumItemObject) { Demographics enumItem = (Demographics)enumItemObject; using (var dbContext = new MedialynxDbDemographicsContext()) { dbContext.Demographics.Add(enumItem); dbContext.SaveChanges(); } }
private static StudentPersonal CreateStudent( String id, String lastName, String firstName, String street, String city, String state, CountryCode country, String post, String phone, Sex gender, YearLevelCode grade, String birthDateyyyyMMdd) { StudentPersonal student = new StudentPersonal(); ; student.RefId = Adk.MakeGuid(); student.LocalId = id; PersonInfo stupersonal = new PersonInfo(); student.PersonInfo = stupersonal; // Set the Name Name name = new Name(NameType.LEGAL); name.FamilyName = lastName; name.GivenName = firstName; stupersonal.Name = name; Address addr = new Address(); addr.SetType(AddressType.C0765_PHYSICAL_LOCATION); addr.SetStreet(street); addr.City = city; addr.StateProvince = state; addr.PostalCode = post; addr.Country = country.ToString(); stupersonal.AddressList = new AddressList(addr); stupersonal.PhoneNumberList = new PhoneNumberList(new PhoneNumber(PhoneNumberType.PRIMARY, phone)); Demographics dem = new Demographics(); dem.SetSex(gender); dem.BirthDate = DateTime.ParseExact (birthDateyyyyMMdd, "yyyyMMdd", CultureInfo.InvariantCulture.DateTimeFormat); stupersonal.Demographics = dem; return(student); }
public ActionResult EditClient(Demographics model, String id) { var searchList = her_care.Controllers.DBBaseAdmin.ClientDetails(id); ViewBag.MyModel = searchList; return(View()); }
private static IndivoExercisePlan CreateIndivoExercisePlan(string accountId, ExercisePlan plan, Demographics demo) { // Default values in case we can't retrieve demographics int age = 0; string gender = string.Empty; if (demo != null) { age = GetAgeFromBirthDate(demo.dateOfBirth); gender = demo.gender; // dummy data in case indivo cant connect if (String.IsNullOrEmpty(gender)) gender = "Female"; } IndivoExercisePlan indivoPlan = new IndivoExercisePlan(plan, accountId, age, gender); return indivoPlan; }
private SifDataObject createPerson(string id, string lastName, string firstName, string number, string street, string locality, string town, string post, string phone, string gender, string grade, EthnicityCodes ethnicity, string birthDateyyyyMMdd) { SifDataObject person = createPersonObject(id); person.SetElementOrAttribute("@RefId", Adk.MakeGuid()); Name name = new Name(NameType.CURRENT_LEGAL, firstName, lastName); PersonalInformation personal = new PersonalInformation(name); person.AddChild(CommonDTD.PERSONALINFORMATION, personal); AddressableObjectName aon = new AddressableObjectName(); aon.StartNumber = number; Address address = new Address(AddressType.CURRENT, aon); address.Street = street; address.Locality = locality; address.Town = town; address.PostCode = post; address.SetCountry(CountryCode.GBR); personal.Address = address; personal.PhoneNumber = new PhoneNumber(PhoneType.HOME, phone); Demographics dem = new Demographics(); dem.SetEthnicityList(new Ethnicity(ethnicity)); dem.SetGender(Gender.Wrap(gender)); try { dem.BirthDate = SifDate.ParseSifDateString(birthDateyyyyMMdd, SifVersion.SIF15r1); } catch (Exception pex) { Console.WriteLine(pex); } personal.Demographics = dem; return person; }