Example #1
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);
        }
Example #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);
        }
Example #3
0
        public static void TestConfigLoad()
        {
            Configuration masterConfig = ConfigurationDAO.GetAllConfigurations();

            List <Application>           applications         = masterConfig.applications;
            List <Communication>         communications       = masterConfig.communications;
            List <WebserviceObject>      webserviceObjects    = masterConfig.webserviceObjects;
            List <WebserviceInstance>    webserviceInstances  = masterConfig.webserviceInstances;
            List <WebservicePropertySet> webserviceProperties = masterConfig.webservicePropertySets;
            List <MessageGroup>          messageGroups        = masterConfig.messageGroups;

            applications.ForEach(delegate(Application app)
            {
                if (app.name != RSERVER)
                {
                    return;
                }

                // get the unprocessed message count for the application
                List <MessageBucket> brokerInformation
                    = MessageBucketDAO.GetUnprocessedMessageHeaderInstancesByApplication(app);

                brokerInformation.ForEach(delegate(MessageBucket broker)
                {
                    // get the message header and message
                    MessageHeaderInstance messageHeaderInstance = broker.messageHeaderInstance;
                    Message message = broker.message;

                    // locally retrieve the communication object from memory
                    Communication communication
                        = ConfigurationUtility.GetIncomingWebserviceCommunication(app, communications);
                    // locally retrieve the webservice instance object from memory
                    WebserviceInstance webserviceInstance
                        = ConfigurationUtility.GetIncomingWebserviceInstance(communication, webserviceInstances);
                    // locally retrieve the web service objects from memory
                    List <WebserviceObject> wsObjects
                        = ConfigurationUtility.GetIncomingWebserviceObjects(webserviceInstance, webserviceObjects);

                    // for each object - for each property set for that object - handle accordingly
                    wsObjects.ForEach(delegate(WebserviceObject wsObject)
                    {
                        Console.WriteLine("OBJECT:" + wsObject.name);

                        List <WebservicePropertySet> wsProperties
                            = ConfigurationUtility.GetIncomingWebservicePropertySets(wsObject, webserviceProperties);

                        wsProperties.ForEach(delegate(WebservicePropertySet wsProperty)
                        {
                            Console.WriteLine("Property:" + wsProperty.name);

                            List <MessageGroup> msGroups
                                = ConfigurationUtility.GetIncomingWebserviceMessageGroup(wsProperty, messageGroups);

                            Console.WriteLine("Group Count:" + msGroups.Count);
                        });
                    });
                    // update the table to processed
                    // BrokerDAO.UpdateProcessedFlagAndMessageLog(messageHeaderInstance, message, true);
                });
            });
        }