Ejemplo n.º 1
0
        private void FillForm()
        {
            textMedName.Text = MedicationCur.MedName;
            if (!IsNew)
            {
                textMedName.ReadOnly = true;
            }
            if (MedicationCur.MedicationNum == MedicationCur.GenericNum)
            {
                textGenericName.Text = MedicationCur.MedName;
                textNotes.Text       = MedicationCur.Notes;
                textNotes.ReadOnly   = false;
                Brands = Medications.GetBrands(MedicationCur.MedicationNum);
                comboBrands.Items.Clear();
                comboBrands.Items.AddRange(Brands);
                if (Brands.Length > 0)
                {
                    comboBrands.SelectedIndex = 0;
                }
            }
            else
            {
                textGenericName.Text = Medications.GetMedication(MedicationCur.GenericNum).MedName;
                textNotes.Text       = Medications.GetMedication(MedicationCur.GenericNum).Notes;
                textNotes.ReadOnly   = true;
                Brands = new string[0];
                comboBrands.Visible = false;
                labelBrands.Visible = false;
            }
            _patNameMeds = Medications.GetPatNamesForMed(MedicationCur.MedicationNum);
            comboPatients.Items.Clear();
            comboPatients.Items.AddRange(_patNameMeds);
            if (_patNameMeds.Length > 0)
            {
                comboPatients.SelectedIndex = 0;
            }
            AllergyDef alD = AllergyDefs.GetAllergyDefFromMedication(MedicationCur.MedicationNum);

            if (alD != null)
            {
                _patNameAllergies = Allergies.GetPatNamesForAllergy(alD.AllergyDefNum);
                comboPatientAllergy.Items.Clear();
                comboPatientAllergy.Items.AddRange(_patNameAllergies);
                if (_patNameAllergies.Length > 0)
                {
                    comboPatientAllergy.SelectedIndex = 0;
                }
            }
            if (CultureInfo.CurrentCulture.Name.EndsWith("US"))             //United States
            {
                textRxNormDesc.Text = RxNorms.GetDescByRxCui(MedicationCur.RxCui.ToString());
            }
            else
            {
                labelRxNorm.Visible     = false;
                textRxNormDesc.Visible  = false;
                butRxNormSelect.Visible = false;
            }
        }
Ejemplo n.º 2
0
        private void FillForm()
        {
            textMedName.Text = MedicationCur.MedName;
            if (!IsNew)
            {
                textMedName.ReadOnly = true;
            }
            if (MedicationCur.GenericNum == 0)
            {
                //Probably occurred from a previous bug.  This makes sure we have a generic num that is not 0.
                MedicationCur.GenericNum = MedicationCur.MedicationNum;
                MsgBox.Show(this, "This medication had a missing generic name.  The generic name has been set to the medication name.");
            }
            if (MedicationCur.MedicationNum == MedicationCur.GenericNum)
            {
                textGenericName.Text = MedicationCur.MedName;
                textNotes.Text       = MedicationCur.Notes;
                textNotes.ReadOnly   = false;
                Brands = Medications.GetBrands(MedicationCur.MedicationNum);
                comboBrands.Items.Clear();
                comboBrands.Items.AddRange(Brands);
                if (Brands.Length > 0)
                {
                    comboBrands.SelectedIndex = 0;
                }
            }
            else
            {
                textGenericName.Text = Medications.GetMedication(MedicationCur.GenericNum).MedName;
                textNotes.Text       = Medications.GetMedication(MedicationCur.GenericNum).Notes;
                textNotes.ReadOnly   = true;
                Brands = new string[0];
                comboBrands.Visible = false;
                labelBrands.Visible = false;
            }
            _patNameMeds = Medications.GetPatNamesForMed(MedicationCur.MedicationNum);
            comboPatients.Items.Clear();
            comboPatients.Items.AddRange(_patNameMeds);
            if (_patNameMeds.Length > 0)
            {
                comboPatients.SelectedIndex = 0;
            }
            AllergyDef alD = AllergyDefs.GetAllergyDefFromMedication(MedicationCur.MedicationNum);

            if (alD != null)
            {
                _patNameAllergies = Allergies.GetPatNamesForAllergy(alD.AllergyDefNum);
                comboPatientAllergy.Items.Clear();
                comboPatientAllergy.Items.AddRange(_patNameAllergies);
                if (_patNameAllergies.Length > 0)
                {
                    comboPatientAllergy.SelectedIndex = 0;
                }
            }
            if (CultureInfo.CurrentCulture.Name.EndsWith("US"))             //United States
            {
                textRxNormDesc.Text = RxNorms.GetDescByRxCui(MedicationCur.RxCui.ToString());
            }
            else
            {
                labelRxNorm.Visible     = false;
                textRxNormDesc.Visible  = false;
                butRxNormSelect.Visible = false;
            }
        }