web stats
Hl7 file --> Json - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2018, 05:01 AM
loudhush loudhush is offline
What's HL7?
 
Join Date: Nov 2018
Posts: 1
loudhush is on a distinguished road
Default Hl7 file --> Json

My requirement is to take an hl7 message and turn it into Json to be consumed by WebAPI.

Mirth will be doing the majority of mapping, and then the WebAPI is in charge if persisting this information to the database


My current configuration is to take in HL7 data via a file, transform that input to variables, and then output those variables into JSON. It feels like I'm doing an extra step, but putting the data into a variable.


I was wondering if there is a way to take the hl7 data, and just directly put the PID information into the JSON output.


(Attempting to upload an image with a screenshot of my destination.)
Reply With Quote
  #2  
Old 11-05-2018, 05:23 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

I recommend you get the official user guide from the mirth downloads page. It answers a lot of questions about basic functionality of mirth.

The easiest way to do this is to use inbound and outbound templates in your transformer. The thing to remember when creating your outbound JSON template is that this should be a skeleton of your output, not a sample. Any values you place in the template should be considered default values, because they will be part of your output unless you delete or overwrite them.

Once you have your templates set up, on the Message Tree tab of your transformer, you can drag and drop values from hl7 to JSON, and it will create the corresponding Message Builder step for you.

Of course you could do it all in Javascript, too. These forums are full of examples of manipulating messages in the transformer with javascript.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:27 PM.


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