Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   msg object in JavaScript Writer? (http://www.mirthcorp.com/community/forums/showthread.php?t=13653)

jr76 03-25-2015 10:24 AM

msg object in JavaScript Writer?

I'm trying to implement a JavaScript Writer. Most examples on the web seem to be for writing transformers, and there is a "msg" object available, from which you can do things like:


How can I get access to this object (or something similar) in the JavaScript Writer context?


narupley 03-25-2015 10:27 AM

The msg/tmp variables are typically E4X XML objects that are created automatically in a transformer. That's what a transformer is supposed to be used for: transforming the message. So that begs the question: Why are you doing something in a JavaScript Writer that should be done in a transformer?

FYI you can manually declare msg in a JavaScript Writer, by using one of the conversion functions. Use the References list / User API / auto-completion menu, that's what they're there for.


var msg = new XML(SerializerFactory.getSerializer('HL7V2').toXML(connectorMessage.getEncodedData()));

jr76 03-25-2015 10:43 AM


Thanks for your quick reply. Perhaps I'm going about this the wrong way. I'm using a JavaScript Writer because I wish to invoke a REST service and pass it some values extracted from the message. So I suppose my real question is, what is the appropriate way to extract values from a message in my JavaScript Writer code? I assumed that the "msg" object is what I'm looking for, because that's what I've seen around the web.


narupley 03-25-2015 10:45 AM

If you've never used Mirth Connect before, this is a good place to start: http://www.mirthcorp.com/webinars/mi...ect-screencast

Also the User Guide: http://info.mirth.com/Connect_Docume..._Download.html

soundhar 05-01-2017 01:19 PM

Hl7 to EXCEL

I'm new in mirth interface need to Map Hl7 V2 message in Excel sheet.

I don't how to write transformer? Please give me some suggestion.

siddharth 05-03-2017 03:37 AM

Sounds like you also need to go through mirth 101 guide.

All times are GMT -8. The time now is 09:13 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation