private void button1_Click(object sender, EventArgs e) { if (pmh != null && sendingView != null) { ClincalObservation co = new ClincalObservation(pmh); co.disease = diseaseComboBox.Text; co.ageDiagnosis = AgeTextBox.Text; co.SetDiseaseDetails(); HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); args.Persist = true; pmh.Observations.AddToList(co, args); this.Close(); } }
private void ageDiagnosis_Validated(object sender, EventArgs e) { foreach (ClincalObservation co in PMHHx.Observations) { if (co.disease.Equals("Bilateral Oophorectomy")) { if ((String.IsNullOrEmpty(ageDiagnosis.Text)) || (bothOvariesRemoved.Text != "Yes")) { PMHHx.Observations.RemoveFromList(co, SessionManager.Instance.securityContext); } else { co.ageDiagnosis = ageDiagnosis.Text; HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); args.Persist = true; args.updatedMembers.Add(co.GetMemberByName("ageDiagnosis")); co.SignalModelChanged(args); } return; } } // add the disease... if (bothOvariesRemoved.Text.Equals("Yes")) { ClincalObservation co2 = new ClincalObservation(PMHHx); co2.disease = "Bilateral Oophorectomy"; co2.SetDiseaseDetails(); //SessionManager.Instance.MetaData.Diseases.SetDataFromDiseaseName(ref co2); co2.ageDiagnosis = ageDiagnosis.Text; HraModelChangedEventArgs args2 = new HraModelChangedEventArgs(null); args2.Persist = true; PMHHx.Observations.AddToList(co2, args2); } }
public void EditSurvey(RiskApps3.Model.PatientRecord.Patient proband, ViewModels.FamilyHistoryRelative obj) { RiskApps3.Model.PatientRecord.PastMedicalHistory pmh = new RiskApps3.Model.PatientRecord.PastMedicalHistory(proband); Person per = proband.FHx.Relatives.Where(p => p.relativeID == obj.RelativeId).FirstOrDefault(); per.vitalStatus = obj.VitalStatus; per.relationship = obj.Relationship; per.age = obj.RelativeAge; HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); args.updatedMembers.Add(per.GetMemberByName("vitalStatus")); //args.updatedMembers.Add(per.GetMemberByName("relationship")); args.updatedMembers.Add(per.GetMemberByName("age")); per.BackgroundPersistWork(args); relative = per; relative.PMH.BackgroundLoadWork(); pmh = relative.PMH; SessionManager.Instance.MetaData.Diseases.BackgroundListLoad(); relative.PMH.BackgroundLoadWork(); for (int i = 0; i < 3; i++) { ClincalObservation co = new ClincalObservation(); if (i < pmh.Observations.Count) { co = (ClincalObservation)pmh.Observations[i]; } switch (i) { case 0: if (co.instanceID != 0) { co.disease = obj.FirstDx; co.ageDiagnosis = obj.FirstAgeOnset; co.SetDiseaseDetails(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.updatedMembers.Add(co.GetMemberByName("disease")); args1.updatedMembers.Add(co.GetMemberByName("ageDiagnosis")); co.BackgroundPersistWork(args1); } else { ClincalObservation co1 = new ClincalObservation(pmh); co1.disease = obj.FirstDx; co1.ageDiagnosis = obj.FirstAgeOnset; co1.SetDiseaseDetails(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.updatedMembers.Add(co1.GetMemberByName("disease")); args1.updatedMembers.Add(co1.GetMemberByName("ageDiagnosis")); co1.BackgroundPersistWork(args1); pmh.Observations.AddToList(co1, args1); } break; case 1: if (co.instanceID != 0) { co.disease = obj.SecondDx; co.ageDiagnosis = obj.SecondAgeOnset; co.SetDiseaseDetails(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.updatedMembers.Add(co.GetMemberByName("disease")); args1.updatedMembers.Add(co.GetMemberByName("ageDiagnosis")); co.BackgroundPersistWork(args1); } else { ClincalObservation co1 = new ClincalObservation(pmh); co1.disease = obj.SecondDx; co1.ageDiagnosis = obj.SecondAgeOnset; co1.SetDiseaseDetails(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.updatedMembers.Add(co1.GetMemberByName("disease")); args1.updatedMembers.Add(co1.GetMemberByName("ageDiagnosis")); co1.BackgroundPersistWork(args1); pmh.Observations.AddToList(co1, args1); } break; case 2: if (co.instanceID != 0) { co.disease = obj.ThirdDx; co.ageDiagnosis = obj.ThirdAgeOnset; co.SetDiseaseDetails(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.updatedMembers.Add(co.GetMemberByName("disease")); args1.updatedMembers.Add(co.GetMemberByName("ageDiagnosis")); co.BackgroundPersistWork(args1); } else { ClincalObservation co1 = new ClincalObservation(pmh); co1.disease = obj.ThirdDx; co1.ageDiagnosis = obj.ThirdAgeOnset; co1.SetDiseaseDetails(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.updatedMembers.Add(co1.GetMemberByName("disease")); args1.updatedMembers.Add(co1.GetMemberByName("ageDiagnosis")); co1.BackgroundPersistWork(args1); pmh.Observations.AddToList(co1, args1); } break; default: break; } } }
private void comboBox8_Validated(object sender, EventArgs e) { if (comboBox8.Tag != null) { ClincalObservation co = (ClincalObservation)comboBox8.Tag; HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); if (comboBox8.Text.Length > 0) { co.disease = comboBox8.Text; co.ageDiagnosis = textBox4.Text; co.SetDiseaseDetails(); } else { args.Delete = true; } co.SignalModelChanged(args); } else if (comboBox8.Text.Length > 0) { ClincalObservation co = new ClincalObservation(pmh); co.disease = comboBox8.Text; co.ageDiagnosis = textBox4.Text; co.SetDiseaseDetails(); HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); pmh.Observations.AddToList(co, args); comboBox8.Tag = co; } }