Pathcopy usage

The PATHCOPY action expands upon the BULKCOPY and COPY actions. Any unit of hierarchical organization (group, segment, field, and so on) can be addressed in one action statement.

PATHCOPY is used in these ways:

  • To replicate a unit of hierarchical organization from an input message into any appropriate location for that unit in the output message:
    • To use PATHCOPY, the partial path specifications of the input and output must match in organizational type. For example, you can only PATHCOPY an HL7 PID to an HL7 PID. This use of PATHCOPY operates across the full spectrum of organization, from replicating a group to a group, down to subcomponent to subcomponent. In this respect, PATHCOPY can be used in many situations as a replacement for BULKCOPY and COPY actions.

      Format versions can differ between the input and output. For example, you can PATHCOPY between an HL7 v2.1 input stream and an HL7 v2.3 output stream.

  • To replicate one datum into all of the data locations within a large unit of hierarchical organization (group, segment, field, and so on):
    • This behavior of PATHCOPY is triggered by specifying a single datum as the input to the action. The one datum can be from an input message. It can also be a temporary variable constant, for example, @null, or it can be a user-supplied string constant, for example, =a_string. If the datum is from an input message, then the path pointing to that message datum must be fully-qualified to the sub-component level.
    • This function of PATHCOPY is useful to clear out and remove unnecessary portions of an output message. For example, an unnecessary segment that was copied to the output message by a BULKCOPY action. Use the @null temporary variable as the PATHCOPY input to clear and remove the unnecessary portions.
Note: If, within the same message formats, you do a one-to-many PATHCOPY, then the outbound message structure is not created. In the same message formats, PATHCOPY can be the first operation in the translation. When you do a one-to-many PATHCOPY, the outbound message structure is not created. For example,=mystring--> 0(0).1(0).PID" [HL7-->HL7]. If the structure is already there, then it overwrites it. For example, a BULKCOPY is followed by @null copied to all of the PID segments.

PATHCOPY, by design, only supports copying "input record to output record", not "output record input record."