Esempio n. 1
0
        public override string GetLine(int printerColorCode)
        {
            //C:\Program Files\General Data Company\Cassette Printing\Normal.itl|102|15-28044|1A|JA|YPII|ALQ15-28044.1A|15|28044
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_MasterAccessionNo);
            StringBuilder line = new StringBuilder(TemplateFileName + this.m_Delimeter);

            line.Append(printerColorCode.ToString() + this.m_Delimeter);
            line.Append(orderIdParser.MasterAccessionNo + this.m_Delimeter);
            line.Append(this.BlockTitle + this.m_Delimeter);
            line.Append(this.PatientInitials + this.m_Delimeter);

            if (this.m_ClientAccessioned == true)
            {
                line.Append(this.m_ClientAccessionNo + this.m_Delimeter);
            }
            else
            {
                if (string.IsNullOrEmpty(this.m_EmbeddingInstructions) == false)
                {
                    line.Append(this.m_CompanyId + ":" + this.m_EmbeddingInstructions + this.m_Delimeter);
                }
                else
                {
                    line.Append(this.m_CompanyId + this.m_Delimeter);
                }
            }

            line.Append(this.ScanningId + this.m_Delimeter);
            line.Append(orderIdParser.MasterAccessionNoYear.Value.ToString() + this.m_Delimeter);
            line.Append(orderIdParser.MasterAccessionNoNumber.Value.ToString());
            return(line.ToString());
        }
Esempio n. 2
0
        public MethodResult Load()
        {
            MethodResult methodResult = new MethodResult();

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_ReportNo);
            string path = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);

            if (Directory.Exists(path))
            {
                string[] files = Directory.GetFiles(path);
                foreach (string fileName in files)
                {
                    RemoteFile remoteFile = new RemoteFile(fileName);
                    this.Add(remoteFile);
                    if (this.m_IncludeMemoryStream)
                    {
                        remoteFile.Load();
                    }
                }
                methodResult.Success = true;
            }
            else
            {
                methodResult.Success = false;
            }
            return(methodResult);
        }
Esempio n. 3
0
        public void ToXml(XElement document)
        {
            YellowstonePathology.Business.Domain.Physician casePhysician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_AccessionOrder.PhysicianId);
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo);

            MSH msh = new ARUPMSH();
            msh.ToXml(document);

            PID pid = new PID(this.m_AccessionOrder);
            pid.ToXml(document);

            PV1 pv1 = new PV1(this.m_AccessionOrder, casePhysician);
            pv1.ToXml(document);

            IN1 in1 = new IN1(this.m_AccessionOrder);
            in1.ToXml(document);

            ORC orc = new ORC(this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo, this.m_AccessionOrder, casePhysician);
            orc.ToXml(document);

            string serverFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo + ".HL7.xml";
            string mirthFileName = @"\\YPIIInterface1\ChannelData\Outgoing\Testing\" + this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo + ".HL7.xml";

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(serverFileName))
            {
                document.Save(sw);
            }

            System.IO.File.Copy(serverFileName, mirthFileName);
        }
Esempio n. 4
0
 private void GetReportNo()
 {
     if (this.m_IsValid)
     {
         YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_SourceValue);
         if (orderIdParser.ReportNo != null)
         {
             this.m_IsValid    = true;
             this.m_ReportNo   = this.m_SourceValue;
             this.m_IsReportNo = true;
         }
         else if (orderIdParser.MasterAccessionNo != null)
         {
             this.m_IsValid    = true;
             this.m_ReportNo   = orderIdParser.SurgicalReportNoFromMasterAccessionNo;
             this.m_IsReportNo = true;
         }
         else if (this.m_SourceValue.Length > 0 && this.CheckDigits(0))
         {
             this.m_IsValid    = true;
             this.m_ReportNo   = YellowstonePathology.Business.OrderIdParser.SurgicalReportNoFromNumber(this.m_SourceValue);
             this.m_IsReportNo = true;
         }
     }
 }
Esempio n. 5
0
        public void ToXml(XElement document)
        {
            YellowstonePathology.Business.Domain.Physician casePhysician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_AccessionOrder.PhysicianId);
            YellowstonePathology.Business.OrderIdParser    orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo);

            MSH msh = new ARUPMSH();

            msh.ToXml(document);

            PID pid = new PID(this.m_AccessionOrder);

            pid.ToXml(document);

            PV1 pv1 = new PV1(this.m_AccessionOrder, casePhysician);

            pv1.ToXml(document);

            IN1 in1 = new IN1(this.m_AccessionOrder);

            in1.ToXml(document);

            ORC orc = new ORC(this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo, this.m_AccessionOrder, casePhysician);

            orc.ToXml(document);

            string serverFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo + ".HL7.xml";
            string mirthFileName  = @"\\YPIIInterface1\ChannelData\Outgoing\Testing\" + this.m_AccessionOrder.PanelSetOrderCollection[0].ReportNo + ".HL7.xml";

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(serverFileName))
            {
                document.Save(sw);
            }

            System.IO.File.Copy(serverFileName, mirthFileName);
        }
Esempio n. 6
0
        public static string GetPath(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            if (orderIdParser.IsLegacyReportNo == true)
            {
                return(GetLegacyPath(orderIdParser.ReportNo));
            }

            string strPath = @"\\CFileServer\AccessionDocuments\20" + orderIdParser.MasterAccessionNoYear.Value.ToString();
            string number  = orderIdParser.MasterAccessionNoNumber.Value.ToString();
            int    length  = number.Length;

            switch (length)
            {
            case 5:
                strPath += @"\" + number.Substring(0, 2) + "000-" + number.Substring(0, 2) + @"999\";
                break;

            case 4:
                strPath += @"\0" + number.Substring(0, 1) + "000-0" + number.Substring(0, 1) + @"999\";
                break;

            default:
                strPath += @"\00001-00999\";
                break;
            }
            strPath += orderIdParser.MasterAccessionNo + @"\";
            return(strPath);
        }
