Esempio n. 1
0
        private void FillGrid()
        {
            RxDefList = RxDefs.Refresh();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableRxSetup", "Drug"), 140);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Sig"), 320);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Disp"), 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Refills"), 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Notes"), 300);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < RxDefList.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(RxDefList[i].Drug);
                row.Cells.Add(RxDefList[i].Sig);
                row.Cells.Add(RxDefList[i].Disp);
                row.Cells.Add(RxDefList[i].Refills);
                row.Cells.Add(RxDefList[i].Notes);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Esempio n. 2
0
 private void FormRxSelect_Load(object sender, System.EventArgs e)
 {
     _arrayRxDefs = RxDefs.Refresh();
     FillGrid();
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         //We cannot allow blank prescription when using EHR, because each prescription created in this window must have an RxCui.
         //If we allowed blank, we would not know where to pull the RxCui from.
         butBlank.Visible       = false;
         labelInstructions.Text = Lan.g(this, "Please select a Prescription from the list.");
     }
 }
Esempio n. 3
0
        private void FillGrid()
        {
            RxDefList = RxDefs.Refresh();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableRxSetup", "Drug"), 140);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Controlled"), 70, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Sig"), 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Disp"), 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Refills"), 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRxSetup", "Notes"), 300);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < RxDefList.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(RxDefList[i].Drug);
                if (RxDefList[i].IsControlled)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(RxDefList[i].Sig);
                row.Cells.Add(RxDefList[i].Disp);
                row.Cells.Add(RxDefList[i].Refills);
                row.Cells.Add(RxDefList[i].Notes);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Esempio n. 4
0
        private void RxSelected()
        {
            if (gridMain.GetSelectedIndex() == -1)
            {
                //this should never happen
                return;
            }
            RxDef RxDefCur = (RxDef)gridMain.ListGridRows[gridMain.GetSelectedIndex()].Tag;

            if (PrefC.GetBool(PrefName.ShowFeatureEhr) && RxDefCur.RxCui == 0)
            {
                string strMsgText = Lan.g(this, "The selected prescription is missing an RxNorm") + ".\r\n"
                                    + Lan.g(this, "Prescriptions without RxNorms cannot be exported in EHR documents") + ".\r\n";
                if (!Security.IsAuthorized(Permissions.RxEdit, true))
                {
                    //Show the message but don't allow to edit. Continue creating rx
                    MessageBox.Show(strMsgText);
                }
                else if (MessageBox.Show(strMsgText + Lan.g(this, "Edit RxNorm in Rx Template?"), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    FormRxDefEdit form = new FormRxDefEdit(RxDefCur);
                    form.ShowDialog();
                    RxDefCur = RxDefs.GetOne(RxDefCur.RxDefNum);                  //FormRxDefEdit does not modify the RxDefCur object, so we must get the updated RxCui from the db.
                }
            }
            if (RxDefCur == null)           //Can occur if the RxDef is deleted. Refresh list and fill grid
            {
                _arrayRxDefs = RxDefs.Refresh();
                FillGrid();
                return;
            }
            //Alert
            if (!RxAlertL.DisplayAlerts(PatCur.PatNum, RxDefCur.RxDefNum))
            {
                return;
            }
            //User OK with alert
            RxPat RxPatCur = new RxPat();

            RxPatCur.RxDate       = DateTime.Today;
            RxPatCur.PatNum       = PatCur.PatNum;
            RxPatCur.ClinicNum    = PatCur.ClinicNum;
            RxPatCur.Drug         = RxDefCur.Drug;
            RxPatCur.IsControlled = RxDefCur.IsControlled;
            if (PrefC.GetBool(PrefName.RxHasProc) && (Clinics.ClinicNum == 0 || Clinics.GetClinic(Clinics.ClinicNum).HasProcOnRx))
            {
                RxPatCur.IsProcRequired = RxDefCur.IsProcRequired;
            }
            RxPatCur.Sig     = RxDefCur.Sig;
            RxPatCur.Disp    = RxDefCur.Disp;
            RxPatCur.Refills = RxDefCur.Refills;
            if (PrefC.GetBool(PrefName.RxSendNewToQueue))
            {
                RxPatCur.SendStatus = RxSendStatus.InElectQueue;
            }
            else
            {
                RxPatCur.SendStatus = RxSendStatus.Unsent;
            }
            RxPatCur.PatientInstruction = RxDefCur.PatientInstruction;
            //Notes not copied: we don't want these kinds of notes cluttering things
            FormRxEdit FormE = new FormRxEdit(PatCur, RxPatCur);

            FormE.IsNew = true;
            FormE.ShowDialog();
            if (FormE.DialogResult != DialogResult.OK)
            {
                return;
            }
            bool isProvOrder = false;

            if (Security.CurUser.ProvNum != 0)           //The user who is currently logged in is a provider.
            {
                isProvOrder = true;
            }
            _medOrderNum = MedicationPats.InsertOrUpdateMedOrderForRx(RxPatCur, RxDefCur.RxCui, isProvOrder);        //RxDefCur.RxCui can be 0.
            EhrMeasureEvent newMeasureEvent = new EhrMeasureEvent();

            newMeasureEvent.DateTEvent = DateTime.Now;
            newMeasureEvent.EventType  = EhrMeasureEventType.CPOE_MedOrdered;
            newMeasureEvent.PatNum     = PatCur.PatNum;
            newMeasureEvent.MoreInfo   = "";
            newMeasureEvent.FKey       = _medOrderNum;
            EhrMeasureEvents.Insert(newMeasureEvent);
            DialogResult = DialogResult.OK;
        }
Esempio n. 5
0
 private void butRefresh_Click(object sender, EventArgs e)
 {
     _arrayRxDefs = RxDefs.Refresh();
     FillGrid();
 }