Esempio n. 1
0
 private void FillForm()
 {
     textMedName.Text     = Medications.GetMedication(MedicationPatCur.MedicationNum).MedName;
     textGenericName.Text = Medications.GetGeneric(MedicationPatCur.MedicationNum).MedName;
     textMedNote.Text     = Medications.GetGeneric(MedicationPatCur.MedicationNum).Notes;
     textPatNote.Text     = MedicationPatCur.PatNote;
 }
Esempio n. 2
0
        private void FillMeds()
        {
            Medications.Refresh();
            MedicationPats.Refresh(PatCur.PatNum);
            gridMeds.BeginUpdate();
            gridMeds.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableMedications", "Drug Name"), 100);

            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Generic Name"), 100);
            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Notes"), 370);
            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Notes for Patient"), 370);
            gridMeds.Columns.Add(col);
            gridMeds.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < MedicationPats.List.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(Medications.GetMedication(MedicationPats.List[i].MedicationNum).MedName);
                row.Cells.Add(Medications.GetGeneric(MedicationPats.List[i].MedicationNum).MedName);
                row.Cells.Add(Medications.GetGeneric(MedicationPats.List[i].MedicationNum).Notes);
                row.Cells.Add(MedicationPats.List[i].PatNote);
                gridMeds.Rows.Add(row);
            }
            gridMeds.EndUpdate();
        }
Esempio n. 3
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            Medications.Refresh();
            FormMedicationEdit FormME = new FormMedicationEdit();

            FormME.MedicationCur = Medications.GetMedication(MedicationPatCur.MedicationNum);
            FormME.ShowDialog();
            if (FormME.DialogResult != DialogResult.OK)
            {
                return;
            }
            textMedName.Text     = Medications.GetMedication(MedicationPatCur.MedicationNum).MedName;
            textGenericName.Text = Medications.GetGeneric(MedicationPatCur.MedicationNum).MedName;
            textMedNote.Text     = Medications.GetGeneric(MedicationPatCur.MedicationNum).Notes;
        }
Esempio n. 4
0
        private void FillMeds()
        {
            Medications.Refresh();
            medList = MedicationPats.Refresh(PatCur.PatNum, checkDiscontinued.Checked);
            gridMeds.BeginUpdate();
            gridMeds.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableMedications", "Medication"), 140);

            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Notes for Patient"), 225);
            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Disc"), 10, HorizontalAlignment.Center);       //discontinued
            gridMeds.Columns.Add(col);
            gridMeds.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < medList.Count; i++)
            {
                row = new ODGridRow();
                if (medList[i].MedicationNum == 0)
                {
                    row.Cells.Add(medList[i].MedDescript);
                }
                else
                {
                    Medication generic = Medications.GetGeneric(medList[i].MedicationNum);
                    string     medName = Medications.GetMedication(medList[i].MedicationNum).MedName;
                    if (generic.MedicationNum != medList[i].MedicationNum)                   //not generic
                    {
                        medName += " (" + generic.MedName + ")";
                    }
                    row.Cells.Add(medName);
                }
                row.Cells.Add(medList[i].PatNote);
                if (MedicationPats.IsMedActive(medList[i]))
                {
                    row.Cells.Add("");
                }
                else                  //discontinued
                {
                    row.Cells.Add("X");
                }
                gridMeds.Rows.Add(row);
            }
            gridMeds.EndUpdate();
        }
Esempio n. 5
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            Medications.Refresh();
            FormMedicationEdit FormME = new FormMedicationEdit();

            FormME.MedicationCur = Medications.GetMedication(MedicationPatCur.MedicationNum);          //The edit button is not visible if MedicationNum=0.
            FormME.ShowDialog();
            if (FormME.DialogResult != DialogResult.OK)
            {
                return;
            }
            MedicationPatCur.RxCui = FormME.MedicationCur.RxCui;
            textMedName.Text       = Medications.GetMedication(MedicationPatCur.MedicationNum).MedName; //The edit button is not visible if MedicationNum=0.
            textGenericName.Text   = Medications.GetGeneric(MedicationPatCur.MedicationNum).MedName;    //The edit button is not visible if MedicationNum=0.
            textMedNote.Text       = Medications.GetGeneric(MedicationPatCur.MedicationNum).Notes;      //The edit button is not visible if MedicationNum=0.
            textRxNormDesc.Text    = RxNorms.GetDescByRxCui(MedicationPatCur.RxCui.ToString());
        }