Esempio n. 7
0
        public static void PrintWordDoc(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            Microsoft.Office.Interop.Word.Application oWord;
            Object oMissing = System.Reflection.Missing.Value;
            Object oTrue    = true;
            Object oFalse   = false;
            Object oCopies  = 1;

            oWord = new Microsoft.Office.Interop.Word.Application();
            string currentPrinter = oWord.ActivePrinter;

            oWord.Visible = false;

            Object oFile = CaseDocument.GetCaseFileNameDoc(orderIdParser);

            Microsoft.Office.Interop.Word.Document doc = oWord.Documents.Open(ref oFile, ref oMissing, ref oMissing,
                                                                              ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                                                                              ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);

            doc.PrintOut(ref oFalse, ref oMissing, ref oMissing, ref oMissing,
                         ref oMissing, ref oMissing, ref oMissing, ref oCopies, ref oMissing, ref oMissing, ref oFalse,
                         ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);

            CaseDocument.ReleaseComObject(doc);
            oWord.ActivePrinter = currentPrinter;
            oWord.Quit(ref oFalse, ref oMissing, ref oMissing);
            CaseDocument.ReleaseComObject(oWord);
        }
        public bool TryDelete(YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Interface.ICaseDocument caseDocument,
                              YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            bool result = true;

            YellowstonePathology.Business.Rules.MethodResult methodResult = caseDocument.DeleteCaseFiles(orderIdParser);

            if (methodResult.Success == false)
            {
                this.DelayPublishAndDistribution(15, "Not able to delete files prior to publishing.", panelSetOrder);

                this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                                     null, null, "Not able to delete files prior to publishing.");

                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, "Not able to delete files prior to publishing: " + panelSetOrder.ReportNo);
                System.Net.Mail.SmtpClient  client  = new System.Net.Mail.SmtpClient("10.1.2.111");

                Uri uri = new Uri("http://tempuri.org/");
                System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                client.Credentials = credential;
                client.Send(message);

                result = false;
            }

            return(result);
        }
Esempio n. 9
0
        public DistributionResult Distribute(string reportNo, Business.Test.AccessionOrder accessionOrder)
        {
            DistributionResult result = new DistributionResult();

            result.IsComplete = true;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string tifDocumentPath = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameTif(orderIdParser);
            string pdfDocumentPath = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNamePDF(orderIdParser);

            System.IO.FileStream fileStream = new System.IO.FileStream(tifDocumentPath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
            System.Windows.Media.Imaging.TiffBitmapDecoder tiffBitmapDecoder = new System.Windows.Media.Imaging.TiffBitmapDecoder(fileStream, System.Windows.Media.Imaging.BitmapCreateOptions.PreservePixelFormat, System.Windows.Media.Imaging.BitmapCacheOption.Default);
            int pageCount = tiffBitmapDecoder.Frames.Count;

            YellowstonePathology.Business.ReportDistribution.Model.MeditechFileDefinition meditechFileDefinition =
                new Business.ReportDistribution.Model.MeditechFileDefinition(pageCount, accessionOrder.SvhAccount, accessionOrder.SvhMedicalRecord, accessionOrder.MasterAccessionNo,
                                                                             reportNo, accessionOrder.PBirthdate.Value, accessionOrder.PSex, accessionOrder.AccessionDate.Value);

            string fileName       = meditechFileDefinition.GetFileName() + ".pdf";
            string saveToFileName = System.IO.Path.Combine(ProductionFolderPath, fileName);

            System.IO.File.Copy(pdfDocumentPath, saveToFileName, true);

            return(result);
        }
Esempio n. 10
0
        public static string GetDraftDocumentFilePathDOCX(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            string path = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);

            path = path + orderIdParser.ReportNo + ".DRAFT.DOCX";
            return(path);
        }
Esempio n. 11
0
        public void SaveAsTIF(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            string filename = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);

            filename += orderIdParser.MasterAccessionNo + ".Patient.tif";
            YellowstonePathology.Business.Helper.FileConversionHelper.SaveFixedDocumentAsTiff(this.Document, filename);
        }
Esempio n. 12
0
        public override void Render()
        {
            base.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\PreauthorizationNotification.5.xml";
            base.OpenTemplate();
            this.SetDemographicsV2();

            Business.Test.ExtractAndHoldForPreauthorization.ExtractAndHoldForPreauthorizationTestOrder testOrder = (Business.Test.ExtractAndHoldForPreauthorization.ExtractAndHoldForPreauthorizationTestOrder) this.m_PanelSetOrder;
            Business.PanelSet.Model.PanelSetCollection panelSetCollection = Business.PanelSet.Model.PanelSetCollection.GetAll();
            Business.PanelSet.Model.PanelSet           panelSet           = panelSetCollection.GetPanelSet(testOrder.TestId.Value);

            this.SetXmlNodeData("additional_testing", panelSet.PanelSetName);
            this.SetXmlNodeData("cpt_codes", panelSet.PanelSetCptCodeCollection.GetCommaSeparatedString());
            this.SetXmlNodeData("report_comment", testOrder.Comment);

            if (this.m_AccessionOrder.PrimaryInsurance == "Medicare")
            {
                this.SetXmlNodeData("additional_testing_message", "The following additional testing needs an ABN");
            }
            else
            {
                this.SetXmlNodeData("additional_testing_message", "The following additional testing needs preauthorization:");
            }

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            this.m_SaveFileName = Business.Document.CaseDocument.GetCaseFileNameXMLPreAuth(orderIdParser);
            this.m_ReportXml.Save(this.m_SaveFileName);
        }
Esempio n. 13
0
 public static string GetAccessionedFileName(string reportNo)
 {
     string result = string.Empty;
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
     result = YellowstonePathology.Business.Document.CaseDocument.GetFirstRequisitionFileName(orderIdParser);
     return result;
 }
Esempio n. 14
0
 public override void Publish()
 {
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
     YellowstonePathology.Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, CaseDocumentTypeEnum.PreauthorizationRequest, CaseDocumentFileTypeEnum.xml, CaseDocumentFileTypeEnum.doc);
     YellowstonePathology.Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, CaseDocumentTypeEnum.PreauthorizationRequest, CaseDocumentFileTypeEnum.doc, CaseDocumentFileTypeEnum.xps);
     YellowstonePathology.Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, CaseDocumentTypeEnum.PreauthorizationRequest, CaseDocumentFileTypeEnum.xps, CaseDocumentFileTypeEnum.tif);
 }
Esempio n. 15
0
        public CaseDocumentCollection(string reportNo)
        {
            this.m_ReportNo = reportNo;
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string filePath = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);

            if (!Directory.Exists(filePath))
            {
                filePath = @"\\CFileServer\Documents";
            }

            string[] files = Directory.GetFiles(filePath);
            foreach (string file in files)
            {
                string[] slashSplit = file.Split('\\');
                string   fileOnly   = slashSplit[slashSplit.Length - 1];
                if (fileOnly.ToUpper() != "THUMBS.DB")
                {
                    CaseDocument item = CaseDocumentFactory.GetCaseDocument(null, file);
                    item.SetFileName(file);
                    item.CaseDocumentType = "Physical Document";
                    this.Add(item);
                }
            }
        }
