Following on from yesterdays demo at Integrate 2023 which everyone seemed to enjoy I wondered what I can do with a more advanced scenario.

I used my helper Logic App from the previous blog post which calls ChatGPT and I used this HL7 input message.

MSH|^~\&|HIS|ADT_SYSTEM|EMR|EMR_SYSTEM|20230607120000||ADT^A01|MSG000001|P|2.3
EVN|A01|20230607120000|||
PID|1|123456|123456789||Connor^John^J^^Mr.||19700101|M|||123 Main St^^New York^NY^10001||123-456-7890|||S||PATID12345678^2^M10|1234567890
PV1|1|O|^^^Cyberdyne Systems|||||ABC123^Smith^John^Dr.|||SUR|||ADM000001^Admit|||

I then provided the following map instructions

can you convert this to json
then from the json
can you convert the MSH datetime to yyyy-MM-ddTHH:mm:ss format
can you split the message type value in the MSG message type field if it has a ^ into 2 new fields
in the EVN can you convert the datetime to yyyy-MM-ddTHH:mm:ss format
for the patient on the PID can you create a full name field
for the patient in PID can you convert the birth date to yyyy-MM-dd
for the patient in PID can you convert the gender to the full name of the gender
for the patient marital status in PID can you convert this to the description from the code
remove the waffle and just give the output example

The output I could get is below

{
  "MSH": {
    "fieldSeparator": "|",
    "encodingCharacters": "^~\\&",
    "sendingApplication": "HIS",
    "sendingFacility": "ADT_SYSTEM",
    "receivingApplication": "EMR",
    "receivingFacility": "EMR_SYSTEM",
    "datetime": "20230607120000",
    "messageType": {
      "messageCode": "ADT",
      "triggerEvent": "A01",
      "messageStructure": "2.3"
    },
    "messageControlID": "MSG000001",
    "processingID": "P"
  },
  "EVN": {
    "eventType": "A01",
    "datetime": "20230607120000"
  },
  "PID": {
    "setID": "1",
    "patientID": {
      "idNumber": "123456",
      "assigningAuthority": "123456789"
    },
    "fullName": "John Connor",
    "birthDate": "1970-01-01",
    "gender": "Male",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "zip": "10001"
    },
    "phoneNumber": "123-456-7890",
    "maritalStatus": {
      "code": "S",
      "description": "Never Married"
    },
    "patientAccountNumber": {
      "idNumber": "PATID12345678",
      "assigningAuthority": "2",
      "identifierTypeCode": "M10"
    }
  },
  "PV1": {
    "setID": "1",
    "patientClass": "O",
    "assignedPatientLocation": {
      "pointOfCare": "",
      "room": "",
      "bed": "",
      "facility": "Cyberdyne Systems"
    },
    "attendingDoctor": {
      "idNumber": "ABC123",
      "familyName": "Smith",
      "givenName": "John",
      "suffix": "Dr."
    },
    "admitDateTime": "ADM000001",
    "admittingDoctor": {
      "idNumber": "",
      "familyName": "",
      "givenName": "",
      "suffix": ""
    },
    "referredDoctor": {
      "idNumber": "",
      "familyName": "",
      "givenName": "",
      "suffix": ""
    },
    "consultingDoctor": {
      "idNumber": "",
      "familyName": "",
      "givenName": "",
      "suffix": ""
    },
    "hospitalService": "",
    "temporaryLocation": "",
    "preadmitTestIndicator": "",
    "readmissionIndicator": "",
    "dischargeDateTime": "",
    "dischargeDoctor": {
      "idNumber": "",
      "familyName": "",
      "givenName": "",
      "suffix": ""
    },
    "patientType": "",
    "visitNumber": "",
    "financialClass": "",
    "chargePriceIndicator": "",
    "courtesyCode": "",
    "creditRating": "",
    "contractCode": "",
    "contractEffectiveDate": "",
    "contractAmount": "",
    "contractPeriod": ""
  }
}

 

Buy Me A Coffee