private static List <WebservicePropertySet> getSingleWebservicePropertySet(WebservicePropertySet WebservicePropertySet) { List <WebservicePropertySet> webservicePropertySets = new List <WebservicePropertySet>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_WEBSERVICE_PROPERTY_SET; command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_ID, WebservicePropertySet.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { webservicePropertySets.Add(new WebservicePropertySet(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleWebservicePropertySet(WebservicePropertySet WebservicePropertySet)", WebservicePropertySet.id.ToString()); } } return(webservicePropertySets); }
private static bool deleteWebservicePropertySet(WebservicePropertySet WebservicePropertySet) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.DELETE_WEBSERVICE_PROPERTY_SET; command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_ID, WebservicePropertySet.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { WebservicePropertySet.id = DAOUtility.GetData <int>(reader, WebservicePropertySetDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "DeleteWebservicePropertySet()", WebservicePropertySet.name); } } return(true); }
private static WSShieldsApps.Doctor getReadingDoctor(WebservicePropertySet wsProperty, string hl7Value, WSShieldsApps.Doctor radiologist) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_RADIOLOGIST_FIRST_NAME: radiologist.FirstName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_RADIOLOGIST_LAST_NAME: radiologist.LastName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_RADIOLOGIST_MIDDLE_NAME: radiologist.MiddleName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_RADIOLOGIST_NPI: radiologist.Npi = hl7Value; break; default: break; } return(radiologist); }
private static string getHL7ValueSEL(HL7Message message, List <MessageGroupInstance> messageGroupInstances, List <MessageGroup> messageGroups, WebservicePropertySet wsProperty ) { // get the ms groups List <MessageGroup> msGroups = ConfigurationUtility.GetIncomingWebserviceMessageGroup(wsProperty, messageGroups); // get segment string type MessageGroupInstance messageGroupInstance = messageGroupInstances.Find(i => i.id == msGroups[ZERO].messageGroupInstanceId); // get the message position for this specific column List <Configuration> configMessagePoisition = ConfigurationDAO.GetMessagePosition(messageGroupInstance); // get the coordinates for the message item string messageCoordinates = HL7MessageUtility.getItemCoordinates(configMessagePoisition); // get segment string type string segmentType = configMessagePoisition[ZERO_ELEMENT].segmentType.name; // get the value for the database inside of the value position string hl7Value = HL7MessageUtility.getValueByPosition( message, HL7MessageUtility.getSegmentType(segmentType), messageCoordinates); return(hl7Value); }
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); }
private static WSShieldsApps.Doctor getReferringDoctor(WebservicePropertySet wsProperty, string hl7Value, WSShieldsApps.Doctor referring) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_REFERRING_FIRST_NAME: referring.FirstName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_REFERRING_LAST_NAME: referring.LastName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_REFERRING_MIDDLE_NAME: referring.MiddleName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_REFERRING_NPI: referring.Npi = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_REFERRING_SUFFIX: referring.Suffix = hl7Value; break; default: break; } return(referring); }
private static WSShieldsApps.Location getLocation(WebservicePropertySet wsProperty, string hl7Value, WSShieldsApps.Location referringLocation) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_LOCATION_STREET_ONE: referringLocation.StreetOne = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_LOCATION_STREET_TWO: referringLocation.StreetTwo = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_LOCATION_CITY: referringLocation.City = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_LOCATION_STATE: referringLocation.State = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_LOCATION_ZIP: referringLocation.ZipCode = hl7Value; break; default: break; } return(referringLocation); }
public static List <MessageGroup> GetIncomingWebserviceMessageGroup(WebservicePropertySet webservicePropertySet, List <MessageGroup> messageGroups) { List <MessageGroup> tempGroups = new List <MessageGroup>(); tempGroups = messageGroups; tempGroups = tempGroups.FindAll(m => m.messageGroupInstanceId == webservicePropertySet.messageGroupInstanceId); return(tempGroups); }
private static WSShieldsApps.Report getReport(WebservicePropertySet wsProperty, HL7Message message, string hl7Value, WSShieldsApps.Report report) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_REPORT_OBSERVATION_DATE: report.ObservationDate = hl7DateToRealDateTime(hl7Value); break; default: break; } return(report); }
private static WSShieldsApps.Organization getOrganization(WebservicePropertySet wsProperty, string hl7Value, WSShieldsApps.Organization organization) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_ORGANIZATION_NAME: organization.OrganizationName = hl7Value; break; default: break; } return(organization); }
private static WSShieldsApps.Exam getExam(WebservicePropertySet wsProperty, string hl7Value, WSShieldsApps.Exam exam) { switch (wsProperty.name) { case ShieldsExpressLinkDAO.PROPERTY_EXAM_ACCESSION_NO: exam.AccessionNo = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_EXAM_CODE_NAME: exam.ExamCodeName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_EXAM_TYPE_NAME: exam.ExamTypeName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_EXAM_SIDE_NAME: exam.ExamSideName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_EXAM_STATUS_NAME: exam.ExamStatusName = hl7Value; break; case ShieldsExpressLinkDAO.PROPERTY_EXAM_DATE: exam.ExamDate = hl7DateToRealDateTime(hl7Value); break; case ShieldsExpressLinkDAO.PROPERTY_EXAM_DATE_REQUESTED: exam.DateRequested = hl7DateToRealDateTime(hl7Value); break; case ShieldsExpressLinkDAO.PROPERTY_SOURCE_OF_REFERRAL: exam.SourceOfReferralName = hl7Value; break; default: break; } return(exam); }
private static WebservicePropertySet postUpdateWebservicePropertySet(WebservicePropertySet webservicePropertySet) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.PUT_WEBSERVICE_PROPERTY; command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_WEBSERVICE_OBJECT_ID, webservicePropertySet.webserviceObjectId); command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_NAME, webservicePropertySet.name); command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_MESSAGE_GROUP_INSTANCE_ID, webservicePropertySet.messageGroupInstanceId); command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_COLUMN_DATA_TYPE, webservicePropertySet.columnDataType); command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_ID, webservicePropertySet.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { webservicePropertySet.id = DAOUtility.GetData <int>(reader, WebservicePropertySetDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "postUpdateWebservicePropertySet()", webservicePropertySet.name); } } return(webservicePropertySet); }
public static bool Delete(WebservicePropertySet webservicePropertySet) { return(deleteWebservicePropertySet(webservicePropertySet)); }
public static WebservicePropertySet PostUpdate(WebservicePropertySet webservicePropertySet) { return(postUpdateWebservicePropertySet(webservicePropertySet)); }
public static List <WebservicePropertySet> Get(WebservicePropertySet webservicePropertySet) { return(getSingleWebservicePropertySet(webservicePropertySet)); }
public static void makeNewMessageGroups() { List <String> lines = new List <string>(); lines = File.ReadAllLines(@"C:\Users\chrisb\Source\Repos\HL7Broker\HL7BrokerConsoleTest\NewMessageGroupForWebService.txt").ToList(); lines.ForEach(delegate(String line) { // skip comments if (line.Contains("##")) { return; } string[] elementSplit = line.Split('|'); // gives the first part string[] tempMessageGroupInstance = elementSplit[0].Split(','); Console.WriteLine("Inserting Message Group Instance"); MessageGroupInstance messageGroupInstance = MessageGroupInstanceDAO.PostUpdate(new MessageGroupInstance() { messageTypeId = Convert.ToInt32(tempMessageGroupInstance[0]), segmentTypeId = Convert.ToInt32(tempMessageGroupInstance[1]), description = tempMessageGroupInstance[2] }); if (messageGroupInstance.id != -1 || messageGroupInstance.id != 0) { List <String> tempMessageGroup = elementSplit[1].Split(',').ToList(); tempMessageGroup.ForEach(delegate(String tempElement) { Console.WriteLine("Inserting Message Group"); string[] tempInnerElement = tempElement.Split('^'); MessageGroupDAO.PostUpdate(new MessageGroup() { messageGroupInstanceId = messageGroupInstance.id, messagePartId = Convert.ToInt32(tempInnerElement[0]), position = Convert.ToInt32(tempInnerElement[1]) }); }); Console.WriteLine("Inserting Message Group Property or Column Set"); // gives the first part string[] tempColumnSet = elementSplit[2].Split(','); /* * ColumnSet columnSet = new ColumnSet() * { * databaseTableId = Convert.ToInt32(tempColumnSet[0]), * name = tempColumnSet[1], * messageGroupInstanceId = messageGroupInstance.id, * isPrimaryKey = Convert.ToBoolean(tempColumnSet[2]), * columnDataType = tempColumnSet[3] * }; * * ColumnSetDAO.PostUpdate(columnSet); */ WebservicePropertySet webservicePropertySet = new WebservicePropertySet() { webserviceObjectId = Convert.ToInt32(tempColumnSet[0]), name = tempColumnSet[1], messageGroupInstanceId = messageGroupInstance.id, columnDataType = tempColumnSet[2] }; WebservicePropertySetDAO.PostUpdate(webservicePropertySet); } }); Console.Read(); }