Esempio n. 16
0
        public void FromAliquotOrder(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AliquotOrder = aliquotOrder;
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(accessionOrder.MasterAccessionNo);

            YellowstonePathology.Business.PatientName patientName = new PatientName(accessionOrder.PLastName, accessionOrder.PFirstName);
            this.m_MasterAccessionNo     = orderIdParser.MasterAccessionNo;
            this.m_AliquotOrder          = aliquotOrder;
            this.m_BlockTitle            = aliquotOrder.PrintLabel;
            this.m_Verified              = aliquotOrder.GrossVerified;
            this.m_PatientInitials       = patientName.GetInitials();
            this.m_EmbeddingInstructions = aliquotOrder.EmbeddingInstructions;

            if (accessionOrder.ClientAccessioned == true)
            {
                this.m_ClientAccessionNo = accessionOrder.ClientAccessionNo;
                this.m_ClientAccessioned = true;
            }
            else
            {
                this.m_ClientAccessionNo = null;
                this.m_ClientAccessioned = false;
            }

            if (YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.UseLaserCassettePrinter == false)
            {
                this.m_CassetteColumn = accessionOrder.PrintMateColumnNumber.ToString();
            }
            else
            {
                YellowstonePathology.Business.Common.PrintMateCarousel printMateCarousel = new Common.PrintMateCarousel();
                YellowstonePathology.Business.Common.PrintMateColumn   printMateColumn   = printMateCarousel.GetColumn(accessionOrder.PrintMateColumnNumber);
                this.m_CassetteColumn = printMateColumn.GeneralDataColor.ToString();
            }
        }
Esempio n. 17
0
        public static string GetNextFileName(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            string fileName = null;

            if (orderIdParser.IsLegacyReportNo == true)
            {
                fileName = System.IO.Path.Combine(YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser), orderIdParser.ReportNo + ".REQ.ZZZ.TIF");
            }
            else
            {
                fileName = System.IO.Path.Combine(YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser), orderIdParser.MasterAccessionNo + ".REQ.ZZZ.TIF");
            }

            fileName = fileName.ToUpper();

            int x = 1;

            while (true)
            {
                string fileNameTemp = fileName.Replace("ZZZ", x.ToString());
                if (File.Exists(fileNameTemp) == false)
                {
                    fileName = fileNameTemp;
                    break;
                }
                else
                {
                    x += 1;
                }
            }
            return(fileName);
        }
Esempio n. 18
0
        public static string GetNotificationDocumentFilePath(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            string path = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);

            path = path + orderIdParser.ReportNo + ".notify.xps";
            return(path);
        }
 public override void Publish()
 {
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
     YellowstonePathology.Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, CaseDocumentTypeEnum.CaseReport, CaseDocumentFileTypeEnum.xml, CaseDocumentFileTypeEnum.pdf);
     YellowstonePathology.Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, CaseDocumentTypeEnum.CaseReport, CaseDocumentFileTypeEnum.xps, CaseDocumentFileTypeEnum.tif);
     //YellowstonePathology.Business.Document.CaseDocument.SaveXMLAsPDF(orderIdParser);
     //YellowstonePathology.Business.Helper.FileConversionHelper.SaveXpsReportToTiff(this.m_PanelSetOrder.ReportNo);
 }
Esempio n. 20
0
        public static string GetSaveDraftDocumentFilePath(YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            string path = @"C:\ProgramData\ypi\drafts\";
            string id   = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            path = path + orderIdParser.ReportNo + "." + id + ".DRAFT.XML";
            return(path);
        }
Esempio n. 21
0
        public static string GetAccessionedFileName(string reportNo)
        {
            string result = string.Empty;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            result = YellowstonePathology.Business.Document.CaseDocument.GetFirstRequisitionFileName(orderIdParser);
            return(result);
        }
Esempio n. 22
0
        public CaseDocument GetNextRequisition()
        {
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_ReportNo);
            CaseDocument nextRequisition = new CaseDocument();

            nextRequisition.CaseDocumentType = "Physical Document";
            nextRequisition.FullFileName     = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_ReportNo + ".REQ." + this.GetNextRequisitionNumber().ToString() + ".TIF";
            return(nextRequisition);
        }
        private void CreateXmlBillingDocument(YellowstonePathology.Business.Test.AccessionOrder accessionOrder, string reportNo)
        {
            YellowstonePathology.Business.Billing.Model.PSABillingDocument psaBillingDocument = new YellowstonePathology.Business.Billing.Model.PSABillingDocument(accessionOrder, reportNo);
            psaBillingDocument.Build();

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string filePath = System.IO.Path.Combine(YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser), reportNo + ".BillingDetails.xml");

            psaBillingDocument.Save(filePath);
        }
Esempio n. 24
0
        public override void Render()
        {
            base.m_TemplateName = @"\\CFileServer\documents\ReportTemplates\XmlTemplates\MissingInformation.1.xml";
            base.OpenTemplate();
            this.SetDemographicsV2();

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            this.m_SaveFileName = Business.Document.CaseDocument.GetCaseFileNameXml(orderIdParser);
            this.m_ReportXml.Save(this.m_SaveFileName);
        }
