Accessing msg object from Database Writer - rbeckman-nextgen/test-mc GitHub Wiki

  1. Mirth Connect
  2. Home
  3. Examples and Tutorials

Mirth Connect : Accessing msg object from Database Writer

Created by Jacob Brauer, last modified on Mar 23, 2009

(Thanks to the nice folks from WebReach who told me about this one)

The "msg" object (containing the HL7 message map) is not normally accessible from the Database Writer. This makes looping through multiple segments difficult if not impossible.

The solution is to import it from the channel map by using:

var msg = channelMap.get( 'msg' );

Then all of the Javascript recipes involving the msg object will work from the Database Writer.

Comments:

Looks like this doesn't work anymore in latest Mirth Connect. However this seems to work.

var msg = new XML(SerializerFactory.getHL7Serializer().toXML(messageObject.getEncodedData()));
Posted by shishir at Aug 23, 2013 05:00

Document generated by Confluence on Nov 11, 2019 08:40

Atlassian

⚠️ **GitHub.com Fallback** ⚠️