private void butBlank_Click(object sender, System.EventArgs e) { RxPat RxPatCur = new RxPat(); RxPatCur.RxDate = DateTime.Today; RxPatCur.PatNum = PatCur.PatNum; RxPatCur.ClinicNum = PatCur.ClinicNum; if (PrefC.GetBool(PrefName.RxSendNewToQueue)) { RxPatCur.SendStatus = RxSendStatus.InElectQueue; } else { RxPatCur.SendStatus = RxSendStatus.Unsent; } FormRxEdit FormE = new FormRxEdit(PatCur, RxPatCur); FormE.IsNew = true; FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } //We do not need to make a medical order here, because butBlank is not visible in EHR mode. DialogResult = DialogResult.OK; }
private void RxSelected() { if (gridMain.GetSelectedIndex() == -1) { //this should never happen return; } RxDef RxDefCur = RxDefList[gridMain.GetSelectedIndex()]; //Alert RxAlert[] alertList = RxAlerts.Refresh(RxDefCur.RxDefNum); Disease[] diseases = Diseases.Refresh(PatCur.PatNum); ArrayList matchAL = new ArrayList(); for (int i = 0; i < alertList.Length; i++) { for (int j = 0; j < diseases.Length; j++) { if (alertList[i].DiseaseDefNum == diseases[j].DiseaseDefNum) { matchAL.Add(DiseaseDefs.GetName(diseases[j].DiseaseDefNum)); } } } if (matchAL.Count > 0) { string alert = Lan.g(this, "This patient has the following medical conditions or allergies:\r\n"); for (int i = 0; i < matchAL.Count; i++) { alert += "\r\n" + matchAL[i]; } alert += "\r\n\r\n" + Lan.g(this, "Continue anyway?"); if (MessageBox.Show(alert, "Alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != DialogResult.OK) { return; } } //User OK with alert RxPat RxPatCur = new RxPat(); RxPatCur.RxDate = DateTime.Today; RxPatCur.PatNum = PatCur.PatNum; RxPatCur.Drug = RxDefCur.Drug; RxPatCur.Sig = RxDefCur.Sig; RxPatCur.Disp = RxDefCur.Disp; RxPatCur.Refills = RxDefCur.Refills; //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; } DialogResult = DialogResult.OK; }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { Patient patCur = Patients.GetLim(listRx[e.Row].PatNum); FormRxEdit FormRE = new FormRxEdit(patCur, listRx[e.Row]); FormRE.HideSendBut = true; FormRE.ShowDialog(); FillGrid(); }
private void butBlank_Click(object sender, System.EventArgs e) { RxPat RxPatCur = new RxPat(); RxPatCur.RxDate = DateTime.Today; RxPatCur.PatNum = PatCur.PatNum; FormRxEdit FormE = new FormRxEdit(PatCur, RxPatCur); FormE.IsNew = true; FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } DialogResult = DialogResult.OK; }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { if (gridMain.GetSelectedIndex() == -1) { //this should never happen return; } RxPat rx = _listRx[gridMain.GetSelectedIndex()]; FormRxEdit FormRxE = new FormRxEdit(_patCur, rx); FormRxE.ShowDialog(); if (FormRxE.DialogResult != DialogResult.OK) { return; } FillGrid(); }
private void RxSelected() { if (gridMain.GetSelectedIndex() == -1) { //this should never happen return; } RxDef RxDefCur = RxDefList[gridMain.GetSelectedIndex()]; //Alert if (!RxAlertL.DisplayAlerts(PatCur.PatNum, 0, 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; } DialogResult = DialogResult.OK; }
private void butBlank_Click(object sender, System.EventArgs e) { RxPat RxPatCur=new RxPat(); RxPatCur.RxDate=DateTime.Today; RxPatCur.PatNum=PatCur.PatNum; if(PrefC.GetBool(PrefName.RxSendNewToQueue)) { RxPatCur.SendStatus=RxSendStatus.InElectQueue; } else { RxPatCur.SendStatus=RxSendStatus.Unsent; } FormRxEdit FormE=new FormRxEdit(PatCur,RxPatCur); FormE.IsNew=true; FormE.ShowDialog(); if(FormE.DialogResult!=DialogResult.OK){ return; } DialogResult=DialogResult.OK; }
private void butBlank_Click(object sender, System.EventArgs e) { RxPat RxPatCur = new RxPat(); RxPatCur.RxDate = DateTime.Today; RxPatCur.PatNum = PatCur.PatNum; if (PrefC.GetBool(PrefName.RxSendNewToQueue)) { RxPatCur.SendStatus = RxSendStatus.InElectQueue; } else { RxPatCur.SendStatus = RxSendStatus.Unsent; } FormRxEdit FormE = new FormRxEdit(PatCur, RxPatCur); FormE.IsNew = true; FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } DialogResult = DialogResult.OK; }
private void RxSelected() { if(gridMain.GetSelectedIndex()==-1) { //this should never happen return; } RxDef RxDefCur=RxDefList[gridMain.GetSelectedIndex()]; //Alert if(!RxAlertL.DisplayAlerts(PatCur.PatNum,0,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; } DialogResult=DialogResult.OK; }
private void butBlank_Click(object sender, System.EventArgs e) { RxPat RxPatCur=new RxPat(); RxPatCur.RxDate=DateTime.Today; RxPatCur.PatNum=PatCur.PatNum; if(PrefC.GetBool(PrefName.RxSendNewToQueue)) { RxPatCur.SendStatus=RxSendStatus.InElectQueue; } else { RxPatCur.SendStatus=RxSendStatus.Unsent; } FormRxEdit FormE=new FormRxEdit(PatCur,RxPatCur); FormE.IsNew=true; FormE.ShowDialog(); if(FormE.DialogResult!=DialogResult.OK){ return; } //We do not need to make a medical order here, because butBlank is not visible in EHR mode. DialogResult=DialogResult.OK; }
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; }
private void gridProg_CellDoubleClick(object sender,ODGridClickEventArgs e) { Chartscrollval=gridProg.ScrollValue; DataRow row=(DataRow)gridProg.Rows[e.Row].Tag; if(row["ProcNum"].ToString()!="0"){ if(checkAudit.Checked){ MsgBox.Show(this,"Not allowed to edit procedures when in audit mode."); return; } Procedure proc=Procedures.GetOneProc(PIn.Long(row["ProcNum"].ToString()),true); if(ProcedureCodes.GetStringProcCode(proc.CodeNum)==ProcedureCodes.GroupProcCode){ FormProcGroup FormP=new FormProcGroup(); List<ProcGroupItem> groupItemList=ProcGroupItems.GetForGroup(proc.ProcNum); List<Procedure> procList=new List<Procedure>(); for(int i=0;i<groupItemList.Count;i++){ procList.Add(Procedures.GetOneProc(groupItemList[i].ProcNum,false)); } FormP.GroupCur=proc; FormP.GroupItemList=groupItemList; FormP.ProcList=procList; FormP.ShowDialog(); if(FormP.DialogResult==DialogResult.OK){ ModuleSelected(PatCur.PatNum); FillProgNotes(); } return; } else{ FormProcEdit FormP=new FormProcEdit(proc,PatCur,FamCur); Plugins.HookAddCode(this, "ContrChart.gridProg_CellDoubleClick_proc", proc, FormP); if(!FormP.IsDisposed) { //Form might be disposed by the above hook. FormP.ShowDialog(); } Plugins.HookAddCode(this, "ContrChart.gridProg_CellDoubleClick_proc2", proc, FormP); if(FormP.DialogResult!=DialogResult.OK) { return; } } } else if(row["CommlogNum"].ToString()!="0"){ Commlog comm=Commlogs.GetOne(PIn.Long(row["CommlogNum"].ToString())); FormCommItem FormC=new FormCommItem(comm); FormC.ShowDialog(); if(FormC.DialogResult!=DialogResult.OK){ return; } } else if(row["RxNum"].ToString()!="0") { RxPat rx=RxPats.GetRx(PIn.Long(row["RxNum"].ToString())); FormRxEdit FormRxE=new FormRxEdit(PatCur,rx); FormRxE.ShowDialog(); if(FormRxE.DialogResult!=DialogResult.OK){ return; } } else if(row["LabCaseNum"].ToString()!="0") { LabCase lab=LabCases.GetOne(PIn.Long(row["LabCaseNum"].ToString())); FormLabCaseEdit FormL=new FormLabCaseEdit(); FormL.CaseCur=lab; FormL.ShowDialog(); //needs to always refresh due to complex ok/cancel } else if(row["TaskNum"].ToString()!="0") { Task task=Tasks.GetOne(PIn.Long(row["TaskNum"].ToString())); if(task==null) { MsgBox.Show(this,"This task has been deleted by another user."); } else { FormTaskEdit FormT=new FormTaskEdit(task,task.Copy()); FormT.Closing+=new CancelEventHandler(TaskGoToEvent); FormT.Show();//non-modal } } else if(row["AptNum"].ToString()!="0") { //Appointment apt=Appointments.GetOneApt( FormApptEdit FormA=new FormApptEdit(PIn.Long(row["AptNum"].ToString())); //PinIsVisible=false FormA.IsInChartModule=true; FormA.ShowDialog(); if(FormA.CloseOD) { ((Form)this.Parent).Close(); return; } if(FormA.DialogResult!=DialogResult.OK) { return; } } else if(row["EmailMessageNum"].ToString()!="0") { EmailMessage msg=EmailMessages.GetOne(PIn.Long(row["EmailMessageNum"].ToString())); if(msg.SentOrReceived==EmailSentOrReceived.WebMailReceived || msg.SentOrReceived==EmailSentOrReceived.WebMailRecdRead || msg.SentOrReceived==EmailSentOrReceived.WebMailSent || msg.SentOrReceived==EmailSentOrReceived.WebMailSentRead) { //web mail uses special secure messaging portal FormWebMailMessageEdit FormWMME=new FormWebMailMessageEdit(PatCur.PatNum,msg.EmailMessageNum); if(FormWMME.ShowDialog()!=DialogResult.OK) { return; } } else { FormEmailMessageEdit FormE=new FormEmailMessageEdit(msg); FormE.ShowDialog(); if(FormE.DialogResult!=DialogResult.OK) { return; } } } else if(row["SheetNum"].ToString()!="0") { Sheet sheet=Sheets.GetSheet(PIn.Long(row["SheetNum"].ToString())); FormSheetFillEdit FormSFE=new FormSheetFillEdit(sheet); FormSFE.ShowDialog(); if(FormSFE.DialogResult!=DialogResult.OK) { return; } } else if(row["FormPatNum"].ToString()!="0"){ FormPat form=FormPats.GetOne(PIn.Long(row["FormPatNum"].ToString())); FormFormPatEdit FormP=new FormFormPatEdit(); FormP.FormPatCur=form; FormP.ShowDialog(); if(FormP.DialogResult==DialogResult.OK) { ModuleSelected(PatCur.PatNum);//Why is this called here and down 3 lines? Do we need the Allocator, or should we return here? } } ModuleSelected(PatCur.PatNum); Reporting.Allocators.MyAllocator1_ProviderPayment.AllocateWithToolCheck(this.PatCur.Guarantor); }
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; }
private void Tool_EHR_Click(bool onLoadShowOrders) { #if EHRTEST //so we can step through for debugging. /* EhrQuarterlyKey keyThisQ=EhrQuarterlyKeys.GetKeyThisQuarter(); if(keyThisQ==null) { MessageBox.Show("No quarterly key entered for this quarter."); return; } if(!((FormEHR)FormOpenDental.FormEHR).QuarterlyKeyIsValid((DateTime.Today.Year-2000).ToString(),EhrQuarterlyKeys.MonthToQuarter(DateTime.Today.Month).ToString(), PrefC.GetString(PrefName.PracticeTitle),keyThisQ.KeyValue)) { MessageBox.Show("Invalid quarterly key."); return; } */ ((FormEHR)FormOpenDental.FormEHR).PatNum=PatCur.PatNum; ((FormEHR)FormOpenDental.FormEHR).OnShowLaunchOrders=onLoadShowOrders; ((FormEHR)FormOpenDental.FormEHR).ShowDialog(); if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.None) { //return; } if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.RxEdit) { FormRxEdit FormRXE=new FormRxEdit(PatCur,RxPats.GetRx(((FormEHR)FormOpenDental.FormEHR).LaunchRxNum)); FormRXE.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false);//recursive. The only way out of the loop is EhrFormResult.None. } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.RxSelect) { FormRxSelect FormRS=new FormRxSelect(PatCur); FormRS.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.Medical) { FormMedical formM=new FormMedical(PatientNoteCur,PatCur); formM.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.PatientEdit) { FormPatientEdit formP=new FormPatientEdit(PatCur,FamCur); formP.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.Online) { FormEhrOnlineAccess formO=new FormEhrOnlineAccess(); formO.PatCur=PatCur; formO.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.MedReconcile) { FormMedicationReconcile FormMR=new FormMedicationReconcile(); FormMR.PatCur=PatCur; FormMR.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.Referrals) { FormReferralsPatient formRP=new FormReferralsPatient(); formRP.PatNum=PatCur.PatNum; formRP.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.MedicationPatEdit) { FormMedPat formMP=new FormMedPat(); formMP.MedicationPatCur=MedicationPats.GetOne(((FormEHR)FormOpenDental.FormEHR).LaunchMedicationPatNum); formMP.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(true); } else if(((FormEHR)FormOpenDental.FormEHR).ResultOnClosing==EhrFormResult.MedicationPatNew) { //This cannot happen unless a provider is logged in with a valid ehr key FormMedications FormM=new FormMedications(); FormM.IsSelectionMode=true; FormM.ShowDialog(); if(FormM.DialogResult==DialogResult.OK) { Medication med=Medications.GetMedicationFromDb(FormM.SelectedMedicationNum); if(med.RxCui==0 //if the med has no Cui, it won't trigger an alert || RxAlertL.DisplayAlerts(PatCur.PatNum,med.RxCui,0))//user sees alert and wants to continue { MedicationPat medicationPat=new MedicationPat(); medicationPat.PatNum=PatCur.PatNum; medicationPat.MedicationNum=FormM.SelectedMedicationNum; medicationPat.ProvNum=Security.CurUser.ProvNum; medicationPat.DateStart=DateTime.Today; FormMedPat FormMP=new FormMedPat(); FormMP.MedicationPatCur=medicationPat; FormMP.IsNew=true; FormMP.IsNewMedOrder=true; FormMP.ShowDialog(); if(FormMP.DialogResult==DialogResult.OK) { ModuleSelected(PatCur.PatNum); } } } Tool_EHR_Click(true); } #else Type type=FormOpenDental.AssemblyEHR.GetType("EHR.FormEHR");//namespace.class object[] args; EhrQuarterlyKey keyThisQ=EhrQuarterlyKeys.GetKeyThisQuarter(); if(keyThisQ==null) { MessageBox.Show("No quarterly key entered for this quarter."); return; } args=new object[] { (DateTime.Today.Year-2000).ToString(),EhrQuarterlyKeys.MonthToQuarter(DateTime.Today.Month).ToString(), PrefC.GetString(PrefName.PracticeTitle),keyThisQ.KeyValue }; if(!(bool)type.InvokeMember("QuarterlyKeyIsValid",System.Reflection.BindingFlags.InvokeMethod,null,FormOpenDental.FormEHR,args)) { MessageBox.Show("Invalid quarterly key."); return; } args=new object[] {PatCur.PatNum}; type.InvokeMember("PatNum",System.Reflection.BindingFlags.SetField,null,FormOpenDental.FormEHR,args); type.InvokeMember("ShowDialog",System.Reflection.BindingFlags.InvokeMethod,null,FormOpenDental.FormEHR,null); if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.None) { return; } if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.RxEdit) { long launchRxNum=(long)type.InvokeMember("LaunchRxNum",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null); FormRxEdit FormRXE=new FormRxEdit(PatCur,RxPats.GetRx(launchRxNum)); FormRXE.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.RxSelect) { FormRxSelect FormRS=new FormRxSelect(PatCur); FormRS.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.Medical) { FormMedical formM=new FormMedical(PatientNoteCur,PatCur); formM.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.PatientEdit) { FormPatientEdit formP=new FormPatientEdit(PatCur,FamCur); formP.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.Online) { FormEhrOnlineAccess formO=new FormEhrOnlineAccess(); formO.PatCur=PatCur; formO.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.MedReconcile) { FormMedicationReconcile FormMR=new FormMedicationReconcile(); FormMR.PatCur=PatCur; FormMR.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.Referrals) { FormReferralsPatient formRP=new FormReferralsPatient(); formRP.PatNum=PatCur.PatNum; formRP.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(false); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.MedicationPatEdit) { long medicationPatNum=(long)type.InvokeMember("LaunchMedicationPatNum",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null); FormMedPat formMP=new FormMedPat(); formMP.MedicationPatCur=MedicationPats.GetOne(medicationPatNum); formMP.ShowDialog(); ModuleSelected(PatCur.PatNum); Tool_EHR_Click(true); } else if(((EhrFormResult)type.InvokeMember("ResultOnClosing",System.Reflection.BindingFlags.GetField,null,FormOpenDental.FormEHR,null))==EhrFormResult.MedicationPatNew) { //This cannot happen unless a provider is logged in with a valid ehr key FormMedications FormM=new FormMedications(); FormM.IsSelectionMode=true; FormM.ShowDialog(); if(FormM.DialogResult==DialogResult.OK) { Medication med=Medications.GetMedicationFromDb(FormM.SelectedMedicationNum); if(med.RxCui==0 //if the med has no Cui, it won't trigger an alert || RxAlertL.DisplayAlerts(PatCur.PatNum,med.RxCui,0))//user sees alert and wants to continue { MedicationPat medicationPat=new MedicationPat(); medicationPat.PatNum=PatCur.PatNum; medicationPat.MedicationNum=FormM.SelectedMedicationNum; medicationPat.ProvNum=Security.CurUser.ProvNum; FormMedPat FormMP=new FormMedPat(); FormMP.MedicationPatCur=medicationPat; FormMP.IsNew=true; FormMP.ShowDialog(); if(FormMP.DialogResult==DialogResult.OK) { ModuleSelected(PatCur.PatNum); } } } Tool_EHR_Click(true); } #endif }
private void gridProg_CellDoubleClick(object sender,ODGridClickEventArgs e) { //Chartscrollval = gridProg.ScrollValue; DataRow row = (DataRow)gridProg.Rows[e.Row].Tag; if(row["ProcNum"].ToString() != "0") { if(checkAudit.Checked) { MsgBox.Show(this,"Not allowed to edit procedures when in audit mode."); return; } Procedure proc = Procedures.GetOneProc(PIn.Long(row["ProcNum"].ToString()),true); FormProcEdit FormP = new FormProcEdit(proc,PatCur,FamCur); FormP.ShowDialog(); if(FormP.DialogResult != DialogResult.OK) { return; } } else if(row["CommlogNum"].ToString() != "0") { Commlog comm = Commlogs.GetOne(PIn.Long(row["CommlogNum"].ToString())); FormCommItem FormC = new FormCommItem(comm); FormC.ShowDialog(); if(FormC.DialogResult != DialogResult.OK) { return; } } else if(row["RxNum"].ToString() != "0") { RxPat rx = RxPats.GetRx(PIn.Long(row["RxNum"].ToString())); FormRxEdit FormRxE = new FormRxEdit(PatCur,rx); FormRxE.ShowDialog(); if(FormRxE.DialogResult != DialogResult.OK) { return; } } else if(row["LabCaseNum"].ToString() != "0") { LabCase lab = LabCases.GetOne(PIn.Long(row["LabCaseNum"].ToString())); FormLabCaseEdit FormL = new FormLabCaseEdit(); FormL.CaseCur = lab; FormL.ShowDialog(); } else if(row["TaskNum"].ToString() != "0") { Task task = Tasks.GetOne(PIn.Long(row["TaskNum"].ToString())); FormTaskEdit FormT = new FormTaskEdit(task,task.Copy()); FormT.Closing+=new CancelEventHandler(TaskGoToEvent); FormT.Show();//non-modal } else if(row["AptNum"].ToString() != "0") { //Appointment apt=Appointments.GetOneApt( FormApptEdit FormA = new FormApptEdit(PIn.Long(row["AptNum"].ToString())); //PinIsVisible=false FormA.ShowDialog(); if(FormA.DialogResult != DialogResult.OK) { return; } } else if(row["EmailMessageNum"].ToString() != "0") { EmailMessage msg = EmailMessages.GetOne(PIn.Long(row["EmailMessageNum"].ToString())); FormEmailMessageEdit FormE = new FormEmailMessageEdit(msg); FormE.ShowDialog(); if(FormE.DialogResult != DialogResult.OK) { return; } } ModuleSelected(PatCur.PatNum); }
private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) { Patient patCur=Patients.GetLim(listRx[e.Row].PatNum); FormRxEdit FormRE=new FormRxEdit(patCur,listRx[e.Row]); FormRE.HideSendBut=true; FormRE.ShowDialog(); FillGrid(); }
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; }