Esempio n. 25
0
        public void Send(YellowstonePathology.Business.Rules.MethodResult result)
        {
            this.m_Document = new XElement("HL7Message");
            this.m_ObxCount = 1;

            WYDOHClient client      = new WYDOHClient();
            OruR01      messageType = new OruR01();

            WYDOHMSHView msh = new WYDOHMSHView(client, messageType);

            msh.ToXml(this.m_Document);

            WYDOHPIDView pid = new WYDOHPIDView(this.m_AccessionOrder.PatientId, this.m_AccessionOrder.PLastName, this.m_AccessionOrder.PFirstName, this.m_AccessionOrder.PBirthdate,
                                                this.m_AccessionOrder.PSex, this.m_AccessionOrder.SvhAccount, this.m_AccessionOrder.PSSN, this.m_AccessionOrder.PAddress1, this.m_AccessionOrder.PAddress2,
                                                this.m_AccessionOrder.PCity, this.m_AccessionOrder.PState, this.m_AccessionOrder.PZipCode);

            pid.ToXml(this.m_Document);


            Business.Client.Model.Client clnt = Business.Gateway.PhysicianClientGateway.GetClientByClientId(this.m_AccessionOrder.ClientId);
            WYDOHORCView orc = new WYDOHORCView(this.m_AccessionOrder.ExternalOrderId, clnt, this.m_OrderingPhysician, this.m_PanelSetOrder.ReportNo, OrderStatusEnum.Complete, this.m_AccessionOrder.SystemInitiatingOrder);

            orc.ToXml(this.m_Document);

            YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_PanelSetOrder.ReportNo);
            ResultStatus resultStatus = ResultStatusEnum.Final;

            YellowstonePathology.Business.Amendment.Model.AmendmentCollection amendmentCollection = this.m_AccessionOrder.AmendmentCollection.GetAmendmentsForReport(m_PanelSetOrder.ReportNo);
            if (amendmentCollection.Count != 0)
            {
                resultStatus = ResultStatusEnum.Correction;
            }
            WYDOHOBRView obr = new WYDOHOBRView(this.m_AccessionOrder, this.m_PanelSetOrder.ReportNo, this.m_OrderingPhysician);

            obr.ToXml(this.m_Document);

            WYDOHOBXView obx = new WYDOHOBXView(this.m_AccessionOrder, this.m_PanelSetOrder.ReportNo, this.m_ObxCount);

            obx.ToXml(this.m_Document);
            this.m_ObxCount = obx.ObxCount;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            string serverFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_PanelSetOrder.ReportNo + ".Mirth.xml";

            string mirthFileName = mirthFileName = @"\\YPIIInterface1\ChannelData\Outgoing\WYCDC\" + this.m_PanelSetOrder.ReportNo + ".Mirth.xml";

            System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(serverFileName, false, new ASCIIEncoding());
            this.m_Document.Save(streamWriter);
            streamWriter.Close();
            System.IO.File.Copy(serverFileName, mirthFileName, true);

            result.Success = true;
            result.Message = "An HL7 message was created and sent to the interface.";
        }
Esempio n. 26
0
 public override string ToString()
 {
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_ReportNo);
     StringBuilder result = new StringBuilder(this.m_Prefix + this.m_Delimeter);
     result.Append(this.FormattedCassetteColumn + this.m_Delimeter);
     result.Append(this.ReportNo + this.m_Delimeter);
     result.Append(this.BlockTitle + this.m_Delimeter);
     result.Append(this.PatientInitials + this.m_Delimeter);
     result.Append(this.CompanyId + this.m_Delimeter);
     result.Append(this.ScanningId + this.m_Delimeter);
     result.Append(orderIdParser.ReportNoLetter + orderIdParser.ReportNoYear.Value.ToString() + this.m_Delimeter);
     result.Append(orderIdParser.ReportNoNumber.Value.ToString());
     return result.ToString();
 }
Esempio n. 27
0
        public override string GetLine(int printerColorCode)
        {
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_MasterAccessionNo);
            StringBuilder line = new StringBuilder(this.m_Prefix + this.m_Delimeter);

            line.Append(this.m_CassetteColumnDelimiter + printerColorCode.ToString() + this.m_Delimeter);
            line.Append(orderIdParser.MasterAccessionNo + this.m_Delimeter);
            line.Append(this.BlockTitle + this.m_Delimeter);
            line.Append(this.PatientInitials + this.m_Delimeter);
            line.Append(this.CompanyId + this.m_Delimeter);
            line.Append(this.ScanningId + this.m_Delimeter);
            line.Append(orderIdParser.MasterAccessionNoYear.Value.ToString() + this.m_Delimeter);
            line.Append(orderIdParser.MasterAccessionNoNumber.Value.ToString());
            return(line.ToString());
        }
        private void CreatePatientTifFile(string reportNo)
        {
            List <YellowstonePathology.Business.Patient.Model.SVHBillingData> sVHBillingDataList = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPatientImportDataList(reportNo);

            if (sVHBillingDataList.Count != 0)
            {
                YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
                this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, new System.Threading.ThreadStart(delegate()
                {
                    YellowstonePathology.Business.Document.SVHBillingDocument svhBillingDocument = new Business.Document.SVHBillingDocument(sVHBillingDataList[0]);
                    svhBillingDocument.SaveAsTIF(orderIdParser);
                }
                                                                                                                           ));
            }
        }
Esempio n. 29
0
        public override string ToString()
        {
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_ReportNo);
            StringBuilder result = new StringBuilder(this.m_Prefix + this.m_Delimeter);

            result.Append(this.FormattedCassetteColumn + this.m_Delimeter);
            result.Append(this.ReportNo + this.m_Delimeter);
            result.Append(this.BlockTitle + this.m_Delimeter);
            result.Append(this.PatientInitials + this.m_Delimeter);
            result.Append(this.CompanyId + this.m_Delimeter);
            result.Append(this.ScanningId + this.m_Delimeter);
            result.Append(orderIdParser.ReportNoLetter + orderIdParser.ReportNoYear.Value.ToString() + this.m_Delimeter);
            result.Append(orderIdParser.ReportNoNumber.Value.ToString());
            return(result.ToString());
        }
Esempio n. 30
0
        public static string GetPublishedReport(YellowstonePathology.Business.OrderIdParser orderIdParser, bool isDOCX)
        {
            string fileName = string.Empty;

            if (isDOCX == true)
            {
                fileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + orderIdParser.ReportNo + ".docx";
            }
            else
            {
                fileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + orderIdParser.ReportNo + ".doc";
            }

            return(fileName);
        }
Esempio n. 31
0
        private void ButtonPrint_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_MasterAccessionNo);
            YellowstonePathology.Business.Document.SVHBillingDocument svhBillingDocument = new Business.Document.SVHBillingDocument(this.m_SVHBillingData);
            //svhBillingDocument.SaveAsTIF(orderIdParser);

            PrintDialog dialog = new PrintDialog();
            var         doc    = svhBillingDocument.Document.DocumentPaginator;

            for (int i = 0; i < doc.PageCount; i++)
            {
                dialog.PrintVisual(doc.GetPage(i).Visual, "Page " + i);
            }

            MessageBox.Show("Your document has been sent to the printer.");
        }
