--- title: "Cast FHIR Resource to FHIR Type" slug: "cast-fhir-resource-to-fhir-type" tags: ["JSON", "cast", "FHIR", "module", "resource"] updated: 2025-08-21T13:37:04Z published: 2025-08-21T13:37:04Z canonical: "documentation.decisions.com/cast-fhir-resource-to-fhir-type" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Cast FHIR Resource to FHIR Type | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 9.2.0 | | **Location** | Integration > FHIR | The **Cast FHIR Resource** **to FHIR Type** step casts a JSON formatted string to a specified **FHIR Type.** ### Prerequisites This step requires the **FHIR Module** to be [installed](https://documentation.decisions.com/docs/installing-modules-decisions) before it will be available in the **Toolbox.** In version 9 a [dependency](https://documentation.decisions.com/v9/docs/project-dependencies) to the module must be created in a Project for the steps to be visible. --- ## Properties #### [Settings] | Property | Description | Data Type | | --- | --- | --- | | FHIRTypeName | FHIR type name to cast JSON formatted string from. | String | | FhirVersion | FHIR version to cast JSON formatted string through. | String | #### Inputs | Property | Description | Data Type | | --- | --- | --- | | FHIR Resource | JSON formatted string to cast. | Object | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-08-21_09h33_29.png) --- ## 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: ```csharp 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 | Description | Version | Release Date | Developer Task | | --- | --- | --- | --- | | Change in types used by the step. | [9.2](https://documentation.decisions.com/v99/docs/version-92x-release-notes) | August 12, 2024 | DT-041549 | --- ## Related - [Get Json For FHIR Object](/get-json-for-fhir-object.md) - [Get Json For FHIR Resource](/get-json-for-fhir-resource.md) - [Get Json For FHIR Bundle](/get-json-for-fhir-bundle.md) - [Add Resource To Bundle](/add-resource-to-bundle.md) - [Get Resources From Bundle](/get-resources-from-bundle.md) - [Read Resource From Json](/read-resource-from-json.md)