Ejemplo n.º 1
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.";
        }
Ejemplo n.º 2
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);

            WYDOHORCView orc = new WYDOHORCView(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;
            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.";
        }