Esempio n. 32
0
        public void SaveReport()
        {
            switch (this.m_ReportSaveMode)
            {
            case YellowstonePathology.Business.Document.ReportSaveModeEnum.Normal:
                this.m_ReportXml.Save(this.m_SaveFileName);
                YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
                Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, Business.Document.CaseDocumentTypeEnum.CaseReport, Business.Document.CaseDocumentFileTypeEnum.xml, Business.Document.CaseDocumentFileTypeEnum.doc);
                Business.Helper.FileConversionHelper.ConvertDocumentTo(orderIdParser, Business.Document.CaseDocumentTypeEnum.CaseReport, Business.Document.CaseDocumentFileTypeEnum.doc, Business.Document.CaseDocumentFileTypeEnum.xps);
                break;

            case YellowstonePathology.Business.Document.ReportSaveModeEnum.Test:
            case YellowstonePathology.Business.Document.ReportSaveModeEnum.Draft:
                this.m_ReportXml.Save(this.m_SaveFileName);
                break;
            }
        }
Esempio n. 33
0
        public void SaveReport()
        {
            switch (this.m_ReportSaveMode)
            {
            case YellowstonePathology.Business.Document.ReportSaveModeEnum.Normal:
                this.m_ReportXml.Save(this.m_SaveFileName);
                YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
                CaseDocument.SaveXMLAsDoc(orderIdParser);
                CaseDocument.SaveDocAsXPS(orderIdParser);
                break;

            case YellowstonePathology.Business.Document.ReportSaveModeEnum.Test:
            case YellowstonePathology.Business.Document.ReportSaveModeEnum.Draft:
                this.m_ReportXml.Save(this.m_SaveFileName);
                break;
            }
        }
Esempio n. 34
0
        private void WriteDocumentToServer(XElement document)
        {
            string fileExtension = ".HL7.xml";

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            string serverFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_PanelSetOrder.ReportNo + fileExtension;
            string interfaceFileName = @"\\ypiiinterface1\ChannelData\Outgoing\Panther\" + this.m_PanelSetOrder.ReportNo + fileExtension;

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(serverFileName))
            {
                document.Save(sw);
            }

            if (System.IO.File.Exists(interfaceFileName) == false)
            {
                System.IO.File.Copy(serverFileName, interfaceFileName);
            }
        }
Esempio n. 35
0
        public void Send(YellowstonePathology.Business.Rules.MethodResult result)
        {
            this.CreateDocument();
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            string serverFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_PanelSetOrder.ReportNo + ".HL7.xml";
            string mirthFileName = @"\\YPIIInterface1\ChannelData\Outgoing\1003\" + this.m_PanelSetOrder.ReportNo + ".HL7.xml";
            //string mirthFileName = @"\\YPIIInterface1\ChannelData\Outgoing\Testing\" + this.m_ReportNo + ".HL7.xml";

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(serverFileName))
            {
                this.m_Document.Save(sw);
            }

            System.IO.File.Copy(serverFileName, mirthFileName);

            result.Success = true;
            result.Message = "An HL7 message was created and sent to the interface.";
        }
Esempio n. 36
0
        public DistributionResult Distribute(string reportNo)
        {
            DistributionResult distributionResult = new DistributionResult();

            string printDistributionFolderPath = @"\\cfileserver\Documents\Distribution\Print\";
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string caseDocumentFileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameXPS(orderIdParser);

            string fileName = System.IO.Path.GetFileName(caseDocumentFileName);
            string newFileName = System.IO.Path.Combine(printDistributionFolderPath, fileName);

            if (System.IO.File.Exists(newFileName) == false)
            {
                System.IO.File.Copy(caseDocumentFileName, newFileName);
            }

            distributionResult.IsComplete = true;
            return distributionResult;
        }
        public static bool ConvertXpsDocumentToPdf(string reportNo)
        {
            bool result = true;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string inputFileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameXPS(orderIdParser);
            string outputFileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNamePDF(orderIdParser);
            string gxpsFilePath = "C:\\Program Files\\Yellowstone Pathology Institute\\gxps.exe";
            string arguments =  " -sDEVICE=pdfwrite -sOutputFile=" + outputFileName + " -dNOPAUSE " + inputFileName;

            Process process = new Process();
            ProcessStartInfo processStartInfo = new ProcessStartInfo();
            processStartInfo.FileName = gxpsFilePath;
            processStartInfo.Arguments = arguments;

            process.StartInfo = processStartInfo;
            process.Start();
            process.WaitForExit();

            return result;
        }
        public DistributionResult Distribute(string reportNo, Business.Test.AccessionOrder accessionOrder)
        {
            DistributionResult result = new DistributionResult();
            result.IsComplete = true;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string tifDocumentPath = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameTif(orderIdParser);
            string pdfDocumentPath = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNamePDF(orderIdParser);

            System.IO.FileStream fileStream = new System.IO.FileStream(tifDocumentPath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
            System.Windows.Media.Imaging.TiffBitmapDecoder tiffBitmapDecoder = new System.Windows.Media.Imaging.TiffBitmapDecoder(fileStream, System.Windows.Media.Imaging.BitmapCreateOptions.PreservePixelFormat, System.Windows.Media.Imaging.BitmapCacheOption.Default);
            int pageCount = tiffBitmapDecoder.Frames.Count;

            YellowstonePathology.Business.ReportDistribution.Model.MeditechFileDefinition meditechFileDefinition =
                    new Business.ReportDistribution.Model.MeditechFileDefinition(pageCount, accessionOrder.SvhAccount, accessionOrder.SvhMedicalRecord, accessionOrder.MasterAccessionNo,
                        reportNo, accessionOrder.PBirthdate.Value, accessionOrder.PSex, accessionOrder.AccessionDate.Value);

            string fileName = meditechFileDefinition.GetFileName() + ".pdf";
            string saveToFileName = System.IO.Path.Combine(ProductionFolderPath, fileName);
            System.IO.File.Copy(pdfDocumentPath, saveToFileName, true);

            return result;
        }
Esempio n. 39
0
        public override string ToLaserString()
        {
            //C:\Program Files\General Data Company\Cassette Printing\Normal.itl|102|15-28044|1A|JA|YPII|ALQ15-28044.1A|15|28044
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_MasterAccessionNo);
            StringBuilder result = new StringBuilder(TemplateFileName + this.m_LaserDelimeter);

            int cassetteCollumn = 103;
            switch (CassetteColumn)
            {
                case 6:
                    cassetteCollumn = 105;
                    break;
                case 5:
                    cassetteCollumn = 111;
                    break;
                case 4:
                    cassetteCollumn = 104;
                    break;
                case 3:
                    cassetteCollumn = 111;
                    break;
                default:
                    cassetteCollumn = 105;
                    break;
            }

            result.Append(cassetteCollumn.ToString() + this.m_LaserDelimeter);
            result.Append(orderIdParser.MasterAccessionNo + this.m_LaserDelimeter);
            result.Append(this.BlockTitle + this.m_LaserDelimeter);
            result.Append(this.PatientInitials + this.m_LaserDelimeter);
            result.Append(this.CompanyId + this.m_LaserDelimeter);
            result.Append(this.ScanningId + this.m_LaserDelimeter);
            result.Append(orderIdParser.MasterAccessionNoYear.Value.ToString() + this.m_LaserDelimeter);
            result.Append(orderIdParser.MasterAccessionNoNumber.Value.ToString());
            return result.ToString();
        }
