Пример #1
0
        private void PublishDocument(string fileName)
        {
            XElement document = new XElement("HL7Message");

            this.m_ObxCount = 1;

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

            string locationCode = "YPIIBILLINGS";

            if (this.m_ClientOrder.SvhMedicalRecord.StartsWith("A") == true)
            {
                locationCode = "SVHNPATH";
            }

            EPICMshView msh = new EPICMshView(client, messageType, locationCode);

            msh.ToXml(document);

            PidView pid = new PidView(this.m_ClientOrder.SvhMedicalRecord, this.m_ClientOrder.PLastName, this.m_ClientOrder.PFirstName, this.m_ClientOrder.PBirthdate,
                                      this.m_ClientOrder.PSex, this.m_ClientOrder.SvhAccountNo, this.m_ClientOrder.PSSN);

            pid.ToXml(document);

            EPICStatusOrcView orc = new EPICStatusOrcView(this.m_ClientOrder.ExternalOrderId, this.m_OrderingPhysician, this.m_OrderStatus);

            orc.ToXml(document);

            EPICStatusObrView obr = new EPICStatusObrView(this.m_ClientOrder.ExternalOrderId, string.Empty, this.m_DateOfService, null, this.m_OrderingPhysician, this.m_ResultStatus, this.m_UniversalService);

            obr.ToXml(document);

            EPICStatusObxView obx = new EPICStatusObxView(m_ObxCount, this.m_ResultStatus, this.m_ResultMessage);

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

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(fileName))
            {
                document.Save(sw);
            }
        }
Пример #2
0
        public YellowstonePathology.Business.Rules.MethodResult Send()
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Rules.MethodResult();
            if (result.Success == true)
            {
                this.m_Document = new XElement("HL7Message");
                this.m_ObxCount = 1;

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

                string locationCode = "YPIIBILLINGS";
                if (this.m_ClientOrder.SvhMedicalRecord.StartsWith("A") == true)
                {
                    locationCode = "SVHNPATH";
                }

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

                PidView pid = new PidView(this.m_ClientOrder.SvhMedicalRecord, this.m_ClientOrder.PLastName, this.m_ClientOrder.PFirstName, this.m_ClientOrder.PBirthdate,
                    this.m_ClientOrder.PSex, this.m_ClientOrder.SvhAccountNo, this.m_ClientOrder.PSSN);
                pid.ToXml(this.m_Document);

                EPICStatusOrcView orc = new EPICStatusOrcView(this.m_ClientOrder.ExternalOrderId, this.m_OrderingPhysician, this.m_OrderStatus);
                orc.ToXml(this.m_Document);

                EPICStatusObrView obr = new EPICStatusObrView(this.m_ClientOrder.ExternalOrderId, string.Empty, this.m_ClientOrder.OrderTime, null, this.m_OrderingPhysician, ResultStatusEnum.InProcess.Value, this.m_UniversalService);
                obr.ToXml(this.m_Document);

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

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

                System.IO.File.Copy(this.m_ServerFileName, this.m_InterfaceFilename);
            }
            return result;
        }