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