private void SendFT1ForPanelSet() { foreach( Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill in this.m_PanelSetOrder.PanelSetOrderCPTCodeBillCollection) { Business.HL7View.EPIC.EPICFT1ResultView epicFT1ResultView = new Business.HL7View.EPIC.EPICFT1ResultView(this.m_AccessionOrder, panelSetOrderCPTCodeBill, true); Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult(); epicFT1ResultView.CanSend(methodResult); if (methodResult.Success == true) { Business.Billing.Model.CptCode cptCode = Business.Billing.Model.CptCodeCollection.Instance.GetCptCode(panelSetOrderCPTCodeBill.CPTCode); Business.Rules.MethodResult sendResult = new Business.Rules.MethodResult(); epicFT1ResultView.Send(sendResult); } } }
private void ProcessSVHCDMFiles(object sender, System.ComponentModel.DoWorkEventArgs e) { this.m_BackgroundWorker.ReportProgress(1, "Starting processing SVH CDM files."); YellowstonePathology.Business.Client.Model.ClientGroupClientCollection hrhGroup = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetClientGroupClientCollectionByClientGroupId("2"); YellowstonePathology.Business.ReportNoCollection reportNoCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetReportNumbersBySVHProcess(this.m_PostDate); string workingFolder = System.IO.Path.Combine(this.m_BaseWorkingFolderPathSVH, this.m_PostDate.ToString("MMddyyyy")); if (Directory.Exists(workingFolder) == false) { Directory.CreateDirectory(workingFolder); Directory.CreateDirectory(System.IO.Path.Combine(workingFolder, "ft1")); Directory.CreateDirectory(System.IO.Path.Combine(workingFolder, "ft1", "done")); Directory.CreateDirectory(System.IO.Path.Combine(workingFolder, "result")); Directory.CreateDirectory(System.IO.Path.Combine(workingFolder, "result", "done")); } int rowCount = 0; foreach (YellowstonePathology.Business.ReportNo reportNo in reportNoCollection) { this.m_BackgroundWorker.ReportProgress(1, "Processing: " + reportNo.Value); string masterAccessionNo = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMasterAccessionNoFromReportNo(reportNo.Value); YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(masterAccessionNo, this); YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo.Value); foreach (Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill in panelSetOrder.PanelSetOrderCPTCodeBillCollection) { if (panelSetOrderCPTCodeBill.BillTo == "Client" && panelSetOrderCPTCodeBill.PostDate == this.m_PostDate) { if (YellowstonePathology.Business.Billing.Model.CDMCollection.Instance.Exists(panelSetOrderCPTCodeBill.CPTCode, "SVH") == true) { if (panelSetOrderCPTCodeBill.PostedToClient == false) { if (string.IsNullOrEmpty(panelSetOrderCPTCodeBill.MedicalRecord) == false && string.IsNullOrEmpty(panelSetOrderCPTCodeBill.Account) == false) { if (panelSetOrderCPTCodeBill.MedicalRecord.StartsWith("V") == true || panelSetOrderCPTCodeBill.MedicalRecord.StartsWith("R") == true) { this.m_BackgroundWorker.ReportProgress(1, "Writing File: " + reportNo.Value + " - " + panelSetOrderCPTCodeBill.CPTCode); Business.HL7View.EPIC.EPICFT1ResultView epicFT1ResultView = new Business.HL7View.EPIC.EPICFT1ResultView(accessionOrder, panelSetOrderCPTCodeBill); epicFT1ResultView.Publish(System.IO.Path.Combine(workingFolder, "ft1")); panelSetOrderCPTCodeBill.PostedToClient = true; panelSetOrderCPTCodeBill.PostedToClientDate = DateTime.Now; rowCount += 1; } else { throw new Exception("The MRN for this charge doesn't start with a V"); } } else { throw new Exception("This MRN or ACCT is null."); } } } else { this.m_BackgroundWorker.ReportProgress(1, "There is no CDM for ReportNo/Code: " + reportNo.Value + " - " + panelSetOrderCPTCodeBill.CPTCode); Business.Billing.Model.SVHNoCDMMailMessage.SendMessage(panelSetOrderCPTCodeBill.CPTCode); } } } } YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this); this.m_BackgroundWorker.ReportProgress(1, "Wrote " + rowCount + " SVH CDM files."); Business.Gateway.BillingGateway.UpdateBillingEODProcess(this.m_PostDate, "ProcessSVHCDMFiles"); }
private void MenuItemSendBillingHL7_Click(object sender, RoutedEventArgs e) { if (this.ListViewAccessionOrders.SelectedItem != null) { YellowstonePathology.Business.Search.ReportSearchItem reportSearchItem = (YellowstonePathology.Business.Search.ReportSearchItem)this.ListViewAccessionOrders.SelectedItem; YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = this.m_LoginUI.AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportSearchItem.ReportNo); Business.Test.PanelSetOrderCPTCodeBill bill = panelSetOrder.PanelSetOrderCPTCodeBillCollection[0]; Business.HL7View.EPIC.EPICFT1ResultView resultView = new Business.HL7View.EPIC.EPICFT1ResultView(this.m_LoginUI.AccessionOrder, bill, true); Business.Rules.MethodResult result = new Business.Rules.MethodResult(); resultView.Send(result); MessageBox.Show(result.Message); } }