Read Resource From Json
  • 04 Apr 2024
  • 1 Minute to read
  • Dark
    Light

Read Resource From Json

  • Dark
    Light

Article summary

Step Details

Introduced in Version4.0.0
Last Modified in Version7.12.0
LocationIntegration > FHIR
PrerequisiteInstallation of the FHIR Module

The Read Resource From JSON step uses a JSON formatted string and outputs an FHIR Resource







Properties

Inputs

PropertyDescriptionData Type
Json FHIRDataThe desired JSON string.String

Outputs

PropertyDescriptionData Type
OutputOutputs the string as a Resource Object.---

Example Inputs and Outputs

Json FHIRDataOutput
{"id":"example","resourceType":"Account","text":{"div":"<div>[Put rendering here]</div>","status":"generated"}}
List of Resource data
"id":"example","resourceType":"Account","text":{"div":"<div>[Put rendering here]</div>","status":"generated
EXCEPTION MESSAGE
NullEXCEPTION MESSAGE
EmptyEXCEPTION MESSAGE


Common Errors

Invalid JSON  Encountered

If the input string is not a correctly formatted JSON string, the step will cause an error.

To correct this, ensure that the JSON string is properly formatted into an FHIR Resource.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Read Resource From Json 1[ReadResourceFromJson] in flow [Flow 8]: Exception invoking method ReadResourceFromJson on class FHIRDeserializeSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method ReadResourceFromJson on class FHIRDeserializeSteps
 ---> System.FormatException: Invalid Json encountered. Details: Unterminated string. Expected delimiter: ". Path 'id', line 1, position 12.
 ---> Newtonsoft.Json.JsonReaderException: Unterminated string. Expected delimiter: ". Path 'id', line 1, position 12. at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote
 at Newtonsoft.Json.JsonTextReader.ParseValue(
 at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings
 at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options
 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)
   --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.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 ---



Was this article helpful?