Esempio n. 1
0
 private void FormRxEdit_Load(object sender, System.EventArgs e)
 {
     butSend.Visible = false;          //this is here temporarily until we actually have Rx send capability.
     if (HideSendBut)
     {
         butSend.Visible = false;
     }
     if (IsNew)
     {
         butView.Visible   = false;
         labelView.Visible = false;
         sheet             = null;
     }
     else
     {
         sheet = Sheets.GetRx(RxPatCur.PatNum, RxPatCur.RxNum);
         if (sheet == null)
         {
             butView.Visible   = false;
             labelView.Visible = false;
         }
         else
         {
             butPrint.Visible = false;
         }
     }
     //security is handled on the Rx button click in the Chart module
     for (int i = 0; i < ProviderC.ListShort.Count; i++)
     {
         this.listProv.Items.Add(ProviderC.ListShort[i].GetLongDesc());
         if (ProviderC.ListShort[i].ProvNum == RxPatCur.ProvNum)
         {
             listProv.SelectedIndex = i;
         }
     }
     if (listProv.SelectedIndex == -1)
     {
         listProv.SelectedIndex = 0;
     }
     textDate.Text           = RxPatCur.RxDate.ToString("d");
     checkControlled.Checked = RxPatCur.IsControlled;
     for (int i = 0; i < Enum.GetNames(typeof(RxSendStatus)).Length; i++)
     {
         comboSendStatus.Items.Add(Enum.GetNames(typeof(RxSendStatus))[i]);
     }
     comboSendStatus.SelectedIndex = (int)RxPatCur.SendStatus;
     textDrug.Text    = RxPatCur.Drug;
     textSig.Text     = RxPatCur.Sig;
     textDisp.Text    = RxPatCur.Disp;
     textRefills.Text = RxPatCur.Refills;
     textRxNorm.Text  = RxPatCur.RxCui.ToString();
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         textDosageCode.Text = RxPatCur.DosageCode;
     }
     else
     {
         labelDosageCode.Visible = false;
         textDosageCode.Visible  = false;
     }
     textNotes.Text    = RxPatCur.Notes;
     textPharmacy.Text = Pharmacies.GetDescription(RxPatCur.PharmacyNum);
 }
