Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How to read from a JSON File and convert to HL7 message

Question
Joe Jones · Mar 17, 2023

How to read from a JSON File and convert to HL7 message

Hi Community,

I am trying to read a JSON file and convert into HL7 message.Please find the example below

 

Set Jsonobj={"Doctype":"ADT^A01","PatientId":"123","PatientName":"Alex"}

Set Dynjsonobj= ##class(%Library.DynamicObject).%FromJSON(Jsonobj)

Error :<THROW>%FromJSON+37^%Library.DynamicAbstractObject.1 *%Exception.General READ error while reading input stream 10 Line 1 Offset 0

I am getting this error while reading the file,Can you please tell me where i am doing wrong in converting the file?

Joe

#Error Handling #JSON #ObjectScript #Ensemble
Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.1 (Build 312_1_18937U) Fri Apr 26 2019 17:58:36 EDT

Source URL:https://community.intersystems.com/post/how-read-json-file-and-convert-hl7-message