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); }
public static T getShieldsAppObject <T>(ObjectType type, HL7Message message, List <MessageGroupInstance> messageGroupInstances, List <MessageGroup> messageGroups, List <WebservicePropertySet> wsPropertySet) { Object shieldsAppObject = new 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.Report report = new WSShieldsApps.Report(); WSShieldsApps.Doctor referring = new WSShieldsApps.Doctor(); WSShieldsApps.Doctor radiologist = new WSShieldsApps.Doctor(); // for each property, get the hl7 position - then get the value for it wsPropertySet.ForEach(delegate(WebservicePropertySet wsProperty) { // cleaner way to get the value that ca be used by all methods here string hl7Value = ShieldsExpressLinkUtility.getHL7ValueSEL(message, messageGroupInstances, messageGroups, wsProperty); switch (type) { case ObjectType.Location: location = getLocation(wsProperty, hl7Value, location); shieldsAppObject = location; break; case ObjectType.Patient: patient = getPatient(wsProperty, hl7Value, patient); shieldsAppObject = patient; break; case ObjectType.Organization: organization = getOrganization(wsProperty, hl7Value, organization); shieldsAppObject = organization; break; case ObjectType.Exam: exam = getExam(wsProperty, hl7Value, exam); shieldsAppObject = exam; break; case ObjectType.Report: report = getReport(wsProperty, message, hl7Value, report); report.ReportText = getReportText(message, true); shieldsAppObject = report; break; case ObjectType.Referring: referring = getReferringDoctor(wsProperty, hl7Value, referring); shieldsAppObject = referring; break; case ObjectType.Radiologist: radiologist = getReadingDoctor(wsProperty, hl7Value, radiologist); shieldsAppObject = radiologist; break; default: break; } }); return((T)shieldsAppObject); }
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); }
private static WSShieldsApps.Patient getPatient(WebservicePropertySet wsProperty, string hl7Value, WSShieldsApps.Patient patient) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_PATIENT_FIRST_NAME: patient.FirstName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_PATIENT_LAST_NAME: patient.LastName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_PATIENT_MIDDLE_NAME: patient.MiddleName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_PATIENT_MEDICAL_RECORD_NO: patient.MedicalRecordNo = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_PATIENT_DATE_OF_BIRTH: patient.DateOfBirth = hl7DateToRealDate(hl7Value); break; default: break; } return(patient); }