Esempio n. 40
0
        public string ToLaserString()
        {
            //C:\Program Files\General Data Company\Cassette Printing\Normal.itl|102|15-28044|1A|JA|YPII|ALQ15-28044.1A|15|28044
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_MasterAccessionNo);
            StringBuilder result = new StringBuilder(TemplateFileName + this.m_LaserDelimeter);

            result.Append(this.m_CassetteColumn.ToString() + this.m_LaserDelimeter);
            result.Append(orderIdParser.MasterAccessionNo + this.m_LaserDelimeter);
            result.Append(this.BlockTitle + this.m_LaserDelimeter);
            result.Append(this.PatientInitials + this.m_LaserDelimeter);

            if(this.m_ClientAccessioned == true)
            {
                result.Append(this.m_ClientAccessionNo + this.m_LaserDelimeter);
            }
            else
            {
                if(string.IsNullOrEmpty(this.m_EmbeddingInstructions) == false)
                {
                    result.Append(this.m_EmbeddingInstructions + this.m_LaserDelimeter);
                }
                else
                {
                    result.Append(this.m_CompanyId + this.m_LaserDelimeter);
                }
            }

            result.Append(this.ScanningId + this.m_LaserDelimeter);
            result.Append(orderIdParser.MasterAccessionNoYear.Value.ToString() + this.m_LaserDelimeter);
            result.Append(orderIdParser.MasterAccessionNoNumber.Value.ToString());
            return result.ToString();
        }
        private void PublishNext()
        {
            List<YellowstonePathology.Business.Test.PanelSetOrderView> caseList = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetNextCasesToPublish();

            int maxProcessCount = 2;
            if (caseList.Count >= 10) maxProcessCount = 10;

            int processCount = 0;

            foreach (YellowstonePathology.Business.Test.PanelSetOrderView view in caseList)
            {
                YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(view.MasterAccessionNo, this);
                YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(view.ReportNo);

                YellowstonePathology.Business.PanelSet.Model.PanelSetCollection panelSetCollection = YellowstonePathology.Business.PanelSet.Model.PanelSetCollection.GetAll();
                YellowstonePathology.Business.PanelSet.Model.PanelSet panelSet = panelSetCollection.GetPanelSet(panelSetOrder.PanelSetId);

                YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(accessionOrder, panelSetOrder, Business.Document.ReportSaveModeEnum.Normal);
                YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(panelSetOrder.ReportNo);

                if (panelSetOrder.HoldDistribution == false)
                {
                    if (this.TryDelete(panelSetOrder, caseDocument, orderIdParser) == true)
                    {
                        if (this.TryPublish(caseDocument, accessionOrder, panelSetOrder) == true)
                        {
                            if (panelSetOrder.Distribute == true)
                            {
                                foreach (YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistribution testOrderReportDistribution in panelSetOrder.TestOrderReportDistributionCollection)
                                {
                                    if (testOrderReportDistribution.Distributed == false)
                                    {
                                        YellowstonePathology.Business.ReportDistribution.Model.DistributionResult distributionResult = this.Distribute(testOrderReportDistribution, accessionOrder, panelSetOrder);
                                        if (distributionResult.IsComplete == true)
                                        {
                                            testOrderReportDistribution.TimeOfLastDistribution = DateTime.Now;
                                            testOrderReportDistribution.ScheduledDistributionTime = null;
                                            testOrderReportDistribution.Distributed = true;

                                            string testOrderReportDistributionLogId = Guid.NewGuid().ToString();
                                            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                                            YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionLog testOrderReportDistributionLog = new YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionLog(testOrderReportDistributionLogId, objectId);
                                            testOrderReportDistributionLog.FromTestOrderReportDistribution(testOrderReportDistribution);
                                            testOrderReportDistributionLog.TimeDistributed = DateTime.Now;
                                            panelSetOrder.TestOrderReportDistributionLogCollection.Add(testOrderReportDistributionLog);

                                            this.m_ReportDistributionLogEntryCollection.AddEntry("INFO", "Publish Next", testOrderReportDistribution.DistributionType, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                testOrderReportDistribution.PhysicianName, testOrderReportDistribution.ClientName, "TestOrderReportDistribution Distributed");
                                        }
                                        else
                                        {
                                            testOrderReportDistribution.ScheduledDistributionTime = DateTime.Now.AddMinutes(30);
                                            testOrderReportDistribution.Rescheduled = true;
                                            testOrderReportDistribution.RescheduledMessage = distributionResult.Message;

                                            this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", testOrderReportDistribution.DistributionType, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                testOrderReportDistribution.PhysicianName, testOrderReportDistribution.ClientName, distributionResult.Message);

                                            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, distributionResult.Message);
                                            System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

                                            Uri uri = new Uri("http://tempuri.org/");
                                            System.Net.ICredentials credentials = System.Net.CredentialCache.DefaultCredentials;
                                            System.Net.NetworkCredential credential = credentials.GetCredential(uri, "Basic");

                                            client.Credentials = credential;
                                            client.Send(message);
                                        }
                                    }
                                }
                            }

                            this.HandleNotificationEmail(panelSetOrder);

                            panelSetOrder.Published = true;
                            panelSetOrder.TimeLastPublished = DateTime.Now;
                            panelSetOrder.ScheduledPublishTime = null;

                            Business.Persistence.DocumentGateway.Instance.Save();
                        }
                    }

                    processCount += 1;
                    if (processCount == maxProcessCount) break;
                }
            }

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this);
        }
