Esempio n. 1
0
        public static void handleAckForService(HL7Message hl7Message, Message message, string ackResponseMessage)
        {
            // get the message control id to build the ack
            string messageControlId = HL7MessageUtility.getValueByPosition(hl7Message,
                                                                           SegmentType.MSH,
                                                                           MESSAGE_HEADER_CONTROL_ID);
            // get the message date stamp
            string messageDateStamp = HL7MessageUtility.getValueByPosition(hl7Message,
                                                                           SegmentType.MSH,
                                                                           MESSAGE_DATE_STAMP_POSITION);

            // get the correct ack response
            bool isRejected = ShieldsExpressLinkUtility.handleCheckApplicationRejected(ackResponseMessage);

            // if the ack message is rejected, apply act type
            AcknowledgementDAO.AcknowledgementType ackMessageEnum
                = (isRejected) ? AcknowledgementDAO.AcknowledgementType.AR:
                  AcknowledgementDAO.AcknowledgementType.AA;

            // get ack response
            string strAckResponse = HL7MessageUtility.getAck(ackMessageEnum.ToString(),
                                                             messageControlId,
                                                             messageDateStamp,
                                                             MESSAGE_HEADER_APPLICATION_NAME,
                                                             MESSAGE_HEADER_FACILITY_NAME,
                                                             ackResponseMessage);

            // build ack response
            Acknowledgement ackResponse = new Acknowledgement()
            {
                acknowledgementTypeId = (int)ackMessageEnum,
                messageId             = message.id,
                raw         = strAckResponse,
                createdDttm = DateTime.Now
            };

            // insert into ack
            AcknowledgementDAO.insertIntoAcknowledgement(ackResponse);
        }
