Written by

Project Manager & Head of Interoperability at Salutic Soluciones, S.L.
Question Kurro Lopez · Dec 19, 2016

HL7 Section to JSON

Hi all,

I'm trying to convert a HL7 section to a XML or JSON string.

We need to save the content of PID section into a SQL Column, therefore we need to convert it into a XML o JSON string

is there any easy way to convert it?

I've tried to convert it directly into a DTL, but all my attempts have been unsuccessful

Best regards,

Francisco Lopez

Comments

Kurro Lopez  Dec 20, 2016 to Eduard Lebedyuk

My cache version is:

Cache for Windows (x86-64) 2016.2.1 (Build 803U) Wed Oct 26 2016 12:31:28 EDT [HealthShare Modules:Core:15.01.171 + Linkage Engine:15.0.171]

0
Eduard Lebedyuk · Dec 20, 2016

You should have FHIR package, which includes dtls to transform hl7 messages into json or xml. You can either use that or write your own solution based on that.

0
Ben Webb  Aug 10, 2022 to Eduard Lebedyuk

Do you know what those DTL classes would be called? I've had a look but I couldn't see any reference to JSON DTLs in HealthShare HealthConnect 2021.1
Thanks, 
Ben 

0
Brendan Batchelder · Dec 22, 2016

Why does saving the content of the PID segment in a SQL table require you to convert it to JSON or XML?  What format does it need to be in in the SQL table?

You can extract the entire PID segment with something like source.GetValueAt("PID") depending on your DocType structure.  If you just need to wrap it in XML tags then set xml = "<PID>"_source.GetValueAt("PID")_"</PID>".

0
Phil Burkhalter · Aug 10, 2022

you can define a message class for your JSON message. then set up your transform to transform the data from the HL7 message to the JSON message. then in your business process use the built in SQL commands to store the JSON string in SQL Server. 

0