Esempio n. 2
0
 private void FormRxEdit_Load(object sender, System.EventArgs e)
 {
     _rxPatOld = RxPatCur.Copy();
     if (IsNew)
     {
         butAudit.Visible  = false;
         butView.Visible   = false;
         labelView.Visible = false;
         sheet             = null;
         if (PrefC.GetBool(PrefName.ShowFeatureEhr) && Security.CurUser.ProvNum != 0)               //Is CPOE
         {
             labelCPOE.Visible    = true;
             comboProvNum.Enabled = false;
             butPickProv.Enabled  = false;
             RxPatCur.ProvNum     = Security.CurUser.ProvNum;
         }
     }
     else
     {
         sheet = Sheets.GetRx(RxPatCur.PatNum, RxPatCur.RxNum);
         if (sheet == null)
         {
             butView.Visible   = false;
             labelView.Visible = false;
         }
         else
         {
             butPrint.Visible = false;
         }
         if (!Security.IsAuthorized(Permissions.RxEdit))
         {
             textDate.Enabled          = false;
             checkControlled.Enabled   = false;
             checkProcRequired.Enabled = false;
             comboProcCode.Enabled     = false;
             textDaysOfSupply.Enabled  = false;
             textDrug.Enabled          = false;
             textSig.Enabled           = false;
             textDisp.Enabled          = false;
             textRefills.Enabled       = false;
             comboProvNum.Enabled      = false;
             butPickProv.Enabled       = false;
             textDosageCode.Enabled    = false;
             textNotes.Enabled         = false;
             butPick.Enabled           = false;
             comboSendStatus.Enabled   = false;
             butDelete.Enabled         = false;
         }
     }
     //security is handled on the Rx button click in the Chart module
     _provNumSelected = RxPatCur.ProvNum;
     comboProvNum.Items.Clear();
     _listProviders = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboProvNum.Items.Add(_listProviders[i].GetLongDesc());                //Only visible provs added to combobox.
         if (_listProviders[i].ProvNum == RxPatCur.ProvNum)
         {
             comboProvNum.SelectedIndex = i;                  //Sets combo text too.
         }
     }
     if (_provNumSelected == 0)           //Is new
     {
         comboProvNum.SelectedIndex = 0;
         _provNumSelected           = _listProviders[0].ProvNum;
     }
     if (comboProvNum.SelectedIndex == -1)                            //The provider exists but is hidden
     {
         comboProvNum.Text = Providers.GetLongDesc(_provNumSelected); //Appends "(hidden)" to the end of the long description.
     }
     textDate.Text           = RxPatCur.RxDate.ToString("d");
     checkControlled.Checked = RxPatCur.IsControlled;
     comboProcCode.Items.Clear();
     if (PrefC.GetBool(PrefName.RxHasProc))
     {
         checkProcRequired.Checked = RxPatCur.IsProcRequired;
         comboProcCode.Items.Add(Lan.g(this, "none"));
         comboProcCode.SelectedIndex = 0;
         List <ProcedureCode> listProcCodes = ProcedureCodes.GetListDeep();
         DateTime             rxDate        = PIn.Date(textDate.Text);
         if (rxDate.Year < 1880)
         {
             rxDate = DateTime.Today;
         }
         _listInUseProcs = Procedures.Refresh(RxPatCur.PatNum)
                           .FindAll(x => x.ProcNum == RxPatCur.ProcNum ||
                                    (x.ProcStatus == ProcStat.C && x.DateComplete <= rxDate && x.DateComplete >= rxDate.AddYears(-1)) ||
                                    x.ProcStatus == ProcStat.TP)
                           .OrderBy(x => x.ProcStatus.ToString())
                           .ThenBy(x => (x.ProcStatus == ProcStat.C)?x.DateComplete:x.DateTP)
                           .ToList();
         foreach (Procedure proc in _listInUseProcs)
         {
             ProcedureCode procCode = ProcedureCodes.GetProcCode(proc.CodeNum, listProcCodes);
             string        itemText = proc.ProcStatus.ToString().PadLeft(2, ' ');
             if (proc.ProcStatus == ProcStat.C)
             {
                 itemText += " " + proc.DateComplete.ToShortDateString();
             }
             else
             {
                 itemText += " " + proc.DateTP.ToShortDateString();
             }
             itemText += " " + Procedures.GetDescription(proc);
             comboProcCode.Items.Add(itemText);
             if (proc.ProcNum == RxPatCur.ProcNum)
             {
                 comboProcCode.SelectedIndex = comboProcCode.Items.Count - 1;
             }
         }
         if (RxPatCur.DaysOfSupply != 0)
         {
             textDaysOfSupply.Text = RxPatCur.DaysOfSupply.ToString();
         }
     }
     else
     {
         checkProcRequired.Enabled = false;
         labelProcedure.Enabled    = false;
         comboProcCode.Enabled     = false;
         labelDaysOfSupply.Enabled = false;
         textDaysOfSupply.Enabled  = false;
     }
     for (int i = 0; i < Enum.GetNames(typeof(RxSendStatus)).Length; i++)
     {
         comboSendStatus.Items.Add(Enum.GetNames(typeof(RxSendStatus))[i]);
     }
     comboSendStatus.SelectedIndex = (int)RxPatCur.SendStatus;
     textDrug.Text    = RxPatCur.Drug;
     textSig.Text     = RxPatCur.Sig;
     textDisp.Text    = RxPatCur.Disp;
     textRefills.Text = RxPatCur.Refills;
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         textDosageCode.Text = RxPatCur.DosageCode;
     }
     else
     {
         labelDosageCode.Visible = false;
         textDosageCode.Visible  = false;
     }
     textNotes.Text     = RxPatCur.Notes;
     textPharmInfo.Text = RxPatCur.ErxPharmacyInfo;
     textPharmacy.Text  = Pharmacies.GetDescription(RxPatCur.PharmacyNum);
 }