Sidebar

How do I get and set subcomponents on HL7 messages?

0 votes
218 views
asked Sep 28, 2023 by jon-t-7005 (7,990 points)

Given the below AIP segment, what node path would I use to get and set the subcomponents of AIP-3?

AIP|1||Field1^Field2^Field3&Subcomponent1&Subcomponent2|

1 Answer

0 votes

You would use this node syntax:

AIP-3.9.2

The syntax is SEGMENT - FIELD [OPTIONAL SUBFIELD INSTANCE] . FIELD . FIELD

To get the Subcomponent1, you would use this message.getNode():

message.getNode('AIP-3.3.2')

To replace Subcomponent2, you would use this message.setNode():

message.setNode('AIP-3.3.3')

Subcomponent1 and Subcomponent2 are part of AIP-3.3; using message.getNode('AIP-3.3') will return Field3&Subcomponent1&Subcomponent2.

answered Sep 28, 2023 by jon-t-7005 (7,990 points)
...