///<summary>Fills listMedical with the corresponding list type. This saves on load time by only filling necessary lists.</summary> private void FillListMedical(MedicalListType medListType) { switch (medListType) { case MedicalListType.allergy: if (allergyList == null) { allergyList = AllergyDefs.GetAll(false); } listMedical.Items.Clear(); for (int i = 0; i < allergyList.Count; i++) { listMedical.Items.Add(allergyList[i].Description); } break; case MedicalListType.problem: listMedical.Items.Clear(); for (int i = 0; i < _listDiseaseDefs.Count; i++) { listMedical.Items.Add(_listDiseaseDefs[i].DiseaseName); } break; } }
private void FillGrid() { listAllergyDefs = AllergyDefs.GetAll(checkShowHidden.Checked); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("FormAllergySetup", "Desciption"), 160); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("FormAllergySetup", "Hidden"), 60); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < listAllergyDefs.Count; i++) { row = new ODGridRow(); row.Cells.Add(listAllergyDefs[i].Description); if (listAllergyDefs[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FormAllergyEdit_Load(object sender, EventArgs e) { int allergyIndex = 0; allergyDefList = AllergyDefs.GetAll(false); if (allergyDefList.Count < 1) { MsgBox.Show(this, "Need to set up at least one Allergy from EHR setup window."); DialogResult = DialogResult.Cancel; return; } for (int i = 0; i < allergyDefList.Count; i++) { comboAllergies.Items.Add(allergyDefList[i].Description); if (!AllergyCur.IsNew && allergyDefList[i].AllergyDefNum == AllergyCur.AllergyDefNum) { allergyIndex = i; } } snomedReaction = Snomeds.GetByCode(AllergyCur.SnomedReaction); if (snomedReaction != null) { textSnomedReaction.Text = snomedReaction.Description; } if (!AllergyCur.IsNew) { if (AllergyCur.DateAdverseReaction < DateTime.Parse("01-01-1880")) { textDate.Text = ""; } else { textDate.Text = AllergyCur.DateAdverseReaction.ToShortDateString(); } comboAllergies.SelectedIndex = allergyIndex; textReaction.Text = AllergyCur.Reaction; checkActive.Checked = AllergyCur.StatusIsActive; } else { comboAllergies.SelectedIndex = 0; } }
///<summary>Fills listMedical with the corresponding list type. This saves on load time by only filling necessary lists. ///Attempts to seelct the cooresponding allergy/problem. Will select nothing if it does not exist. </summary> private void FillListMedical(MedicalListType medListType) { string medSelection = SheetFieldDefCur.FieldName.Remove(0, Math.Min(SheetFieldDefCur.FieldName.Length, 8)); switch (medListType) { case MedicalListType.allergy: if (_listAllergies == null) { _listAllergies = AllergyDefs.GetAll(false); } listMedical.SetItems(_listAllergies, (item) => item.Description, (item) => item.Description == medSelection); break; case MedicalListType.problem: listMedical.SetItems(_listDiseaseDefs, (item) => item.DiseaseName, (item) => item.DiseaseName == medSelection); break; } }