Beispiel #1
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;

            YellowstonePathology.Business.Amendment.Model.AmendmentCollection amendmentCollection = this.m_AccessionOrder.AmendmentCollection.GetAmendmentsForReport(panelSetOrder.ReportNo);
            if (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.";
        }
Beispiel #2
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.";
        }