Esempio n. 6
0
 private void FormMedPat_Load(object sender, System.EventArgs e)
 {
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         labelPatNote.Text = "Count, Instructions, and Refills";
         groupOrder.Text   = "Medication Order";
     }
     else
     {
         butFormulary.Visible = false;
     }
     textMedName.Text     = Medications.GetMedication(MedicationPatCur.MedicationNum).MedName;
     textGenericName.Text = Medications.GetGeneric(MedicationPatCur.MedicationNum).MedName;
     textMedNote.Text     = Medications.GetGeneric(MedicationPatCur.MedicationNum).Notes;
     comboProv.Items.Add(Lan.g(this, "none"));
     for (int i = 0; i < ProviderC.ListShort.Count; i++)
     {
         comboProv.Items.Add(ProviderC.ListShort[i].GetLongDesc());
     }
     if (MedicationPatCur.ProvNum == 0)
     {
         comboProv.SelectedIndex = 0;
     }
     else
     {
         for (int i = 0; i < ProviderC.ListShort.Count; i++)
         {
             if (MedicationPatCur.ProvNum == ProviderC.ListShort[i].ProvNum)
             {
                 comboProv.SelectedIndex = i + 1;
             }
         }
         //if a provider was subsequently hidden, then the combobox may now be -1.
     }
     textPatNote.Text = MedicationPatCur.PatNote;
     if (MedicationPatCur.DateStart.Year > 1880)
     {
         textDateStart.Text = MedicationPatCur.DateStart.ToShortDateString();
     }
     if (MedicationPatCur.DateStop.Year > 1880)
     {
         textDateStop.Text = MedicationPatCur.DateStop.ToShortDateString();
     }
 }
Esempio n. 7
0
        private void FillMeds()
        {
            Medications.Refresh();
            medList = MedicationPats.Refresh(PatCur.PatNum, checkDiscontinued.Checked);
            gridMeds.BeginUpdate();
            gridMeds.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableMedications", "Medication"), 120);

            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Notes"), 200);
            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Notes for Patient"), 200);
            gridMeds.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableMedications", "Status"), 60, HorizontalAlignment.Center);
            gridMeds.Columns.Add(col);
            gridMeds.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < medList.Count; i++)
            {
                row = new ODGridRow();
                Medication generic = Medications.GetGeneric(medList[i].MedicationNum);
                string     medName = Medications.GetMedication(medList[i].MedicationNum).MedName;
                if (generic.MedicationNum != medList[i].MedicationNum)               //not generic
                {
                    medName += " (" + generic.MedName + ")";
                }
                row.Cells.Add(medName);
                row.Cells.Add(Medications.GetGeneric(medList[i].MedicationNum).Notes);
                row.Cells.Add(medList[i].PatNote);
                if (medList[i].DateStop.Year > 1880)
                {
                    row.Cells.Add("Inactive");
                }
                else
                {
                    row.Cells.Add("Active");
                }
                gridMeds.Rows.Add(row);
            }
            gridMeds.EndUpdate();
        }
