Wraps a message to provide access to fields using a terse location specification syntax. For example:
terser.set("MSH-9-3", "ADT_A01");
can be used instead of
message.getMSH().getMessageType().getMessageStructure().setValue("ADT_A01");
The syntax of a location spec is as follows:
location_spec: segment_path_spec "-" field ["(" rep ")"] ["-" component ["-" subcomponent]]
... where rep, field, component, and subcomponent are integers (representing, respectively, the field repetition (starting at 0), and the field number, component number, and subcomponent numbers (starting at 1). Omitting the rep is equivalent to specifying 0; omitting the component or subcomponent is equivalent to specifying 1.
The syntax for the segment_path_spec is as follows:
segment_path_spec: ["/"] (group_spec ["(" rep ")"] "/")* segment_spec ["(" rep ")"]
... where rep has the same meaning as for fields.
A leading "/" indicates that navigation to the location begins at the root of the message; omitting this indicates that navigation begins at the current location of the underlying SegmentFinder (see getFinder() -- this allows manual navigation if desired). The syntax for group_spec is:
group_spec: ["."] group_name_pattern
Here, a . indicates that the group should be searched for (using a SegmentFinder) starting at the current location in the message. The wildcards "*" and "?" represent any number of arbitrary characters, and a single arbitrary character, respectively. For example, "M*" and "?S?" match MSH. The first group with a name that matches the given group_name_pattern will be matched.
The segment_spec is analogous to the group_spec.
As another example, the following subcomponent in an SIU_S12 message:
msg.getSIU_S12_RGSAISNTEAIGNTEAILNTEAIPNTE(1).getSIU_S12_AIGNTE().getAIG().getResourceGroup(1).getIdentifier();
/SIU_S12_RGSAISNTEAIGNTEAILNTEAIPNTE(1)/SIU_S12_AIGNTE/AIG-5(1)-1
/*AIG*(1)/SIU_S12_AIGNTE/AIG-5(1)-1
/*AIG*(1)/.AIG-5(1)
The search function only iterates through rep 0 of each group. Thus if rep 0 of the first group in this example was desired instead of rep 1, the following syntax would also work (since there is only one AIG segment position in SUI_S12):
/.AIG-5(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|