private void butNewRx_Click(object sender, EventArgs e) { //This code is a copy of ContrChart.Tool_Rx_Click(). Any changes to this code need to be changed there too. if (!Security.IsAuthorized(Permissions.RxCreate)) { return; } if (Programs.UsingEcwTightOrFullMode() && Bridges.ECW.UserId != 0) { VBbridges.Ecw.LoadRxForm((int)Bridges.ECW.UserId, Bridges.ECW.EcwConfigPath, (int)Bridges.ECW.AptNum); //refresh the right panel: try { string strAppServer = VBbridges.Ecw.GetAppServer((int)Bridges.ECW.UserId, Bridges.ECW.EcwConfigPath); labelECWerror.Visible = false; } catch (Exception ex) { labelECWerror.Text = "Error: " + ex.Message; labelECWerror.Visible = true; } } else { FormRxSelect FormRS = new FormRxSelect(_patCur); FormRS.ShowDialog(); if (FormRS.DialogResult != DialogResult.OK) { return; } SecurityLogs.MakeLogEntry(Permissions.RxCreate, _patCur.PatNum, "Created prescription."); } FillGrid(); }
private void butRx_Click(object sender,EventArgs e) { //only visible in Orion mode if(!Security.IsAuthorized(Permissions.RxCreate)) { return; } FormRxSelect FormRS=new FormRxSelect(PatCur); FormRS.ShowDialog(); if(FormRS.DialogResult!=DialogResult.OK) { return; } SecurityLogs.MakeLogEntry(Permissions.RxCreate,PatCur.PatNum,PatCur.GetNameLF()); RxPat Rx=RxPats.GetRx(RxNum); if(textNotes.Text!=""){ textNotes.Text+="\r\n"; } textNotes.Text+="Rx - "+Rx.Drug+" - #"+Rx.Disp; string rxNote=Pharmacies.GetDescription(RxNum); if(rxNote!=""){ textNotes.Text+="\r\n"+rxNote; } }
private void Tool_Rx_Click(){ if(!Security.IsAuthorized(Permissions.RxCreate)) { return; } if(UsingEcwTightOrFull() && Bridges.ECW.UserId!=0) { VBbridges.Ecw.LoadRxForm((int)Bridges.ECW.UserId,Bridges.ECW.EcwConfigPath,(int)Bridges.ECW.AptNum); //refresh the right panel: try { string strAppServer=VBbridges.Ecw.GetAppServer((int)Bridges.ECW.UserId,Bridges.ECW.EcwConfigPath); webBrowserEcw.Url=new Uri("http://"+strAppServer+"/mobiledoc/jsp/dashboard/Overview.jsp?ptId=" +PatCur.PatNum.ToString()+"&panelName=overview&pnencid=" +Bridges.ECW.AptNum.ToString()+"&context=progressnotes&TrUserId="+Bridges.ECW.UserId.ToString()); labelECWerror.Visible=false; } catch(Exception ex) { webBrowserEcw.Url=null; labelECWerror.Text="Error: "+ex.Message; labelECWerror.Visible=true; } } else { FormRxSelect FormRS=new FormRxSelect(PatCur); FormRS.ShowDialog(); if(FormRS.DialogResult!=DialogResult.OK) return; ModuleSelected(PatCur.PatNum); SecurityLogs.MakeLogEntry(Permissions.RxCreate,PatCur.PatNum,"Created prescription."); } }
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 }