private void ButtonClinicSaveData_Click(object sender, EventArgs e) { patientForm.encounterData.encounter.notes = ClinicTabNotesEntry.Text; //write hemoglobin test if (textBox38.Text.Length > 0) { LabResult h = new LabResult(); h.displayName = "Hemoglobin Test"; h.value = textBox38.Text; h.referenceRange = label119.Text; h.comment = "Clinic Tab"; h.id = patientForm.GetUUID(); h.interpretCode = "NI"; h.interpretCodeSystem = clinicData.resultsInterpretCode; h.referenceRange = clinicData.hemoglobinRange; h.status = "Completed"; h.timeStamp = patientForm.GetTimeStamp() + clinicData.timeZone; h.typeCode = "NI"; h.typeCodeSystem = clinicData.resultTypeCode; h.unit = "NI"; patientForm.encounterData.labResults.Add(h); } //write orasure test if (comboBox22.Text.Length > 0) { LabResult o = new LabResult(); o.displayName = "Orasure Test"; o.value = comboBox22.Text; o.referenceRange = "NI"; o.comment = "Clinic Tab"; o.id = patientForm.GetUUID(); o.interpretCode = "NI"; o.interpretCodeSystem = clinicData.resultsInterpretCode; o.referenceRange = "NI"; o.status = "Completed"; o.timeStamp = patientForm.GetTimeStamp() + clinicData.timeZone; o.typeCode = "NI"; o.typeCodeSystem = clinicData.resultTypeCode; o.unit = "NI"; patientForm.encounterData.labResults.Add(o); } //write stool O&P test if (textBox39.Text.Length > 0 || comboBox23.Text.Length > 0) { LabResult s = new LabResult(); s.displayName = "Stool O&P Test"; s.value = comboBox23.Text + " Notes: " + textBox39.Text; s.referenceRange = "NI"; s.comment = "Clinic Tab"; s.id = patientForm.GetUUID(); s.interpretCode = "NI"; s.interpretCodeSystem = clinicData.resultsInterpretCode; s.referenceRange = "NI"; s.status = "Completed"; s.timeStamp = patientForm.GetTimeStamp() + clinicData.timeZone; s.typeCode = "NI"; s.typeCodeSystem = clinicData.resultTypeCode; s.unit = "NI"; patientForm.encounterData.labResults.Add(s); } foreach (string[] plan in clinicTabStatus.plansOfCareList) { string s = plan[0]; for (int i = 1; i < plan.Length - 2; i++) { s += "|" + plan[i]; } s += "|" + plan[plan.Length - 2]; PlanOfCare p = new PlanOfCare(); p.text = s; p.id = plan[plan.Length - 1]; p.code = ""; p.codeSystem = ""; p.displayName = ""; int addIndex = Convert.ToInt16(plan[0]); if (patientForm.encounterData.planofCares.Count <= addIndex) { while (patientForm.encounterData.planofCares.Count <= addIndex) { patientForm.encounterData.planofCares.Add(new PlanOfCare()); } } patientForm.encounterData.planofCares[addIndex] = p; } xmlHandler.WriteCurrentPatientXML(); LoadExitReviewPatient(); InitializeClinicTabData(); }
private void ReadLabResults(XmlTextReader textReader) { bool readingResults = true; while (readingResults) { textReader.Read(); switch (textReader.LocalName) { case "results": readingResults = false; break; case "result": LabResult newResult = new LabResult(); bool readingResult = true; while (readingResult) { textReader.Read(); switch (textReader.LocalName) { case "result": readingResult = false; break; case "resultID": newResult.id = textReader.GetAttribute(0); break; case "resultDateTime": newResult.timeStamp = textReader.GetAttribute(0); break; case "resultType": newResult.typeCodeSystem = textReader.GetAttribute(0); newResult.typeCode = textReader.GetAttribute(1); newResult.displayName = textReader.GetAttribute(2); break; case "resultStatus": newResult.status = textReader.GetAttribute(0); break; case "physicalQuantity": newResult.value = textReader.GetAttribute(0); newResult.unit = textReader.GetAttribute(1); break; case "resultInterpretation": newResult.interpretCodeSystem = textReader.GetAttribute(0); newResult.interpretCode = textReader.GetAttribute(1); break; case "resultReferenceRange": textReader.Read(); newResult.referenceRange = textReader.Value.ToString(); textReader.Read(); break; case "comment": textReader.Read(); textReader.Read(); newResult.comment = textReader.Value.ToString(); textReader.Read(); textReader.Read(); break; } } patientForm.encounterData.labResults.Add(newResult); break; } } }