private void NewPatient() { PatientId = "NEW PATIENT"; Active = true; Deceased = false; Name = ""; GivenName = ""; BirthDate = DateTime.Now; //added: ETA = DateTime.Now; MultipleBirth = false; Gender = AdministrativeGender.Unknown; MaritalState = MaritalStatusList.FirstOrDefault(x => x.Equals("unknown")); Nationality = NationalityList.First(x => x.Equals("Other")); Address1 = ""; Address2 = ""; Zip = ""; City = ""; State = ""; Country = ""; CPR = ""; FromDestination = ""; AgeOfPatient = ""; Phone = ""; Mobile = ""; Email = ""; Photo = "unknown-male.jpg"; }
private void PopulateWithDefaultData() { NewPatient(); Name = "Doe"; GivenName = "John"; BirthDate = new DateTime(1925, 8, 27); MultipleBirth = false; Gender = AdministrativeGender.Male; Active = true; Deceased = false; MaritalState = MaritalStatusList.FirstOrDefault(x => x.Equals("married")); Nationality = NationalityList.First(x => x.Equals("US")); Photo = "unknown-male.jpg"; Address1 = "Nørre Alle"; Address2 = "12"; Triage = "TriageRed"; Specialty = "Unknown"; HospitalName = "AUH"; CPR = "1212121212"; FromDestination = "Grenåvej"; AgeOfPatient = "40"; Zip = "8000"; City = "Aarhus"; State = "Midtjylland"; Country = "Denmark"; Phone = "12345678"; Mobile = ""; Email = "*****@*****.**"; }
private void ExecuteReadData(object obj) { String id = PatientId; NewPatient(); PatientId = "UNKNOWN"; var uri = new Uri(_url); var client = new FhirClient(uri); var location = String.Format("{0}/Patient/{1}", _url, id); Patient entry = null; try { entry = client.Read <Patient>(new Uri(location)); //entry = client.Read(location); if (entry == null) { return; } _entry = entry; //var identity = new ResourceIdentity(_entry.Id); //PatientId = identity.Id; var identity = _entry.Id; PatientId = identity; var patient = _entry; Active = patient.Active ?? true; var d = patient.Deceased as Hl7.Fhir.Model.FhirBoolean; if (d != null) { Deceased = d.Value ?? false; } else { Deceased = false; } Name = patient.Name[0].Family.ToString(); GivenName = patient.Name[0].GivenElement[0].ToString(); if (patient.BirthDate != null) { BirthDate = DateTime.Parse(patient.BirthDate); } var m = patient.MultipleBirth as FhirBoolean; if (m != null) { MultipleBirth = m.Value ?? false; } else { MultipleBirth = false; } // The following properties are not yet updated, simply set them to default values // // TODO // Gender = patient.Gender ?? AdministrativeGender.Unknown; CPR = patient.Identifier[0].Value.ToString(); Triage = patient.GetStringExtension("http://www.example.com/triagetest") ?? "Unknown"; Specialty = patient.GetStringExtension("http://www.example.com/SpecialtyTest") ?? "Unknown"; HospitalName = patient.Identifier[1].Value ?? "Unknown"; //patient.GetStringExtension("http://www.example.com/hospitalTest") ?? "To hospital went wrong"; FromDestination = patient.Identifier[2].Value ?? "Unknown"; //AgeOfPatient = patient. //Tjek op på at den er i Identity ETA = Convert.ToDateTime(patient.GetExtension("http://www.example.com/datetimeTest").Value.ToString()); MaritalState = MaritalStatusList.FirstOrDefault(x => x.Equals("unknown")); Nationality = NationalityList.First(x => x.Equals("Other")); //if(patient.Address[0] != null) Address1 = patient.Address[0].LineElement[0].ToString(); // if (patient.Address[0].LineElement[1] != null) Address2 = patient.Address[0].LineElement[1].ToString(); // if (patient.Address[0].PostalCode != null) Zip = patient.Address[0].PostalCode; // if (patient.Address[0].City != null) City = patient.Address[0].City; // if (patient.Address[0].State != null) State = patient.Address[0].State; // if (patient.Address[0].Country != null) Country = patient.Address[0].Country; // if (patient.Telecom[0] != null) Phone = patient.Telecom[0].Value; // if (patient.Telecom[1] != null) Mobile = patient.Telecom[1].Value; // if (patient.Telecom[2] != null) Email = patient.Telecom[2].Value; // Photo = null; } catch (Exception) { NewPatient(); } }
async Task LoadDropDownData() { List <string> liYeaNo = new List <string>(); liYeaNo.Add("Yes"); liYeaNo.Add("No"); DomicileUksList = liYeaNo; FreedomFightersList = liYeaNo; DefencePersonalList = liYeaNo; PhysicallyChallengesList = liYeaNo; PunishedByCourtList = liYeaNo; DabarredCollegeList = liYeaNo; EWS = liYeaNo; ExamCenterList.Add("Almora"); ExamCenterList.Add("Bageshwar"); ExamCenterList.Add("Haldwani"); ExamCenterList.Add("Kashipur"); ExamCenterList.Add("Nainital"); ExamCenterList.Add("Pithoragarh"); ExamCenterList.Add("Ram Nagar"); ExamCenterList.Add("Rudrapur"); ExamCenterList.Add("Ranikhet"); ExamCenterList.Add("Khatima"); ExamCenterList.Add("Dwarahat"); ExamCenterList.Add("Lohaghat"); ExamCenterList.Add("Kichha"); ExamCenterList.Add("Berinag"); GroupList.Add("Arts"); GroupList.Add("Commerce"); GroupList.Add("Science"); MaritalStatusList.Add("Single"); MaritalStatusList.Add("Married"); NationalityList.Add("Indian"); NationalityList.Add("Others"); CategoryList.Add("Unreserved General"); CategoryList.Add("Schedule Cast (SC)"); CategoryList.Add("Schedule Tribe (ST)"); CategoryList.Add("Other Backward Class (OBC) - Creamy"); CategoryList.Add("Other Backward Class (OBC) - Non Creamy"); PhysicallyChallengesTypeList.Add("Physically Challenged"); PhysicallyChallengesTypeList.Add("Visually Challenged"); PhysicallyChallengesTypeList.Add("None"); GendersList.Add("Male"); GendersList.Add("Female"); GendersList.Add("Transgender"); StreamList.Add("Humanities/Arts"); StreamList.Add("Commerce"); StreamList.Add("Science"); CoursesList.Add("Bachelor of Education"); CoursesList.Add("Master of Education"); PassingYearList.Add("Appearing"); PassingYearList.Add("2020"); PassingYearList.Add("2019"); PassingYearList.Add("2018"); PassingYearList.Add("2017"); PassingYearList.Add("2016"); PassingYearList.Add("2015"); PassingYearList.Add("2014"); PassingYearList.Add("2013"); PassingYearList.Add("2012"); PassingYearList.Add("2011"); PassingYearList.Add("2010"); M_EdGraducationRequired.Add("B.Ed. Theory"); M_EdGraducationRequired.Add("B.T. Theory"); M_EdGraducationRequired.Add("L.T. Theory"); M_EdGraducationRequired.Add("B.EI.Ed. Theory"); M_EdGraducationRequired.Add("D.EI.Ed. Theory"); M_EdGraducationRequired.Add("B.A B.Ed. Theory"); M_EdGraducationRequired.Add("B.Sc. B.Ed. Theory"); var response = await _httpClient.GetAsync("https://api.covidindiatracker.com/state_data.json"); if (response.IsSuccessStatusCode) { var result = Newtonsoft.Json.JsonConvert.DeserializeObject <IEnumerable <StateData> >( await response.Content.ReadAsStringAsync()); foreach (var state in result) { StateList.Add(state.state); } } }