Identifying HL7 Segment Schema Path?
If you're viewing a HL7 message in the front end, with a schema correctly applied, you can mouse over a segment or a field and see the schema path, e.g:
Mousing over PV1 in the above message shows the schema path is "PIDgrp(1).PV1".
I'm writing a utility function which you pass an EnsLib.HL7.Message into. I'd like to loop through each segment and take action dependant on that schema path. How can I reference or determine that schema path in code?
Any help would be much appreciated!
Sorry, never mind, figured it out.
Where pHL7 is the EnsLib.HL7.Message, execute:
do pHL7.BuildMap(0)
After that, reference pHL7.GetSegmentPath(*) to get the schema path (replacing * with the segment number, e.g. in the screenshot in my original post, PV1 was row 5, so pHL7.GetSegmentPath(5) = "PIDgrp(1).PV1").
For my loop I'm referencing pHL7.SegCount, e.g:
F i=1:1:pHL7.SegCount { w pHL7.GetSegmentPath(i),! }
@Mathew Burt
Hi, what is the BuildMap actually doing, is it modifying the structure of HL7?
'coz I had a zwrite on HL7 message before and after GetvalueAt()(which internally uses Buildmap())and the result was diffferent