How to get number of segments in a hl7 message and then pull a field value from the last segment
Hi, Is there a way to count the number of segments in a HL7 Mesage? I tried the examples from the other answers but nothing works for me.
I am writing a function to get the last OBX segment field value 5. Below is a sample screenshot of what I want.
The number of obx segments can change, so I want to count the last obx segment and then get the field 5 value.
Would appreciate some guidance on this.