コード例 #1
0
 private bool SaveRx()
 {
     if (textDate.errorProvider1.GetError(textDate) != ""
         //|| textAmount.errorProvider1.GetError(textAmount)!=""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return(false);
     }
     if (listProv.SelectedIndex != -1)
     {
         RxPatCur.ProvNum = Providers.List[listProv.SelectedIndex].ProvNum;
     }
     RxPatCur.RxDate  = PIn.PDate(textDate.Text);
     RxPatCur.Drug    = textDrug.Text;
     RxPatCur.Sig     = textSig.Text;
     RxPatCur.Disp    = textDisp.Text;
     RxPatCur.Refills = textRefills.Text;
     RxPatCur.Notes   = textNotes.Text;
     if (IsNew)
     {
         RxPats.Insert(RxPatCur);
         //SecurityLogs.MakeLogEntry("Prescription Create",RxPats.cmd.CommandText,user);
     }
     else
     {
         RxPats.Update(RxPatCur);
         //SecurityLogs.MakeLogEntry("Prescription Edit",RxPats.cmd.CommandText,user);
     }
     return(true);
 }
コード例 #2
0
ファイル: FormRxEdit.cs プロジェクト: royedwards/DRDNet
 ///<summary>Attempts to save, returning true if successful.</summary>
 private bool SaveRx()
 {
     if (textDate.errorProvider1.GetError(textDate) != "" ||
         (textDaysOfSupply.Text != "" && textDaysOfSupply.errorProvider1.GetError(textDaysOfSupply) != ""))
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return(false);
     }
     RxPatCur.ProvNum      = _provNumSelected;
     RxPatCur.RxDate       = PIn.Date(textDate.Text);
     RxPatCur.Drug         = textDrug.Text;
     RxPatCur.IsControlled = checkControlled.Checked;
     if (PrefC.GetBool(PrefName.RxHasProc))
     {
         RxPatCur.IsProcRequired = checkProcRequired.Checked;
         if (comboProcCode.SelectedIndex == 0)               //none
         {
             RxPatCur.ProcNum = 0;
         }
         else
         {
             RxPatCur.ProcNum = _listInUseProcs[comboProcCode.SelectedIndex - 1].ProcNum;
         }
         RxPatCur.DaysOfSupply = PIn.Int(textDaysOfSupply.Text);
     }
     RxPatCur.Sig        = textSig.Text;
     RxPatCur.Disp       = textDisp.Text;
     RxPatCur.Refills    = textRefills.Text;
     RxPatCur.DosageCode = textDosageCode.Text;
     RxPatCur.Notes      = textNotes.Text;
     RxPatCur.SendStatus = (RxSendStatus)comboSendStatus.SelectedIndex;
     //pharmacy is set when using pick button.
     if (IsNew)
     {
         RxPatCur.RxNum = RxPats.Insert(RxPatCur);
         SecurityLogs.MakeLogEntry(Permissions.RxCreate, RxPatCur.PatNum, "CREATED(" + RxPatCur.RxDate.ToShortDateString() + "," + RxPatCur.Drug + ","
                                   + RxPatCur.ProvNum + "," + RxPatCur.Disp + "," + RxPatCur.Refills + ")", RxPatCur.RxNum, DateTime.MinValue);//No date previous needed, new Rx Pat
         if (FormProcGroup.IsOpen)
         {
             FormProcGroup.RxNum = RxPatCur.RxNum;
         }
     }
     else
     {
         if (RxPats.Update(RxPatCur, _rxPatOld))
         {
             //The rx has changed, make an edit entry.
             SecurityLogs.MakeLogEntry(Permissions.RxEdit, RxPatCur.PatNum, "FROM(" + _rxPatOld.RxDate.ToShortDateString() + "," + _rxPatOld.Drug + ","
                                       + _rxPatOld.ProvNum + "," + _rxPatOld.Disp + "," + _rxPatOld.Refills + ")" + "\r\nTO(" + RxPatCur.RxDate.ToShortDateString() + "," + RxPatCur.Drug + ","
                                       + RxPatCur.ProvNum + "," + RxPatCur.Disp + "," + RxPatCur.Refills + ")", RxPatCur.RxNum, _rxPatOld.DateTStamp);
         }
     }
     IsNew = false;          //so that we can save it again after printing if needed.
     return(true);
 }
コード例 #3
0
 /// <summary>For testing only</summary>
 private static void CreatePrescriptions(int PrescriptionCount)
 {
     long[] patNumArray = Patients.GetAllPatNums();
     for (int i = 0; i < patNumArray.Length; i++)
     {
         for (int j = 0; j < PrescriptionCount; j++)
         {
             RxPat rxpat = new RxPat();
             rxpat.Drug         = "VicodinA VicodinB VicodinC" + j;
             rxpat.Disp         = "50.50";
             rxpat.IsControlled = true;
             rxpat.PatNum       = patNumArray[i];
             rxpat.RxDate       = new DateTime(2010, 12, 1, 11, 0, 0);
             RxPats.Insert(rxpat);
         }
     }
 }
コード例 #4
0
ファイル: FormRxEdit.cs プロジェクト: nampn/ODental
 ///<summary>Attempts to save, returning true if successful.</summary>
 private bool SaveRx()
 {
     if (textDate.errorProvider1.GetError(textDate) != ""
         //|| textRxNorm.errorProvider1.GetError(textRxNorm)!=""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return(false);
     }
     if (listProv.SelectedIndex != -1)
     {
         RxPatCur.ProvNum = ProviderC.ListShort[listProv.SelectedIndex].ProvNum;
     }
     //RxCui was set when butRxNormSelect was clicked.
     RxPatCur.RxDate       = PIn.Date(textDate.Text);
     RxPatCur.Drug         = textDrug.Text;
     RxPatCur.IsControlled = checkControlled.Checked;
     RxPatCur.Sig          = textSig.Text;
     RxPatCur.Disp         = textDisp.Text;
     RxPatCur.Refills      = textRefills.Text;
     RxPatCur.DosageCode   = textDosageCode.Text;
     RxPatCur.Notes        = textNotes.Text;
     RxPatCur.SendStatus   = (RxSendStatus)comboSendStatus.SelectedIndex;
     //pharmacy is set when using pick button.
     if (IsNew)
     {
         RxPatCur.RxNum = RxPats.Insert(RxPatCur);
         //SecurityLogs.MakeLogEntry("Prescription Create",RxPats.cmd.CommandText,user);
         if (FormProcGroup.IsOpen)
         {
             FormProcGroup.RxNum = RxPatCur.RxNum;
         }
     }
     else
     {
         RxPats.Update(RxPatCur);
         //SecurityLogs.MakeLogEntry("Prescription Edit",RxPats.cmd.CommandText,user);
     }
     IsNew = false;          //so that we can save it again after printing if needed.
     return(true);
 }