///<summary></summary> public static long Insert(ProcTP proc){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { proc.ProcTPNum=Meth.GetLong(MethodBase.GetCurrentMethod(),proc); return proc.ProcTPNum; } return Crud.ProcTPCrud.Insert(proc); }
///<summary></summary> public static void Update(ProcTP proc){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),proc); return; } Crud.ProcTPCrud.Update(proc); }
///<summary>There are no dependencies.</summary> public static void Delete(ProcTP proc){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),proc); return; } string command= "DELETE from proctp WHERE ProcTPNum = '"+POut.Long(proc.ProcTPNum)+"'"; Db.NonQ(command); }
///<summary></summary> public static long Insert(ProcTP proc) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { proc.ProcTPNum = Meth.GetLong(MethodBase.GetCurrentMethod(), proc); return(proc.ProcTPNum); } return(Crud.ProcTPCrud.Insert(proc)); }
///<summary></summary> public static void InsertOrUpdate(ProcTP proc, bool isNew){ //No need to check RemotingRole; no call to db. if(isNew){ Insert(proc); } else{ Update(proc); } }
///<summary></summary> public static void Update(ProcTP proc) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), proc); return; } Crud.ProcTPCrud.Update(proc); }
///<summary></summary> public FormProcTPEdit(ProcTP procCur,DateTime dateTP) { // // Required for Windows Form Designer support // InitializeComponent(); Lan.F(this); ProcCur=procCur.Copy(); DateTP=dateTP; }
///<summary></summary> public static long Insert(ProcTP proc) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { proc.ProcTPNum = Meth.GetLong(MethodBase.GetCurrentMethod(), proc); return(proc.ProcTPNum); } //Security.CurUser.UserNum gets set on MT by the DtoProcessor so it matches the user from the client WS. proc.SecUserNumEntry = Security.CurUser.UserNum; return(Crud.ProcTPCrud.Insert(proc)); }
///<summary>There are no dependencies.</summary> public static void Delete(ProcTP proc) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), proc); return; } string command = "DELETE from proctp WHERE ProcTPNum = '" + POut.Long(proc.ProcTPNum) + "'"; Db.NonQ(command); }
///<summary></summary> public static void InsertOrUpdate(ProcTP proc, bool isNew) { //No need to check RemotingRole; no call to db. if (isNew) { Insert(proc); } else { Update(proc); } }
///<summary>Gets a list for just one tp. Used in TP module. Supply a list of all ProcTPs for pt.</summary> public static ProcTP[] GetListForTP(long treatPlanNum,ProcTP[] listAll) { //No need to check RemotingRole; no call to db. ArrayList AL=new ArrayList(); for(int i=0;i<listAll.Length;i++){ if(listAll[i].TreatPlanNum!=treatPlanNum){ continue; } AL.Add(listAll[i]); } ProcTP[] retVal=new ProcTP[AL.Count]; AL.CopyTo(retVal); return retVal; }
///<summary></summary> public static long Insert(ProcTP proc) { if (RemotingClient.RemotingRole != RemotingRole.ServerWeb) { proc.SecUserNumEntry = Security.CurUser.UserNum; //must be before normal remoting role check to get user at workstation } if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { proc.ProcTPNum = Meth.GetLong(MethodBase.GetCurrentMethod(), proc); return(proc.ProcTPNum); } return(Crud.ProcTPCrud.Insert(proc)); }
///<summary>Gets a list for just one tp. Used in TP module. Supply a list of all ProcTPs for pt.</summary> public static ProcTP[] GetListForTP(long treatPlanNum, ProcTP[] listAll) { //No need to check RemotingRole; no call to db. ArrayList AL = new ArrayList(); for (int i = 0; i < listAll.Length; i++) { if (listAll[i].TreatPlanNum != treatPlanNum) { continue; } AL.Add(listAll[i]); } ProcTP[] retVal = new ProcTP[AL.Count]; AL.CopyTo(retVal); return(retVal); }
///<summary>Returns only three columns from all ProcTPs -- TreatPlanNum, PatNum, and ProcNumOrig.</summary> public static List <ProcTP> GetAllLim() { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <List <ProcTP> >(MethodBase.GetCurrentMethod())); } string command = "SELECT TreatPlanNum,PatNum,ProcNumOrig FROM proctp"; DataTable table = Db.GetTable(command); List <ProcTP> listProcTpsLim = new List <ProcTP>(); foreach (DataRow row in table.Rows) { ProcTP procTp = new ProcTP(); procTp.TreatPlanNum = PIn.Long(row["TreatPlanNum"].ToString()); procTp.PatNum = PIn.Long(row["PatNum"].ToString()); procTp.ProcNumOrig = PIn.Long(row["ProcNumOrig"].ToString()); listProcTpsLim.Add(procTp); } return(listProcTpsLim); }
///<summary></summary> public ProcTP Copy() { ProcTP t = new ProcTP(); t.ProcTPNum = ProcTPNum; t.TreatPlanNum = TreatPlanNum; t.PatNum = PatNum; t.ProcNumOrig = ProcNumOrig; t.ItemOrder = ItemOrder; t.Priority = Priority; t.ToothNumTP = ToothNumTP; t.Surf = Surf; t.ADACode = ADACode; t.Descript = Descript; t.FeeAmt = FeeAmt; t.PriInsAmt = PriInsAmt; t.SecInsAmt = SecInsAmt; t.PatAmt = PatAmt; return(t); }
private void OnCreate_Click() { if(gridPlans.SelectedIndices[0]!=0){ MsgBox.Show(this,"The default TP must be selected before saving a TP. You can highlight some procedures in the default TP to save a TP with only those procedures in it."); return; } if(gridMain.SelectedIndices.Length==0){ gridMain.SetSelected(true); } TreatPlan tp=new TreatPlan(); tp.Heading=Lan.g(this,"Proposed Treatment Plan"); tp.DateTP=DateTime.Today; tp.PatNum=PatCur.PatNum; tp.Note=PrefC.GetString(PrefName.TreatmentPlanNote); tp.ResponsParty=PatCur.ResponsParty; TreatPlans.Insert(tp); ProcTP procTP; Procedure proc; int itemNo=0; for(int i=0;i<gridMain.SelectedIndices.Length;i++){ if(gridMain.Rows[gridMain.SelectedIndices[i]].Tag==null){ //user must have highlighted a subtotal row. continue; } proc=(Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag; procTP=new ProcTP(); procTP.TreatPlanNum=tp.TreatPlanNum; procTP.PatNum=PatCur.PatNum; procTP.ProcNumOrig=proc.ProcNum; procTP.ItemOrder=itemNo; procTP.Priority=proc.Priority; procTP.ToothNumTP=Tooth.ToInternat(proc.ToothNum); if(ProcedureCodes.GetProcCode(proc.CodeNum).TreatArea==TreatmentArea.Surf){ procTP.Surf=Tooth.SurfTidyFromDbToDisplay(proc.Surf,proc.ToothNum); } else{ procTP.Surf=proc.Surf;//for UR, L, etc. } procTP.ProcCode=ProcedureCodes.GetStringProcCode(proc.CodeNum); procTP.Descript=RowsMain[gridMain.SelectedIndices[i]].Description; if(checkShowFees.Checked){ procTP.FeeAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].Fee.ToString()); } if(checkShowIns.Checked){ procTP.PriInsAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].PriIns.ToString()); procTP.SecInsAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].SecIns.ToString()); } if(checkShowDiscount.Checked){ procTP.Discount=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].Discount.ToString()); } if(checkShowIns.Checked){ procTP.PatAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].Pat.ToString()); } procTP.Prognosis=RowsMain[gridMain.SelectedIndices[i]].Prognosis; procTP.Dx=RowsMain[gridMain.SelectedIndices[i]].Dx; ProcTPs.InsertOrUpdate(procTP,true); itemNo++; #region Canadian Lab Fees /* proc=(Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag; procTP=new ProcTP(); procTP.TreatPlanNum=tp.TreatPlanNum; procTP.PatNum=PatCur.PatNum; procTP.ProcNumOrig=proc.ProcNum; procTP.ItemOrder=itemNo; procTP.Priority=proc.Priority; procTP.ToothNumTP=""; procTP.Surf=""; procTP.Code=proc.LabProcCode; procTP.Descript=gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Description"))].Text; if(checkShowFees.Checked) { procTP.FeeAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Fee"))].Text); } if(checkShowIns.Checked) { procTP.PriInsAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Pri Ins"))].Text); procTP.SecInsAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Sec Ins"))].Text); procTP.PatAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Pat"))].Text); } ProcTPs.InsertOrUpdate(procTP,true); itemNo++;*/ #endregion Canadian Lab Fees } //Send TP DFT HL7 message to ECW with embedded PDF when using tight integration only. if(Programs.UsingEcwTight()){ PrepImageForPrinting(); MigraDoc.Rendering.PdfDocumentRenderer pdfRenderer=new MigraDoc.Rendering.PdfDocumentRenderer(true,PdfFontEmbedding.Always); pdfRenderer.Document=CreateDocument(); pdfRenderer.RenderDocument(); MemoryStream ms=new MemoryStream(); pdfRenderer.PdfDocument.Save(ms); byte[] pdfBytes=ms.GetBuffer(); //#region Remove when testing is complete. //string tempFilePath=Path.GetTempFileName(); //File.WriteAllBytes(tempFilePath,pdfBytes); //#endregion string pdfDataStr=Convert.ToBase64String(pdfBytes); Bridges.ECW.SendHL7(Bridges.ECW.AptNum,PatCur.PriProv,PatCur,pdfDataStr,"treatment",true); } ModuleSelected(PatCur.PatNum); for(int i=0;i<PlanList.Length;i++){ if(PlanList[i].TreatPlanNum==tp.TreatPlanNum){ gridPlans.SetSelected(i+1,true); FillMain(); } } }
private void ToolBarMainCreate_Click(){//Save TP if(gridPlans.SelectedIndices[0]!=0){ MsgBox.Show(this,"The default TP must be selected before saving a TP. You can highlight some procedures in the default TP to save a TP with only those procedures in it."); return; } //Check for duplicate procedures on the appointment before sending the DFT to eCW. if(Programs.UsingEcwTightOrFullMode() && Bridges.ECW.AptNum!=0) { List<Procedure> procs=Procedures.GetProcsForSingle(Bridges.ECW.AptNum,false); string duplicateProcs=ProcedureL.ProcsContainDuplicates(procs); if(duplicateProcs!="") { MessageBox.Show(duplicateProcs); return; } } if(gridMain.SelectedIndices.Length==0){ gridMain.SetSelected(true); } TreatPlan tp=new TreatPlan(); tp.Heading=Lan.g(this,"Proposed Treatment Plan"); tp.DateTP=DateTimeOD.Today; tp.PatNum=PatCur.PatNum; tp.Note=PrefC.GetString(PrefName.TreatmentPlanNote); tp.ResponsParty=PatCur.ResponsParty; TreatPlans.Insert(tp); ProcTP procTP; Procedure proc; int itemNo=0; List<Procedure> procList=new List<Procedure>(); for(int i=0;i<gridMain.SelectedIndices.Length;i++){ if(gridMain.Rows[gridMain.SelectedIndices[i]].Tag==null){ //user must have highlighted a subtotal row. continue; } proc=(Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag; procList.Add(proc); procTP=new ProcTP(); procTP.TreatPlanNum=tp.TreatPlanNum; procTP.PatNum=PatCur.PatNum; procTP.ProcNumOrig=proc.ProcNum; procTP.ItemOrder=itemNo; procTP.Priority=proc.Priority; procTP.ToothNumTP=Tooth.ToInternat(proc.ToothNum); if(ProcedureCodes.GetProcCode(proc.CodeNum).TreatArea==TreatmentArea.Surf){ procTP.Surf=Tooth.SurfTidyFromDbToDisplay(proc.Surf,proc.ToothNum); } else{ procTP.Surf=proc.Surf;//for UR, L, etc. } procTP.ProcCode=ProcedureCodes.GetStringProcCode(proc.CodeNum); procTP.Descript=RowsMain[gridMain.SelectedIndices[i]].Description; if(checkShowFees.Checked){ procTP.FeeAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].Fee.ToString()); } if(checkShowIns.Checked){ procTP.PriInsAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].PriIns.ToString()); procTP.SecInsAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].SecIns.ToString()); } if(checkShowDiscount.Checked){ procTP.Discount=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].Discount.ToString()); } if(checkShowIns.Checked){ procTP.PatAmt=PIn.Double(RowsMain[gridMain.SelectedIndices[i]].Pat.ToString()); } procTP.Prognosis=RowsMain[gridMain.SelectedIndices[i]].Prognosis; procTP.Dx=RowsMain[gridMain.SelectedIndices[i]].Dx; ProcTPs.InsertOrUpdate(procTP,true); itemNo++; #region Canadian Lab Fees /* proc=(Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag; procTP=new ProcTP(); procTP.TreatPlanNum=tp.TreatPlanNum; procTP.PatNum=PatCur.PatNum; procTP.ProcNumOrig=proc.ProcNum; procTP.ItemOrder=itemNo; procTP.Priority=proc.Priority; procTP.ToothNumTP=""; procTP.Surf=""; procTP.Code=proc.LabProcCode; procTP.Descript=gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Description"))].Text; if(checkShowFees.Checked) { procTP.FeeAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Fee"))].Text); } if(checkShowIns.Checked) { procTP.PriInsAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Pri Ins"))].Text); procTP.SecInsAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Sec Ins"))].Text); procTP.PatAmt=PIn.PDouble(gridMain.Rows[gridMain.SelectedIndices[i]] .Cells[gridMain.Columns.GetIndex(Lan.g("TableTP","Pat"))].Text); } ProcTPs.InsertOrUpdate(procTP,true); itemNo++;*/ #endregion Canadian Lab Fees } //Send TP DFT HL7 message to ECW with embedded PDF when using tight or full integration only. if(Programs.UsingEcwTightOrFullMode() && Bridges.ECW.AptNum!=0){ PrepImageForPrinting(); MigraDoc.Rendering.PdfDocumentRenderer pdfRenderer=new MigraDoc.Rendering.PdfDocumentRenderer(true,PdfFontEmbedding.Always); pdfRenderer.Document=CreateDocument(); pdfRenderer.RenderDocument(); MemoryStream ms=new MemoryStream(); pdfRenderer.PdfDocument.Save(ms); byte[] pdfBytes=ms.GetBuffer(); //#region Remove when testing is complete. //string tempFilePath=Path.GetTempFileName(); //File.WriteAllBytes(tempFilePath,pdfBytes); //#endregion string pdfDataStr=Convert.ToBase64String(pdfBytes); if(HL7Defs.IsExistingHL7Enabled()) { //DFT messages that are PDF's only and do not include FT1 segments, so proc list can be empty //MessageConstructor.GenerateDFT(procList,EventTypeHL7.P03,PatCur,Patients.GetPat(PatCur.Guarantor),Bridges.ECW.AptNum,"treatment",pdfDataStr); MessageHL7 messageHL7=MessageConstructor.GenerateDFT(new List<Procedure>(),EventTypeHL7.P03,PatCur,Patients.GetPat(PatCur.Guarantor),Bridges.ECW.AptNum,"treatment",pdfDataStr); if(messageHL7==null) { MsgBox.Show(this,"There is no DFT message type defined for the enabled HL7 definition."); return; } HL7Msg hl7Msg=new HL7Msg(); hl7Msg.AptNum=0;//Prevents the appt complete button from changing to the "Revise" button prematurely. hl7Msg.HL7Status=HL7MessageStatus.OutPending;//it will be marked outSent by the HL7 service. hl7Msg.MsgText=messageHL7.ToString(); hl7Msg.PatNum=PatCur.PatNum; HL7Msgs.Insert(hl7Msg); } else { Bridges.ECW.SendHL7(Bridges.ECW.AptNum,PatCur.PriProv,PatCur,pdfDataStr,"treatment",true); } } ModuleSelected(PatCur.PatNum); for(int i=0;i<PlanList.Length;i++){ if(PlanList[i].TreatPlanNum==tp.TreatPlanNum){ gridPlans.SetSelected(i+1,true); FillMain(); } } }