Esempio n. 42
0
 private void CheckPatientTifFiles()
 {
     YellowstonePathology.Business.ReportNoCollection reportNoCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetReportNumbersByPostDate(this.m_PostDate.Value);
     foreach (YellowstonePathology.Business.ReportNo reportNo in reportNoCollection)
     {
         YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo.Value);
         string patientTifFilePath = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNamePatientTif(orderIdParser);
         string patientTifFileName = System.IO.Path.GetFileName(patientTifFilePath);
         string workingFolderPath = System.IO.Path.Combine(this.m_BaseWorkingFolderPath, this.m_PostDate.Value.ToString("MMddyyyy"));
         if (System.IO.File.Exists(patientTifFilePath) == true)
         {
             string psaFileName = workingFolderPath + @"\" + orderIdParser.MasterAccessionNo + ".Patient.tif";
             if(System.IO.File.Exists(psaFileName) == false)
             {
                 MessageBox.Show(psaFileName);
             }
         }
     }
 }
Esempio n. 43
0
        private void RenameReqFiles(string reportNo, string reportNoLetter, int startFileNumber)
        {
            int fileCount = startFileNumber;
            string wrongName = "." + reportNoLetter + ".REQ." + fileCount.ToString() + ".TIF";
            string correctName = ".REQ." + fileCount.ToString() + ".TIF";
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string wrongFile = System.IO.Path.Combine(YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser), orderIdParser.MasterAccessionNo + wrongName);
            string correctFile = System.IO.Path.Combine(YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser), orderIdParser.MasterAccessionNo + correctName);

            if (System.IO.File.Exists(wrongFile) == true)
            {
                if (System.IO.File.Exists(correctFile) == false)
                {
                    System.IO.File.Move(wrongFile, correctFile);
                }
                else
                {
                    fileCount += 1;
                    this.RenameReqFiles(reportNo, reportNoLetter, fileCount);
                }
            }
        }
Esempio n. 44
0
        public void FromAliquotOrder(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AliquotOrder = aliquotOrder;
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(accessionOrder.MasterAccessionNo);

            YellowstonePathology.Business.PatientName patientName = new PatientName(accessionOrder.PLastName, accessionOrder.PFirstName);
            this.m_MasterAccessionNo = orderIdParser.MasterAccessionNo;
            this.m_AliquotOrder = aliquotOrder;
            this.m_BlockTitle = aliquotOrder.PrintLabel;
            this.m_Verified = aliquotOrder.GrossVerified;
            this.m_PatientInitials = patientName.GetInitials();
            this.m_EmbeddingInstructions = aliquotOrder.EmbeddingInstructions;

            if(accessionOrder.ClientAccessioned == true)
            {
                this.m_ClientAccessionNo = accessionOrder.ClientAccessionNo;
                this.m_ClientAccessioned = true;
            }
            else
            {
                this.m_ClientAccessionNo = null;
                this.m_ClientAccessioned = false;
            }

            if(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.UseLaserCassettePrinter == false)
            {
                this.m_CassetteColumn = accessionOrder.PrintMateColumnNumber.ToString();
            }
            else
            {
                YellowstonePathology.Business.Common.PrintMateCarousel printMateCarousel = new Common.PrintMateCarousel();
                YellowstonePathology.Business.Common.PrintMateColumn printMateColumn = printMateCarousel.GetColumn(accessionOrder.PrintMateColumnNumber);
                this.m_CassetteColumn = printMateColumn.GeneralDataColor.ToString();
            }
        }
Esempio n. 45
0
 public PrintCaseReport(string reportNo)
 {
     this.m_ReportNo = reportNo;
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_ReportNo);
     this.m_FileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);
 }
Esempio n. 46
0
 private void CreatePatientTifFile(string reportNo)
 {
     List<YellowstonePathology.Business.Patient.Model.SVHBillingData> sVHBillingDataList = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPatientImportDataList(reportNo);
     if (sVHBillingDataList.Count != 0)
     {
         YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
         this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, new System.Threading.ThreadStart(delegate()
         {
             YellowstonePathology.Business.Document.SVHBillingDocument svhBillingDocument = new Business.Document.SVHBillingDocument(sVHBillingDataList[0]);
             svhBillingDocument.SaveAsTIF(orderIdParser);
         }
         ));
     }
 }
Esempio n. 47
0
 public virtual void Publish()
 {
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
     YellowstonePathology.Business.Document.CaseDocument.SaveXMLAsPDF(orderIdParser);
     YellowstonePathology.Business.Helper.FileConversionHelper.SaveXpsReportToTiff(this.m_PanelSetOrder.ReportNo);
 }
Esempio n. 48
0
 public void OpenTemplate()
 {
     this.m_ReportXml.Load(this.m_TemplateName);
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
     switch (this.m_ReportSaveMode)
     {
         case YellowstonePathology.Business.Document.ReportSaveModeEnum.Draft:
             this.m_SaveFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + this.m_PanelSetOrder.ReportNo + ".draft.xml";
             break;
         case YellowstonePathology.Business.Document.ReportSaveModeEnum.Normal:
             this.m_SaveFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + this.m_PanelSetOrder.ReportNo + ".xml";
             break;
         case YellowstonePathology.Business.Document.ReportSaveModeEnum.Test:
             this.m_SaveFileName = @"c:\test.xml";
             break;
     }
 }
 private void GetReportNo()
 {
     if (this.m_IsValid)
     {
         YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_SourceValue);
         if (orderIdParser.ReportNo != null)
         {
             this.m_IsValid = true;
             this.m_ReportNo = this.m_SourceValue;
             this.m_IsReportNo = true;
         }
         else if (orderIdParser.MasterAccessionNo != null)
         {
             this.m_IsValid = true;
             this.m_ReportNo = orderIdParser.SurgicalReportNoFromMasterAccessionNo;
             this.m_IsReportNo = true;
         }
         else if (this.m_SourceValue.Length > 0 && this.CheckDigits(0))
         {
             this.m_IsValid = true;
             this.m_ReportNo = YellowstonePathology.Business.OrderIdParser.SurgicalReportNoFromNumber(this.m_SourceValue);
             this.m_IsReportNo = true;
         }
     }
 }
Esempio n. 50
0
 public PrintCaseReport(long reportDistributionlogId)
 {
     this.m_ReportDistributionLogId = reportDistributionlogId;
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_ReportNo);
     this.m_FileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);
 }
        public static void SaveXpsAsMultiPageTif(string reportNo, object visual)
        {
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string outputFileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameTif(orderIdParser);
            FrameworkElement frameworkElement = (FrameworkElement)visual;

            RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap((int)frameworkElement.ActualWidth,
                                      (int)frameworkElement.ActualHeight, 96d, 96d, PixelFormats.Default);
            renderTargetBitmap.Render(frameworkElement);

            TiffBitmapEncoder tiffBitmapEncoder = new TiffBitmapEncoder();
            tiffBitmapEncoder.Frames.Add(BitmapFrame.Create(renderTargetBitmap));

            using (Stream stream = File.Create(outputFileName))
            {
                tiffBitmapEncoder.Save(stream);
            }
        }
