Hi everyone, please check out our new discussion forum located in our GitHub site: https://github.com/nextgenhealthcare/connect/discussions. Let us know your feedback as we try out this new part of GitHub! Don't worry, the content in these forums won't be going away and will at a minimum be preserved for historical reference.
The different mappings are just the scope of the mapping??
Channel Map = just in this channel
Connector Map = just in this connector
Global Map = across the entire application
Response Map = just for the response
The channelMap only exists in the scope of a single message in the channel. It actually "lives" in the message object, same as the response map.
The connector map is local for each connector (so the source and any destinations).
Here is the actual object flow in the Mirth code:
Message is Received->Message Object is Created (includes channel map, response map and the source connector's connector map)->Message Object is duplicated for each destination (retains a SINGLE reference to the channel map and response map, however a new connector map is created for each copy of the message object).
When you reference any of the maps in your JS, you are referencing the maps that live on that message object.
The only map that is shared between messages is the global map.
My use case is to process a set of results from a query as one data set. For implementing this, I want to loop through this result set (using Javascript) and create a map that I can use in the source transformer.
I am not sure if this will work. Looks like Mirth expects a result set and processes one result at a time. In my case I need to fake by returning a artificial resultset that has only one result.
But the actual problem looks like that no map is visible in the source connector. Is this because there is no message object created at this point.
How can I put the values that I got from multiple rows into a map that will be visible in source transformer?
kbobba, rather than returning a resultset, you can return a different type of set. I believe you can return a list of hash maps. Each item in the list will be processed as a message, and each item in the hash map will be accessible in the source transformer as the incoming xml message.
Jacob Brauer
Director, Software Development
NextGen Healthcare
There is no channel map available in the JavaScript Reader, because there is no message yet. The job of the JavaScript Reader is to create messages for the channel to consume (or just execute an arbitrary block of code).
The JavaScript Writer is different. It's a destination connector, so in there you do have access to the channel map.
If you want to pass metadata along with your messages in the JavaScript Reader, you can return a RawMessage object (or list of said objects), including a map of variables to inject into the source map. More info in the User API.
Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment