Read JSON and Cast to FHIR Type
  • 12 Aug 2024
  • 1 Minute to read
  • Dark
    Light

Read JSON and Cast to FHIR Type

  • Dark
    Light

Article summary

Step Details

Introduced in Version4.0.0
Last Modified in Version9.2.0
LocationIntegration > FHIR

The Read JSON and Cast to FHIR Type step casts a JSON formatted string to a specified FHIR Type. 

Prerequisites 

This step requires the FHIR Module to be installed before it will be available in the Toolbox. 

In version 9 a dependency to the module must be created in a Project for the steps to be visible.


Properties

Settings

PropertyDescriptionData Type
FHIRTypeNameDefines the FHIR Type to cast JSON string.---

Inputs

PropertyDescriptionData Type
FHIR Resource JSONJSON formatted string.String


Common Errors

Invalid JSON Encountered

If the JSON string is not correctly formatted or empty, the step will cause an error.

To correct this, ensure that the JSON string is valid and mapped or entered correctly.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Read JSON and Cast to FHIR Type 1[ReadResourceFromJSONAsType] in flow [FHIR]: Invalid Json encountered. Details: Error reading JObject from JsonReader. Path '', line 0, position 0.
 ---> System.FormatException: Invalid Json encountered. Details: Error reading JObject from JsonReader. Path '', line 0, position 0.
 ---> Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0. at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings
 at Hl7.Fhir.Utility.SerializationUtil.JObjectFromReader(JsonReader reader)
   --- End of inner exception stack trace --- at Hl7.Fhir.Utility.SerializationUtil.JObjectFromReader(JsonReader reader
 at Hl7.Fhir.Serialization.FhirJsonNode.Read(JsonReader reader, String rootName, FhirJsonParsingSettings settings
 at Hl7.Fhir.Serialization.FhirJsonNode.Parse(String json, String rootName, FhirJsonParsingSettings settings
 at Hl7.Fhir.Serialization.FhirJsonParser.Parse(String json, Type dataType
 at Hl7.Fhir.Serialization.FhirJsonParser.Parse[T](String json
 at Decisions.FHIR.FlowSteps.FHIRDeserializeSteps.ReadResourceFromJson(String jsonFHIRData
 at Decisions.FHIR.FlowSteps.ReadResourceFromJSONAsType.Run(StepStartData data
 at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
 at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
   --- End of inner exception stack trace ---

Feature Changes

DescriptionVersionRelease DateDeveloper Task
Change in types used by the step.9.2August 12, 2024DT-041549

Was this article helpful?