Esempio n. 52
0
 public static string getCasePath(string reportNo)
 {
     YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
     return YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);
 }
        public static void SaveXpsReportToTiff(string reportNo)
        {
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string inputFileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameXPS(orderIdParser);
            string outputFileName = YellowstonePathology.Business.Document.CaseDocument.GetCaseFileNameTif(orderIdParser);

            if (File.Exists(inputFileName) == true)
            {
                XpsDocument xpsDoc = new XpsDocument(inputFileName, System.IO.FileAccess.Read);
                FixedDocumentSequence docSeq = xpsDoc.GetFixedDocumentSequence();
                int pages = docSeq.DocumentPaginator.PageCount;

                TiffBitmapEncoder encoder = new TiffBitmapEncoder();
                encoder.Compression = TiffCompressOption.Default;
                encoder.Compression = TiffCompressOption.Ccitt4;

                for (int pageNum = 0; pageNum < pages; pageNum++)
                {
                    DocumentPage docPage = docSeq.DocumentPaginator.GetPage(pageNum);
                    RenderTargetBitmap renderTarget =
                        new RenderTargetBitmap((int)(docPage.Size.Width * 300 / 96),
                                                (int)(docPage.Size.Height * 300 / 96),
                                                300d,
                                                300d,
                                                System.Windows.Media.PixelFormats.Default);

                    renderTarget.Render(docPage.Visual);
                    encoder.Frames.Add(BitmapFrame.Create(renderTarget));
                }

                FileStream pageOutStream = new FileStream(outputFileName, FileMode.Create, FileAccess.Write);
                encoder.Save(pageOutStream);
                pageOutStream.Close();

                xpsDoc.Close();
            }
        }
Esempio n. 54
0
 public void SaveReport()
 {
     switch (this.m_ReportSaveMode)
     {
         case YellowstonePathology.Business.Document.ReportSaveModeEnum.Draft:
             this.m_ReportXml.Save(this.m_SaveFileName);
             break;
         case YellowstonePathology.Business.Document.ReportSaveModeEnum.Normal:
             this.m_ReportXml.Save(this.m_SaveFileName);
             YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
             CaseDocument.SaveXMLAsDoc(orderIdParser);
             CaseDocument.SaveDocAsXPS(orderIdParser);
             break;
         case YellowstonePathology.Business.Document.ReportSaveModeEnum.Test:
             this.m_ReportXml.Save(@"c:\Testing\Test.xml");
             break;
     }
 }
Esempio n. 55
0
        private void CreateXmlBillingDocument(YellowstonePathology.Business.Test.AccessionOrder accessionOrder, string reportNo)
        {
            YellowstonePathology.Business.Billing.Model.PSABillingDocument psaBillingDocument = new YellowstonePathology.Business.Billing.Model.PSABillingDocument(accessionOrder, reportNo);
            psaBillingDocument.Build();

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(reportNo);
            string filePath = System.IO.Path.Combine(YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser), reportNo + ".BillingDetails.xml");
            psaBillingDocument.Save(filePath);
        }
Esempio n. 56
0
        public void Send(YellowstonePathology.Business.Rules.MethodResult result)
        {
            this.m_Document = new XElement("HL7Message");
            this.m_ObxCount = 1;

            MTDoh client = new MTDoh();
            OruR01 messageType = new OruR01();

            MTDohMshView msh = new MTDohMshView(client, messageType);
            msh.ToXml(this.m_Document);

            MTDohPidView pid = new MTDohPidView(this.m_AccessionOrder.PatientId, this.m_AccessionOrder.PLastName, this.m_AccessionOrder.PFirstName, this.m_AccessionOrder.PBirthdate,
                this.m_AccessionOrder.PSex, this.m_AccessionOrder.SvhAccount, this.m_AccessionOrder.PSSN, this.m_AccessionOrder.PAddress1, this.m_AccessionOrder.PAddress2,
                this.m_AccessionOrder.PCity, this.m_AccessionOrder.PState, this.m_AccessionOrder.PZipCode);
            pid.ToXml(this.m_Document);

            MTDohOrcView orc = new MTDohOrcView(this.m_AccessionOrder.ExternalOrderId, this.m_OrderingPhysician, this.m_PanelSetOrder.ReportNo, OrderStatusEnum.Complete, this.m_AccessionOrder.SystemInitiatingOrder);
            orc.ToXml(this.m_Document);

            YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_PanelSetOrder.ReportNo);
            ResultStatus resultStatus = ResultStatusEnum.Final;
            if (panelSetOrder.AmendmentCollection.Count != 0) resultStatus = ResultStatusEnum.Correction;
            MTDohObrView obr = new MTDohObrView(this.m_AccessionOrder, this.m_PanelSetOrder.ReportNo, this.m_OrderingPhysician);
            obr.ToXml(this.m_Document);

            MTDohObxView obx = new MTDohObxView(this.m_AccessionOrder, this.m_PanelSetOrder.ReportNo, this.m_ObxCount);
            obx.ToXml(this.m_Document);
            this.m_ObxCount = obx.ObxCount;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelSetOrder.ReportNo);
            string serverFileName = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser) + "\\" + this.m_PanelSetOrder.ReportNo + ".Mirth.xml";

            string mirthFileName = mirthFileName = @"\\YPIIInterface1\ChannelData\Outgoing\1004\" + this.m_PanelSetOrder.ReportNo + ".Mirth.xml";

            System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(serverFileName, false, new ASCIIEncoding());
            this.m_Document.Save(streamWriter);
            streamWriter.Close();
            System.IO.File.Copy(serverFileName, mirthFileName, true);

            result.Success = true;
            result.Message = "An HL7 message was created and sent to the interface.";
        }
        private void IsModulusNotZero()
        {
            int reportNoInt;
            int modValue = 12;

            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(this.m_PanelOrderToFinal.ReportNo);
            if (orderIdParser.IsLegacyReportNo == true)
            {
                reportNoInt = orderIdParser.ReportNoNumber.Value;
            }
            else
            {
                reportNoInt = orderIdParser.MasterAccessionNoNumber.Value;
                modValue = 11;
            }

            if (reportNoInt % modValue != 0)
            {
                this.m_ExecutionStatus.AddMessage("Not Qualified", true);
            }
        }