Esempio n. 1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            FormRxDefEdit FormE = new FormRxDefEdit(RxDefList[e.Row]);

            FormE.ShowDialog();
            FillGrid();
        }
Esempio n. 2
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            RxDef RxDefCur = new RxDef();

            RxDefs.Insert(RxDefCur);            //It gets deleted if user clicks cancel
            FormRxDefEdit FormE = new FormRxDefEdit(RxDefCur);

            FormE.IsNew = true;
            FormE.ShowDialog();
            FillGrid();
        }
Esempio n. 3
0
        private void butAdd2_Click(object sender, System.EventArgs e)
        {
            if (gridMain.GetSelectedIndex() == -1)
            {
                MessageBox.Show(Lan.g(this, "Please select item first"));
                return;
            }
            RxDef RxDefCur = RxDefList[gridMain.GetSelectedIndex()].Copy();

            RxDefs.Insert(RxDefCur);            //Now it has a new id.  It gets deleted if user clicks cancel. Alerts not copied.
            FormRxDefEdit FormE = new FormRxDefEdit(RxDefCur);

            FormE.IsNew = true;
            FormE.ShowDialog();
            FillGrid();
        }
Esempio n. 4
0
		private void RxSelected(){
			if(gridMain.GetSelectedIndex()==-1) {
				//this should never happen
				return;
			}
			RxDef RxDefCur=RxDefList[gridMain.GetSelectedIndex()];
			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"
					+Lan.g(this,"Edit RxNorm in Rx Template?");
				if(MsgBox.Show(this,true,strMsgText)) {
					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.
				}
			}
			//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.Drug=RxDefCur.Drug;
			RxPatCur.IsControlled=RxDefCur.IsControlled;
			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;
			}
			//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 butAdd2_Click(object sender, System.EventArgs e) {
			if(gridMain.GetSelectedIndex()==-1){
				MessageBox.Show(Lan.g(this,"Please select item first"));
				return;
			}
			RxDef RxDefCur=RxDefList[gridMain.GetSelectedIndex()].Copy();
			RxDefs.Insert(RxDefCur);//Now it has a new id.  It gets deleted if user clicks cancel. Alerts not copied.
			FormRxDefEdit FormE=new FormRxDefEdit(RxDefCur);
			FormE.IsNew=true;
			FormE.ShowDialog();
			FillGrid();
		}
Esempio n. 6
0
		private void butAdd_Click(object sender, System.EventArgs e) {
			RxDef RxDefCur=new RxDef();
			RxDefs.Insert(RxDefCur);//It gets deleted if user clicks cancel
			FormRxDefEdit FormE=new FormRxDefEdit(RxDefCur);
			FormE.IsNew=true;
			FormE.ShowDialog();
			FillGrid();
		}
Esempio n. 7
0
		private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			FormRxDefEdit FormE=new FormRxDefEdit(RxDefList[e.Row]);
			FormE.ShowDialog();
			FillGrid();
		}
Esempio n. 8
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. 9
0
        private void RxSelected()
        {
            if (gridMain.GetSelectedIndex() == -1)
            {
                //this should never happen
                return;
            }
            RxDef RxDefCur = RxDefList[gridMain.GetSelectedIndex()];

            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"
                                    + Lan.g(this, "Edit RxNorm in Rx Template?");
                if (MsgBox.Show(this, true, strMsgText))
                {
                    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.
                }
            }
            //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.Drug         = RxDefCur.Drug;
            RxPatCur.IsControlled = RxDefCur.IsControlled;
            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;
            }
            //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;
        }