private void StoreTriageData() { #region store vitals foreach (TriageVitals tv in triageStatus.triageVitals) { string timestamp = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString(); string hourminute = tv.situation.Substring(1, 2) + tv.situation.Substring(4, 2) + "00" + clinicData.timeZone; timestamp += hourminute; if (tv.t != null) { VitalSign t = new VitalSign(); t.id = "NI";//DEBUG need ID; t.timeStamp = timestamp; t.status = "completed"; t.unit = "c"; t.value = tv.t; t.code = "NI";//DEBUG need code t.codeSystem = clinicData.vitalSignCode; t.displayName = "Tempurature";//DEBUG need official display names t.comment = "Triage: " + tv.situation; patientForm.encounterData.vitalSigns.Add(t); } if (tv.p != null) { VitalSign p = new VitalSign(); p.id = "NI";//DEBUG need ID; p.timeStamp = timestamp; p.status = "completed"; p.unit = "NI"; p.value = tv.p; p.code = "NI";//DEBUG need code p.codeSystem = clinicData.vitalSignCode; p.displayName = "pulse";//DEBUG need official display names p.comment = "Triage: " + tv.situation; patientForm.encounterData.vitalSigns.Add(p); } if (tv.bp != null) { VitalSign b = new VitalSign(); b.id = "NI";//DEBUG need ID; b.timeStamp = timestamp; b.status = "completed"; b.unit = "NI"; b.value = tv.t; b.code = "NI";//DEBUG need code b.codeSystem = clinicData.vitalSignCode; b.displayName = "blood pressure";//DEBUG need official display names b.comment = "Triage: " + tv.situation; patientForm.encounterData.vitalSigns.Add(b); } if (tv.o2sat != null) { VitalSign o = new VitalSign(); o.id = "NI";//DEBUG need ID; o.timeStamp = timestamp; o.status = "completed"; o.unit = "NI"; o.value = tv.t; o.code = "NI";//DEBUG need code o.codeSystem = clinicData.vitalSignCode; o.displayName = "o2 saturation";//DEBUG need official display names o.comment = "Triage: " + tv.situation; patientForm.encounterData.vitalSigns.Add(o); } } #endregion end vitals patientForm.encounterData.encounter.reason = label75.Text; #region create red flags foreach (RedFlags r in triageStatus.redFlags) { Condition c = new Condition(); c.code = "NI"; c.codeSystem = clinicData.problemCode; c.code = "00000"; //DEBUG need codes! c.problemName = r.name; c.displayName = "Red Flags"; c.startYear = "1900"; //DEBUG start dates??? c.comment = r.comment; patientForm.encounterData.conditions.Add(c); } #endregion #region create Assessments Condition cc = new Condition(); cc.code = "NI"; cc.codeSystem = clinicData.problemCode; cc.code = "1"; //using 1 for active assessments, 0 for deleted cc.problemName = label75.Text; cc.displayName = "Assessment"; cc.startYear = "1900"; //DEBUG start dates??? cc.comment = "Enter Notes Here"; patientForm.encounterData.conditions.Add(cc); foreach (RedFlags r in triageStatus.redFlags) { Condition c = new Condition(); c.code = "NI"; c.codeSystem = clinicData.problemCode; c.code = "1"; //DEBUG need codes! c.problemName = r.name; c.displayName = "Assessment"; c.startYear = "1900"; //DEBUG start dates??? c.comment = r.comment; patientForm.encounterData.conditions.Add(c); } #endregion #region create immunizations foreach (WhoVaccine w in triageStatus.whoVaccines) { Immunization i = new Immunization(); i.code = "000000"; //DEBUG need codes i.codeSystem = clinicData.immunizationCode; i.comment = "Clinic Tab"; i.dateAdministered = w.date; i.displayName = w.name; i.text = "WHO Vaccines"; patientForm.encounterData.immunizations.Add(i); } #endregion end immunizations }
private void ReadImmunizations(XmlTextReader textReader) { bool readingImmunizations = true; while (readingImmunizations) { textReader.Read(); switch (textReader.LocalName) { case "immunizations": readingImmunizations = false; break; case "immunization": Immunization newImmunization = new Immunization(); bool readingEncounter = true; while (readingEncounter) { textReader.Read(); switch (textReader.LocalName) { case "immunization": readingEncounter = false; break; case "administeredDate": newImmunization.dateAdministered = textReader.GetAttribute(0); break; case "codedProductName": newImmunization.codeSystem = textReader.GetAttribute(0); newImmunization.displayName = textReader.GetAttribute(1); newImmunization.code = textReader.GetAttribute(2); break; case "freeTextProductName": textReader.Read(); newImmunization.text = textReader.Value.ToString(); textReader.Read(); break; case "comment": textReader.Read(); textReader.Read(); newImmunization.comment = textReader.Value.ToString(); textReader.Read(); textReader.Read(); break; } } patientForm.encounterData.immunizations.Add(newImmunization); break; } } }