Sidebar

How do you use the Alternate Message node tag with the Evaluate Template?

0 votes
51 views
asked Oct 3 by gary-t-8719 (15,130 points)
The qie.evaluateTemplate takes a parameter of alternateMessage or alternateMessages[]. How is the Alternate Message used in this context?

2 Answers

0 votes

The syntax for qie.evaluateTemplate() is this:

qie.evaluateTemplate('template', parameters*, 'escapeFor*', isJSON*, 'endpointURL*', alternateMessages);

Take note of the final argument, alternateMessages.  To use an alternate message with qie.evaluateTemplate(), you would pass a message object (i.e. an HL7 or JSON object) as that final argument.  

Then, in your template, you would use this node tag syntax to access that message:

{alt:nodePath}

For example, if you passed an HL7 message object as the alternateMessage, you could access PID-3 of that altnernate message like this:

{alt:PID-3}
answered Oct 3 by jon-t-7005 (8,110 points)
0 votes

Use Case: The source system sends a CSV message with basic patient demographics (e.g., ID, last name, first name), and the task is to output a CSV with additional fields queried from the practice management database. The query results are used as an alternate message in qie.evaluateTemplate.

qie.evaluateTemplate can access various QIE objects like Source, Message, MessageCache, and Node Tags. A template representing the full CSV output can include standard and alternate Node Tags, which are resolved when passed into qie.evaluateTemplate. The dbQuery results are parsed into a CSV model via qie.parseCSVString() and referenced in the template, allowing both source and query data (e.g., {s:NodePath}, {alt:NodePath}) to be used.

Download this QIE channel for a working example of this use case.

See this KB article for more infomation about Node Tags.

answered Oct 3 by gary-t-8719 (15,130 points)
edited Oct 4 by gary-t-8719
...