Esempio n. 8
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            Medications.RefreshCache();
            FormMedicationEdit FormME = new FormMedicationEdit();
            Medication         med    = Medications.GetMedication(MedicationPatCur.MedicationNum); //The edit button is not visible if MedicationNum=0.

            if (med == null)                                                                       //Possible to delete the medication from a separate WS while medication loaded in memory.
            {
                MsgBox.Show(this, "An error occurred loading medication.");
                return;
            }
            FormME.ShowDialog();
            if (FormME.DialogResult != DialogResult.OK)
            {
                return;
            }
            MedicationPatCur.RxCui = FormME.MedicationCur.RxCui;
            textMedName.Text       = Medications.GetMedication(MedicationPatCur.MedicationNum).MedName; //The edit button is not visible if MedicationNum=0.
            textGenericName.Text   = Medications.GetGeneric(MedicationPatCur.MedicationNum).MedName;    //The edit button is not visible if MedicationNum=0.
            textMedNote.Text       = Medications.GetGeneric(MedicationPatCur.MedicationNum).Notes;      //The edit button is not visible if MedicationNum=0.
            textRxNormDesc.Text    = RxNorms.GetDescByRxCui(MedicationPatCur.RxCui.ToString());
        }
Esempio n. 9
0
 private void FormMedPat_Load(object sender, System.EventArgs e)
 {
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         labelPatNote.Text = "Count, Instructions, and Refills";
         groupOrder.Text   = "Medication Order";
     }
     //Formulary checks now handled in NewCrop
     //else {
     //	butFormulary.Visible=false;
     //}
     if (CultureInfo.CurrentCulture.Name.EndsWith("US"))             //United States
     {
         textRxNormDesc.Text = RxNorms.GetDescByRxCui(MedicationPatCur.RxCui.ToString());
         if (Erx.IsFromErx(MedicationPatCur.ErxGuid))                 //This is a medical order that was automatically created when fetching prescriptions from eRx.
         //We allow the user to change the RxCui on the medical order, because eRx does not always supply an RxCui.
         //Also the MedicaitonNum on the order will always be 0, so there is no link between the order and the medication table.
         //If MedicationOrder was non-zero and we changed the RxCui on the order, then the automatic sync between medicationpat.RxCui and medication.RxCui would be tainted.
         {
             butRxNormSelect.Visible = true;
         }
     }
     else
     {
         labelRxNorm.Visible    = false;
         textRxNormDesc.Visible = false;
     }
     if (MedicationPatCur.MedicationNum == 0)           //Probably a medical order created during eRx prescription fetching, but not necessarily.
     {
         textMedName.Text          = MedicationPatCur.MedDescript;
         labelGenericNotes.Visible = false;
         labelGenericName.Visible  = false;
         textGenericName.Visible   = false;
         textMedNote.Visible       = false;
         butEdit.Visible           = false;
         labelEdit.Visible         = false;
     }
     else
     {
         textMedName.Text     = Medications.GetMedication(MedicationPatCur.MedicationNum).MedName;
         textGenericName.Text = Medications.GetGeneric(MedicationPatCur.MedicationNum).MedName;
         textMedNote.Text     = Medications.GetGeneric(MedicationPatCur.MedicationNum).Notes;
     }
     comboProv.Items.Add(Lan.g(this, "none"));
     _listProviders = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboProv.Items.Add(_listProviders[i].GetLongDesc());
     }
     if (MedicationPatCur.ProvNum == 0)
     {
         comboProv.SelectedIndex = 0;
     }
     else
     {
         for (int i = 0; i < _listProviders.Count; i++)
         {
             if (MedicationPatCur.ProvNum == _listProviders[i].ProvNum)
             {
                 comboProv.SelectedIndex = i + 1;
             }
         }
         //if a provider was subsequently hidden, then the combobox may now be -1.
     }
     if (MedicationPatCur.IsCpoe)
     {
         //We cannot allow the user to change the provider, because our EHR reports use the provider in combination with the IsCpoe flag to report CPOE.
         comboProv.Enabled = false;
     }
     textPatNote.Text = MedicationPatCur.PatNote;
     if (MedicationPatCur.DateStart.Year > 1880)
     {
         textDateStart.Text = MedicationPatCur.DateStart.ToShortDateString();
     }
     if (MedicationPatCur.DateStop.Year > 1880)
     {
         textDateStop.Text = MedicationPatCur.DateStop.ToShortDateString();
     }
     if (IsNew)
     {
         butEdit.Visible   = false;
         labelEdit.Visible = false;
     }
 }