Question
· Jan 11

Convert HL7 message to JSON

Hello, I tried to convert HL7 message to JSON in a business process and I got errors. Has anybody converted HL7 to JSON? Are certain characters not allowed in JSON?

I just tried to set a property to quote request.RAWContent and quote. I will try to put example in GitHub and share here later.

Product version: IRIS 2022.3
Discussion (5)3
Log in or sign up to continue

I agree with Phil and Oliver both! 


Like Phil, I created JSON enabled classes for my JSON structure. This allowed me to control the element names and nesting. 


*I do have a couple of extra steps. This was the only way I could get it to work for me but also this was how I was taught to do it so there might be better ways. 


So in addition to the JSON enabled message classes, I also created a one-to-one version of that message class but as an XML Schema. 


Then in a BPL, I used a DTL to transform the HL7 to the XML, then I used another transform to map the XML to JSON, and followed that with yet another transform with just a code block (similar to what Oliver did) to add in the custom HTTP Headers for the API call and to convert the body of the message into true JSON format using %JSONExportToStream() then I finally send it out on an HTTP call.