private void FormVaccineObsEdit_Load(object sender, EventArgs e) { comboObservationQuestion.Items.Clear(); string[] arrayQuestionNames = Enum.GetNames(typeof(VaccineObsIdentifier)); for (int i = 0; i < arrayQuestionNames.Length; i++) { comboObservationQuestion.Items.Add(arrayQuestionNames[i]); VaccineObsIdentifier vaccineObsIdentifier = (VaccineObsIdentifier)i; if (_vaccineObsCur.IdentifyingCode == vaccineObsIdentifier) { comboObservationQuestion.SelectedIndex = i; } } listValueType.Items.Clear(); string[] arrayValueTypeNames = Enum.GetNames(typeof(VaccineObsType)); for (int i = 0; i < arrayValueTypeNames.Length; i++) { listValueType.Items.Add(arrayValueTypeNames[i]); VaccineObsType vaccineObsType = (VaccineObsType)i; if (_vaccineObsCur.ValType == vaccineObsType) { listValueType.SelectedIndex = i; } } listCodeSystem.Items.Clear(); string[] arrayCodeSystems = Enum.GetNames(typeof(VaccineObsValCodeSystem)); for (int i = 0; i < arrayCodeSystems.Length; i++) { listCodeSystem.Items.Add(arrayCodeSystems[i].ToString()); VaccineObsValCodeSystem valCodeSystem = (VaccineObsValCodeSystem)i; if (_vaccineObsCur.ValCodeSystem == valCodeSystem) { listCodeSystem.SelectedIndex = i; } } textValue.Text = _vaccineObsCur.ValReported; comboUnits.Items.Clear(); comboUnits.Items.Add("none"); comboUnits.SelectedIndex = 0; List <string> listUcumCodes = Ucums.GetAllCodes(); for (int i = 0; i < listUcumCodes.Count; i++) { string ucumCode = listUcumCodes[i]; comboUnits.Items.Add(ucumCode); if (ucumCode == _vaccineObsCur.UcumCode) { comboUnits.SelectedIndex = i + 1; } } if (_vaccineObsCur.DateObs.Year > 1880) { textDateObserved.Text = _vaccineObsCur.DateObs.ToShortDateString(); } textMethodCode.Text = _vaccineObsCur.MethodCode; SetFlags(); }
private void FormEhrAptObsEdit_Load(object sender, EventArgs e) { _appt = Appointments.GetOneApt(_ehrAptObsCur.AptNum); comboObservationQuestion.Items.Clear(); string[] arrayQuestionNames = Enum.GetNames(typeof(EhrAptObsIdentifier)); for (int i = 0; i < arrayQuestionNames.Length; i++) { comboObservationQuestion.Items.Add(arrayQuestionNames[i]); EhrAptObsIdentifier ehrAptObsIdentifier = (EhrAptObsIdentifier)i; if (_ehrAptObsCur.IdentifyingCode == ehrAptObsIdentifier) { comboObservationQuestion.SelectedIndex = i; } } listValueType.Items.Clear(); string[] arrayValueTypeNames = Enum.GetNames(typeof(EhrAptObsType)); for (int i = 0; i < arrayValueTypeNames.Length; i++) { listValueType.Items.Add(arrayValueTypeNames[i]); EhrAptObsType ehrAptObsType = (EhrAptObsType)i; if (_ehrAptObsCur.ValType == ehrAptObsType) { listValueType.SelectedIndex = i; } } if (_ehrAptObsCur.ValType == EhrAptObsType.Coded) { _strValCodeSystem = _ehrAptObsCur.ValCodeSystem; if (_ehrAptObsCur.ValCodeSystem == "LOINC") { _loincValue = Loincs.GetByCode(_ehrAptObsCur.ValReported); textValue.Text = _loincValue.NameShort; } else if (_ehrAptObsCur.ValCodeSystem == "SNOMEDCT") { _snomedValue = Snomeds.GetByCode(_ehrAptObsCur.ValReported); textValue.Text = _snomedValue.Description; } else if (_ehrAptObsCur.ValCodeSystem == "ICD9") { _icd9Value = ICD9s.GetByCode(_ehrAptObsCur.ValReported); textValue.Text = _icd9Value.Description; } else if (_ehrAptObsCur.ValCodeSystem == "ICD10") { _icd10Value = Icd10s.GetByCode(_ehrAptObsCur.ValReported); textValue.Text = _icd10Value.Description; } } else { textValue.Text = _ehrAptObsCur.ValReported; } comboUnits.Items.Clear(); comboUnits.Items.Add("none"); comboUnits.SelectedIndex = 0; List <string> listUcumCodes = Ucums.GetAllCodes(); for (int i = 0; i < listUcumCodes.Count; i++) { string ucumCode = listUcumCodes[i]; comboUnits.Items.Add(ucumCode); if (ucumCode == _ehrAptObsCur.UcumCode) { comboUnits.SelectedIndex = i + 1; } } SetFlags(); }