internal void RemoveObservation(ClincalObservation co) { if (flowLayoutPanel.InvokeRequired) { RemoveObservationCallback aoc = new RemoveObservationCallback(RemoveObservation); object[] args = new object[1]; args[0] = co; this.Invoke(aoc, args); } else { Control toBeRemoved = null; int maxWidth = 0; int totalHeight = 0; foreach (Control c in flowLayoutPanel.Controls) { PedigreeLegendRow plr = (PedigreeLegendRow)c; string plrDisplayName = plr.GetObservationisplayName(); string plrShortName = plr.GetObservationisplayShortName(); if (ClinicalObservationIsMatch(co, plrDisplayName, plrShortName)) { toBeRemoved = c; } } if (toBeRemoved != null) { flowLayoutPanel.Controls.Remove(toBeRemoved); } CalculateOptimalDimensions(); CheckForEmpty(); } }
/**************************************************************************************************/ private void ClinicalObservationListChanged(HraListChangedEventArgs e) { if (e.hraOperand != null && relative != null) { ClincalObservation co = (ClincalObservation)e.hraOperand; } }
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; } }
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); } }
/**************************************************************************************************/ private void ClinicalObservationListChanged(HraListChangedEventArgs e) { if (e.hraOperand != null) { ClincalObservation col = (ClincalObservation)(e.hraOperand); SetNewRelativePMH(listView1, col.owningPMH); } }
/**************************************************************************************************/ private void ClinicalObservationChanged(object sender, HraModelChangedEventArgs e) { if (sender != null) { ClincalObservation col = (ClincalObservation)(sender); SetNewRelativePMH(listView1, col.owningPMH); } }
public PMHRow(ClincalObservation co, HraView ParentView) { this.co = co; InitializeComponent(); owningView = ParentView; disease.Text = co.disease; ageDiagnosis.Text = co.ageDiagnosis; comments.Text = co.comments; }
internal void RemoveObservation(ClincalObservation co) { if (flowLayoutPanel.InvokeRequired) { RemoveObservationCallback aoc = new RemoveObservationCallback(RemoveObservation); object[] args = new object[1]; args[0] = co; this.Invoke(aoc, args); } else { Control toBeRemoved = null; bool noDups = true; int maxWidth = 0; int totalHeight = 0; foreach (Control c in flowLayoutPanel.Controls) { PedigreeLegendRow plr = (PedigreeLegendRow)c; string plrDisplayName = plr.GetObservationisplayName(); string plrShortName = plr.GetObservationisplayShortName(); if (string.Compare(co.ClinicalObservation_diseaseDisplayName, plrDisplayName, true) == 0 && string.Compare(co.ClinicalObservation_diseaseShortName, plrShortName) == 0) { if (noDups) { toBeRemoved = c; } else { noDups = false; } } else { if (plr.Width > maxWidth) { maxWidth = plr.Width; } totalHeight += plr.Height + legendPadding; } } if (toBeRemoved != null && noDups) { flowLayoutPanel.Controls.Remove(toBeRemoved); this.Height -= toBeRemoved.Height + legendPadding; if (maxWidth > 0 && this.Width > maxWidth + legendPadding) { this.Width = maxWidth + legendPadding; this.Height = totalHeight + legendPadding; } } this.Refresh(); CheckForEmpty(); } }
/**************************************************************************************************/ private void ClinicalObservationListChanged(HraListChangedEventArgs e) { if (e.hraOperand != null && selectedRelative != null) { ClincalObservation co = (ClincalObservation)e.hraOperand; switch (e.hraListChangeType) { case HraListChangedEventArgs.HraListChangeType.ADD: PMHRow pmhRow = new PMHRow(co, this); pmhRow.disease.Text = co.disease; flowLayoutPanel1.Controls.Add(pmhRow); pmhRow.disease.Focus(); // drive focus to the first input control jdg 11/16/12 //setup grouping int selectedGroupID = 1; String groupName = diseaseGroupComboBox.Text; if (!String.IsNullOrEmpty(groupName)) { selectedGroupID = this.diseases .Where(t => ((DiseaseObject)t).groupingName.Equals(groupName)) .Select(t => ((DiseaseObject)t).groupingID) .Distinct() .SingleOrDefault(); } pmhRow.setGroupID(selectedGroupID); break; case HraListChangedEventArgs.HraListChangeType.DELETE: Control doomed = null; foreach (Control c in flowLayoutPanel1.Controls.OfType <PMHRow>()) { PMHRow targetRow = (PMHRow)c; if (targetRow.GetCO() == co) { doomed = c; } } if (doomed != null) { flowLayoutPanel1.Controls.Remove(doomed); } if (pmh.Observations.Count == 0) { noLabel.Visible = true; } break; } } }
/**************************************************************************************************/ private void AddDiseaseButton_Click(object sender, EventArgs e) { ClincalObservation co = new ClincalObservation(pmh); //SessionManager.Instance.MetaData.Diseases.SetDataFromDiseaseName(ref co); HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); args.Persist = false; pmh.Observations.AddToList(co, args); noLabel.Visible = false; }
private void AddClinicalObservation(ClincalObservation co) { var add = ClinicalObservationDoesNotExist(co); if (add) { if (string.IsNullOrEmpty(co.disease) == false) { PedigreeLegendRow plr = new PedigreeLegendRow(); plr.SetObservation(co); flowLayoutPanel.Controls.Add(plr); this.Visible = true; } } }
private void OpenDiseaseDetails(ClincalObservation co) { if (co != null && co.Details != null) { if (co.Details.GetType().ToString() == "RiskApps3.Model.PatientRecord.PMH.BreastCancerDetails") { RiskApps3.View.PatientRecord.PMH.BreastCancerDetailsView bcdv = new RiskApps3.View.PatientRecord.PMH.BreastCancerDetailsView((RiskApps3.Model.PatientRecord.PMH.BreastCancerDetails)(co.Details)); bcdv.ShowDialog(); } if (co.Details.GetType().ToString() == "RiskApps3.Model.PatientRecord.PMH.ColonCancerDetails") { RiskApps3.View.PatientRecord.PMH.ColonCancerDetailsView bcdv = new RiskApps3.View.PatientRecord.PMH.ColonCancerDetailsView((RiskApps3.Model.PatientRecord.PMH.ColonCancerDetails)(co.Details)); bcdv.ShowDialog(); } } }
public void AddSingleObservation(ClincalObservation dx, bool isNew) { if (flowLayoutPanel.InvokeRequired) { AddSingleObservationCallback aoc = AddSingleObservation; object[] args = new object[1]; args[0] = dx; args[1] = isNew; this.Invoke(aoc, args); } else { AddClinicalObservation(dx); CalculateOptimalDimensions(); CheckForEmpty(); } }
private bool ClinicalObservationDoesNotExist(ClincalObservation co) { bool add = true; foreach (Control c in flowLayoutPanel.Controls) { PedigreeLegendRow plr = (PedigreeLegendRow)c; string plrDisplayName = plr.GetObservationisplayName(); string plrShortName = plr.GetObservationisplayShortName(); if (ClinicalObservationIsMatch(co, plrDisplayName, plrShortName)) { add = false; break; } } return(add); }
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(); } }
public void SetObservation(ClincalObservation newCo) { disease = (newCo.ClinicalObservation_diseaseShortName + " - " + newCo.ClinicalObservation_diseaseDisplayName).Trim(new char[] { ' ', '-' }); diseaseDisplayName = newCo.ClinicalObservation_diseaseDisplayName; diseaseIconArea = newCo.ClinicalObservation_diseaseIconArea; diseaseIconColor = newCo.ClinicalObservation_diseaseIconColor; diseaseIconType = newCo.ClinicalObservation_diseaseIconType; diseaseShortName = newCo.ClinicalObservation_diseaseShortName; if (string.IsNullOrEmpty(diseaseIconColor) == false) //(b != null) { b = new SolidBrush(Color.FromName(diseaseIconColor)); } SetRadiusAndTextOrigin(); MeasureText(); }
private void FillControls() { if (Thread.CurrentThread.Name != "MainGUI") { FillControlsCallback rmc = new FillControlsCallback(FillControls); this.Invoke(rmc, null); } else { for (int i = 0; i < pmh.Observations.Count; i++) { ClincalObservation co = (ClincalObservation)pmh.Observations[i]; switch (i) { case 0: comboBox2.Tag = co; comboBox2.Text = co.disease; textBox2.Text = co.ageDiagnosis; break; case 1: comboBox6.Tag = co; comboBox6.Text = co.disease; textBox3.Text = co.ageDiagnosis; break; case 2: comboBox8.Tag = co; comboBox8.Text = co.disease; textBox4.Text = co.ageDiagnosis; break; default: break; } } } }
public void AddSingleObservation(ClincalObservation dx, bool isNew) { if (flowLayoutPanel.InvokeRequired) { AddSingleObservationCallback aoc = new AddSingleObservationCallback(AddSingleObservation); object[] args = new object[1]; args[0] = dx; args[1] = isNew; this.Invoke(aoc, args); } else { bool add = true; foreach (Control c in flowLayoutPanel.Controls) { PedigreeLegendRow plr = (PedigreeLegendRow)c; string plrDisplayName = plr.GetObservationisplayName(); string plrShortName = plr.GetObservationisplayShortName(); if (string.Compare(dx.ClinicalObservation_diseaseDisplayName, plrDisplayName, true) == 0 && string.Compare(dx.ClinicalObservation_diseaseShortName, plrShortName) == 0) { add = false; } } if (add) { if (string.IsNullOrEmpty(dx.disease) == false) { PedigreeLegendRow plr = new PedigreeLegendRow(); plr.SetObservation(dx); flowLayoutPanel.Controls.Add(plr); this.Height = flowLayoutPanel.Location.Y + plr.Location.Y + plr.Height + legendPadding; if (isNew) { if (flowLayoutPanel.Controls.Count == 1) { this.Location = new Point(SessionManager.Instance.MetaData.CurrentUserDefaultPedigreePrefs.GUIPreference_LegendX, SessionManager.Instance.MetaData.CurrentUserDefaultPedigreePrefs.GUIPreference_LegendY); } int maxWidth = 0; foreach (Control c in flowLayoutPanel.Controls) { PedigreeLegendRow row = (PedigreeLegendRow)c; if (row.Width > maxWidth) { maxWidth = row.Width; } } if (maxWidth + legendPadding > this.Width) { this.Width = maxWidth + legendPadding; } } this.Refresh(); } } CheckForEmpty(); } }
public void FillStatusControls() { if (loadingCircle1.InvokeRequired) { FillStatusControlsCallback aoc = new FillStatusControlsCallback(FillStatusControls); this.Invoke(aoc); } else { Font f = new Font("Tahoma", 8.0f, FontStyle.Bold); objectListView1.ColumnsInDisplayOrder[1].Renderer = null; //TODO how to modify column style??? List <PatientStatusRow> listPSR = new List <PatientStatusRow>(); listPSR.Add(new PatientStatusRow("Hx:", String.IsNullOrEmpty(proband.follupSatus.Diseases) ? "No Known Diseases" : proband.follupSatus.Diseases)); listPSR.Add(new PatientStatusRow("Risk of Mutation:", (proband.follupSatus.MaxBRCAProMyriadScore != null) ? ((double)proband.follupSatus.MaxBRCAProMyriadScore).ToString("##.#") + "%" : "N/A")); listPSR.Add(new PatientStatusRow("Lifetime Risk Breast Cancer:", (proband.follupSatus.MaxLifetimeScore != null) ? ((double)proband.follupSatus.MaxLifetimeScore).ToString("##.#") + "%" : "N/A")); string brcaTestFamily = ""; if (String.IsNullOrEmpty(proband.follupSatus.BreastFamilyGene)) { brcaTestFamily = "No Testing In Family"; } else if (proband.follupSatus.BreastFamilyGene.Contains(",")) { brcaTestFamily = proband.follupSatus.BreastFamilyMutationSignificance.Replace("BRCA1: Negative, BRCA2: Negative", "Negative"); } else { brcaTestFamily = proband.follupSatus.BreastFamilyGene + ": " + proband.follupSatus.BreastFamilyMutationSignificance; } listPSR.Add(new PatientStatusRow("BRCA Test, Family:", brcaTestFamily)); listPSR.Add(new PatientStatusRow("BRCA Test, Patient:", String.IsNullOrEmpty(proband.follupSatus.BreastProbandResult) ? "No Testing In Family" : proband.follupSatus.BreastProbandResult)); listPSR.Add(new PatientStatusRow("Atypia/LCIS:", proband.follupSatus.AtypiaLCIS)); objectListView1.SetObjects(listPSR); //Get relevant surgeries from disease history observations = proband.PMH.Observations; lock (observations) { String breastSurgeryStatusStr = "Breasts Intact"; ClincalObservation co = (ClincalObservation)(observations.SingleOrDefault(v => ((ClincalObservation)v).disease == "Bilateral Mastectomy")); if (co != null) { breastSurgeryStatusStr = "Bilateral Mastectomy"; } else { co = (ClincalObservation)(observations.SingleOrDefault(v => ((ClincalObservation)v).disease == "Unilateral Mastectomy")); if (co != null) { breastSurgeryStatusStr = "Unilateral Mastectomy"; } } if (breastSurgeryStatusStr == "Breasts Intact") { co = (ClincalObservation)(observations.SingleOrDefault(v => ((ClincalObservation)v).disease == "Mastectomy")); if (co != null) { breastSurgeryStatusStr = "Mastectomy"; } } breastSurgeryStatus.Text = breastSurgeryStatusStr; String ovarySurgeryStatusStr = "Ovaries Intact"; co = (ClincalObservation)(observations.SingleOrDefault(v => ((ClincalObservation)v).disease == "Bilateral Oophorectomy")); if (co != null) { ovarySurgeryStatusStr = "Bilateral Oophorectomy"; } ovarySurgeryStatus.Text = ovarySurgeryStatusStr; } ////////////////////// breastSurgeryRec.Text = SessionManager.Instance.MetaData.BrOvCdsRecs.GetRecTextFromID(proband.cdsBreastOvary.ProphMastRec); breastChemoRec.Text = SessionManager.Instance.MetaData.BrOvCdsRecs.GetRecTextFromID(proband.cdsBreastOvary.ChemoRec); ovarySurgeryRec.Text = SessionManager.Instance.MetaData.BrOvCdsRecs.GetRecTextFromID(proband.cdsBreastOvary.ProphOophRec); ovaryChemoRec.Text = SessionManager.Instance.MetaData.BrOvCdsRecs.GetRecTextFromID(proband.cdsBreastOvary.OCRec); //set long lasting tooltips Breast ttBreastSurgeryValue.SetToolTip(breastSurgeryRec, breastSurgeryRec.Text); setToolTip30SecDelay(ttBreastSurgeryValue); ttBreastChemoValue.SetToolTip(breastChemoRec, breastChemoRec.Text); setToolTip30SecDelay(ttBreastChemoValue); //set long lasting tooltips Ovary ttOvarySurgeryValue.SetToolTip(ovarySurgeryRec, ovarySurgeryRec.Text); setToolTip30SecDelay(ttOvarySurgeryValue); ttOvaryChemoValue.SetToolTip(ovaryChemoRec, ovaryChemoRec.Text); setToolTip30SecDelay(ttOvaryChemoValue); if (proband.transvaginalImagingHx.IsLoaded && proband.follupSatus.HraState == HraObject.States.Ready && proband.labsHx.IsLoaded && proband.breastImagingHx.IsLoaded) { loadingCircle1.Active = false; loadingCircle1.Visible = false; } } }
private static bool ClinicalObservationIsMatch(ClincalObservation co, string plrDisplayName, string plrShortName) { //TODO consider adding to ClinicalObservation.Equals return(string.Compare(co.ClinicalObservation_diseaseDisplayName, plrDisplayName, true) == 0 && string.Compare(co.ClinicalObservation_diseaseShortName, plrShortName) == 0); }