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.

. In case you haven't registered yet or are still looking for the right justification to get the eventual approval to attend, here's a quick overview of all the sessions around Data Management and Analytics:
510
.png)
.png)

.png)