Querying field data

The xpmfetch command is to XPM handles what grmfetch is to GRM handles.

This command has access to these sources of data:

  • XPM's input record
  • XPM's output record
  • Temporary variables

Similar to grmfetch, xpmfetch uses an address string to identify the field data to retrieve. xpmfetch addresses are identical to the addresses that are used in XPM action input lists and are:

  • @name: Temporary field name
  • ~name: Output field name
  • name: Input field name

Similar to grmfetch, xpmfetch returns one DAT handle per retrieved item and supports a -warn option.

For example, an XPM is running a translation which maps FRL data to HL7.

  • To retrieve a particular input subfield:
    Input: xpmfetch -warn w $xlateId {NAME.[1]}
    Output: datum0
  • To retrieve data already stored in the output:
    Input: xpmfetch -warn w $xlateId ~0(0).PID(0).00041
    Output: datum1 datum2 datum3
  • To retrieve a temporary variable:
    Input: xpmfetch $xlateId @temp
    Output: datum4