HL7 Section to JSON

Primary tabs

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

  • 0
  • 0
  • 600
  • 2
  • 2


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.

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>".


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]