FHIR-Converter
FHIR-Converter copied to clipboard
Error Invalid JSON generated: line 154724:16 no viable alternative at input
I am converting ccda data to fhir format. for 50% of the files the utility is giving the following error.
Microsoft.Health.Fhir.Liquid.Converter.Tool.exe : Error Invalid JSON generated: line 154724:16 no viable alternative at input '"entry":[{"fullUrl":"urn:uuid:150de6e5-296a-dac1-7fb6-ba9ad5176863","resource":{"resourceType":"Compo sition","id":"150de6e5-296a-dac1-7fb6-ba9ad5176863","identifier":{"use":"official","value":"af2144b7-e0c5-47e7-9808-24b12f8f922c",},"status":"final","type":{"coding":[{"code":"34133-9","display":"Summarization of Episode Note","system":"http://loinc.org",},],},"date":"2022-06-14T13:26:29+05:30","title":"Clinical Summary","confidentiality":"N","attester":[{"mode":"legal","time":"2022-06-
@hongyh13 can this issue be closed?
I observed the same problem when converting a Questionnaire from STU3 to R4. The problem at that place was in the temporary generated Response the inital[x] -> valueBoolean and valueDecimal have been written as "unknown".
Had to change the file Questionnaire/_initial.liquid to look like:
{ {% if msg.initialBoolean != null -%} "valueBoolean" : {{msg.initialBoolean}}, {% endif -%} {% if msg.initialDecimal != null -%} "valueDecimal" : {{msg.initialDecimal}}, {% endif -%} {% if msg.initialInteger != null -%} "valueInteger" : {{msg.initialInteger}}, {% endif -%} {% if msg.initialDate != null -%} "valueDate" : "{{msg.initialDate}}", {% endif -%} {% if msg.initialDateTime != null -%} "valueDateTime" : "{{msg.initialDateTime}}", {% endif -%} {% if msg.initialTime != null -%} "valueTime" : "{{msg.initialTime}}", {% endif -%} {% if msg.initialString != null -%} "valueString" : "{{msg.initialString}}", {% endif -%} {% if msg.initialUri != null -%} "valueUri" : "{{msg.initialUri}}", {% endif -%} {% if msg.initialAttachment != null -%} "valueAttachment" : {{msg.initialAttachment | to_json_string | default : '""'}}, {% endif -%} {% if msg.initialCoding != null -%} "valueCoding" : {{msg.initialCoding | to_json_string | default : '""'}}, {% endif -%} {% if msg.initialQuantity != null -%} "valueQuantity" : {{msg.initialQuantity | to_json_string | default : '""'}}, {% endif -%} {% if msg.initialReference != null -%} "valueReference" : {{msg.initialReference | to_json_string | default : '""'}}, {% endif -%} "initial[x]" : "", }
after the additional "if"s at least this part of the Questionaires rendered fine. "enableWhen"s are another story :-/
Hi @pradsin!
You can update the template on your end to fit your data by editing the Observation.liquid file by adding if condition before referenceRange and interpretation attribute: Ex: {% if observationEntry.referenceRange -%} "referenceRange": [ ........... ], {% endif -%} {% if observationEntry.interpretationCode -%} "interpretation": .......... {% endif -%}
Hope that helps!