Search code examples
hl7hl7-v2

Handling HL7 Reschedule events


I am parsing HL7 and populating an external calendar based on incoming messages. I'm stuck on rescheduling messages though. How do I tell from the below messages what to do? If patient X has 2 bookings, and wants to reschedule/cancel one of them, how do I know which one to alter - I can see nothing in the messages or the HL7 spec that enables identifying which external calendar item I should alter. What am I missing? I'd hoped for some sort of unique appointment identifier. There seems to be a unique message identifier, but this isn't helpful as the value changes message to message.

Booked:

MSH|^~\&|RISNAME|MRUNIT|ExtCalendar|MRUNIT|20170125091951+1300||SIU^S12^SIU_S12|woYmjM|P|2.4|||AL|NE|AU|ASCII|ENG SCH|||||0^0|0|||||^^^20170125111500^20170125120000^R|||||||||||MRUNIT PID|1||AP859^^^RISNAME^ID|52^^^RISNAME^PI|Jobs^Melinda^^^Ms^^K||19820619+100|F|||||^^^^^^095273616|||||||||||||||||N PV1||O|OREF^^^OREF^^^^^OREF RGS|1 AIS|1||ANG^MRI Angiography^^MR|20170125111500||||||Booked AIL|1||MRI_3T^^^MRUNIT^^^^^3T|MRI||20170125111500

Same appointment rescheduled to another time and scanner:

MSH|^~\&|RISNAME|MRUNIT|ExtCalendar|MRUNIT|20170125092019+1300||SIU^S13^SIU_S12|LrnXDl|P|2.4|||AL|NE|AU|ASCII|ENG SCH|||||0^0|0|||||^^^20170125101500^20170125110000^R|||||||||||MRUNIT PID|1|| AP859^^^ RISNAME^ID|52^^^ RISNAME^PI|Jobs^Melinda^^^Ms^^K||19820619+1300|F|||||^^^^^^095273616|||||||||||||||||N PV1||O|OREF^^^OREF^^^^^OREF RGS|1 AIS|1||ANG^MRI Angiography^^MR|20170125101500||||||Booked AIL|1||MRI_1.5T^^^MRUNIT^^^^^MRI 1.5T|MRI||20170125101500


Solution

  • It looks like the example messages are a SIU^S12 and a SIU^S13 for the same visit. This message type in MSH-9.2 is what determines whether the message is coming in to schedule a new appointment (S12) or reschedule an existing appointment (S13).

    In my experience I've seen unique IDs for an appointment in SCH-1, SCH-2, SCH-24, or PV1-19 and I do find it strange you are not getting any unique identifiers.

    One alternative would be to try to match any SIU^S13 messages to an existing appointment in your external calendar based on patient demographics, appointment location (SCH-5), and appointment time (SCH-11).

    SCH Segment specs

    Timing Quantity Lookup Table

    Hope this helps