Esempio n. 2
0
        public static void handleProcessingForORU(List <WebserviceObject> wsObjects,
                                                  List <WebservicePropertySet> webserviceProperties,
                                                  HL7Message hl7Message,
                                                  List <MessageGroupInstance> messageGroupInstances,
                                                  List <MessageGroup> messageGroups,
                                                  Application app,
                                                  Message message)
        {
            string serviceMessage = BLANK;

            // make SEL exam object
            WSShieldsApps.Exam exam
                = new WSShieldsApps.Exam();
            WSShieldsApps.Location location
                = new WSShieldsApps.Location();
            WSShieldsApps.Patient patient
                = new WSShieldsApps.Patient();
            WSShieldsApps.Organization organization
                = new WSShieldsApps.Organization();
            WSShieldsApps.Doctor referring
                = new WSShieldsApps.Doctor();
            // make SEL report object
            WSShieldsApps.Report report
                = new WSShieldsApps.Report();
            WSShieldsApps.Doctor radiologist
                = new WSShieldsApps.Doctor();

            // for each object - for each property set for that object - handle accordingly
            wsObjects.ForEach(delegate(WebserviceObject wsObject)
            {
                List <WebservicePropertySet> wsProperties
                    = ConfigurationUtility.GetIncomingWebservicePropertySets(wsObject, webserviceProperties);

                if (app.name == RSERVER)
                {
                    if (ShieldsExpressLinkDAO.LOCATION == wsObject.name)
                    {
                        location = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Location>(
                            ShieldsExpressLinkUtility.ObjectType.Location,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.PATIENT == wsObject.name)
                    {
                        patient = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Patient>(
                            ShieldsExpressLinkUtility.ObjectType.Patient,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.ORGANIZATION == wsObject.name)
                    {
                        organization = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Organization>(
                            ShieldsExpressLinkUtility.ObjectType.Organization,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.EXAM == wsObject.name)
                    {
                        exam = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Exam>(
                            ShieldsExpressLinkUtility.ObjectType.Exam,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.REFERRING == wsObject.name)
                    {
                        referring = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Doctor>(
                            ShieldsExpressLinkUtility.ObjectType.Referring,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.REPORT == wsObject.name)
                    {
                        report = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Report>(
                            ShieldsExpressLinkUtility.ObjectType.Report,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.RADIOLOGIST == wsObject.name)
                    {
                        radiologist = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Doctor>(
                            ShieldsExpressLinkUtility.ObjectType.Radiologist,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                        // set as radiologist
                        radiologist.Type         = RADIOLOGIST_TYPE;
                        radiologist.EnterpriseId = ENTERPRISE_IDENTITY;
                    }
                }
            });

            // set exam object
            exam.Location     = location;
            exam.Doctor       = referring;
            exam.Organization = organization;
            exam.Patient      = patient;

            // make a new exam object
            WSShieldsApps.Exam exam2Object = new WSShieldsApps.Exam();

            // pass the accession so we don't override
            exam2Object.AccessionNo = exam.AccessionNo;

            // get the updated exam id only
            exam.ExamId = ShieldsExpressLinkDAO.GetExamByAccessionNo(exam2Object).ExamId;

            // handle radiologist
            serviceMessage += ShieldsExpressLinkDAO.PutDoctor(radiologist);

            // handle exam
            serviceMessage += ShieldsExpressLinkDAO.PutExam(exam);

            // report needs exam id associated to it
            report.ExamId = exam.ExamId;

            // report needs radiologist id associated to it
            report.RadiologistId = radiologist.DoctorId;

            // handle orignal report
            serviceMessage += ShieldsExpressLinkDAO.PostReport(report);

            // handle addendum text only
            if (ShieldsExpressLinkUtility.isReportAddendum(hl7Message))
            {
                // for each report text starting at "2" (1 == orignal report) get all addendums after
                for (int reportIteration = 2, n = ShieldsExpressLinkUtility.getNumberOfReportEntries(hl7Message);
                     reportIteration <= n;
                     reportIteration++)
                {
                    // set the addendum flag
                    report.IsAddendum = true;

                    // re-define report text and observation date
                    report.ReportText = ShieldsExpressLinkUtility.getAddendumReportText(hl7Message, report, reportIteration);

                    // handle inserting of addendum report
                    serviceMessage += ShieldsExpressLinkDAO.PostReport(report, reportIteration);
                }
            }

            // message for the service
            handleAckForService(hl7Message, message, serviceMessage);

            // message log handler
            handleMessageLog(message);
        }
Esempio n. 3
0
        public static void handleProcessingForORM(List <WebserviceObject> wsObjects,
                                                  List <WebservicePropertySet> webserviceProperties,
                                                  HL7Message hl7Message,
                                                  List <MessageGroupInstance> messageGroupInstances,
                                                  List <MessageGroup> messageGroups,
                                                  Application app,
                                                  Message message)
        {
            string serviceMessage = BLANK;

            // make SEL exam object
            WSShieldsApps.Exam exam
                = new WSShieldsApps.Exam();
            WSShieldsApps.Location location
                = new WSShieldsApps.Location();
            WSShieldsApps.Patient patient
                = new WSShieldsApps.Patient();
            WSShieldsApps.Organization organization
                = new WSShieldsApps.Organization();
            WSShieldsApps.Doctor referring
                = new WSShieldsApps.Doctor();

            // for each object - for each property set for that object - handle accordingly
            wsObjects.ForEach(delegate(WebserviceObject wsObject)
            {
                List <WebservicePropertySet> wsProperties
                    = ConfigurationUtility.GetIncomingWebservicePropertySets(wsObject, webserviceProperties);

                if (app.name == RSERVER)
                {
                    if (ShieldsExpressLinkDAO.LOCATION == wsObject.name)
                    {
                        location = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Location>(
                            ShieldsExpressLinkUtility.ObjectType.Location,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.PATIENT == wsObject.name)
                    {
                        patient = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Patient>(
                            ShieldsExpressLinkUtility.ObjectType.Patient,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.ORGANIZATION == wsObject.name)
                    {
                        organization = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Organization>(
                            ShieldsExpressLinkUtility.ObjectType.Organization,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.EXAM == wsObject.name)
                    {
                        exam = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Exam>(
                            ShieldsExpressLinkUtility.ObjectType.Exam,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                    else if (ShieldsExpressLinkDAO.REFERRING == wsObject.name)
                    {
                        referring = ShieldsExpressLinkUtility.getShieldsAppObject <WSShieldsApps.Doctor>(
                            ShieldsExpressLinkUtility.ObjectType.Referring,
                            hl7Message, messageGroupInstances,
                            messageGroups,
                            wsProperties);
                    }
                }
            });

            // exam object
            exam.Location     = location;
            exam.Doctor       = referring;
            exam.Organization = organization;
            exam.Patient      = patient;

            // insert exam
            serviceMessage += ShieldsExpressLinkDAO.PutExam(exam);

            // message for the service
            handleAckForService(hl7Message, message, serviceMessage);

            // message log handler
            handleMessageLog(message);
        }