For the complete documentation index, see llms.txt. This page is also available as Markdown.

Read and Write FHIR Data in an Agentic Workflow

Overview

Once you use the FHIR integration to authenticate to your FHIR® server, you can read and write live FHIR data directly from an Agentic Workflow.


Before You Begin

To read and write FHIR data in an Agentic Workflow, you need:


Read and Write FHIR in an Agentic Workflow

To read and write FHIR in an Agentic Workflow:

1

Go to the Agentic Workflow builder

In the global navigation, select Agentic Workflows. Then, to open the builder, do one of the following:

  • Select New Agentic Workflow.

  • Select the name of an existing Agentic Workflow.

The New Agentic Workflow button on the Agentic Workflows page
2

Add an action to the Agentic Workflow

In the builder, select +, and then select Add Action.

The Add Action context menu item in the Agentic Workflow builder
3

Select the FHIR action

In the Add Action modal that appears, scroll to the Integration section, and select the FHIR connection card.

The FHIR connection card on the Add Action modal
4

Choose the function to perform

In the Action Settings section of the Add Action modal, select the Action dropdown menu, and do one of the following:

  • To read a single FHIR resource, select FHIR Read, and set up the action. For more information, see Set Up a FHIR Read Action below.

  • To search FHIR resources and return results, select FHIR Search, and set up the action. For more information, see Set Up a FHIR Search Action below.

  • To create a new FHIR resource, select FHIR Create, and set up the action. For more information, see Set Up a FHIR Create Action below.

  • To update an existing FHIR resource in its entirety, select FHIR Update, and set up the action. For more information, see Set Up a FHIR Update Action below.

  • To update certain fields of an existing FHIR resource, select FHIR Patch, and set up the action. For more information, see Set Up a FHIR Patch Action below.

Note: Each of these actions depends on the access token and base URL that the FHIR Authenticate action obtains. If you haven't added FHIR Authenticate to your Agentic Workflow, you should do so now. See Authenticate to a FHIR Server in an Agentic Workflow for details.

5

Configure error handling

In the Error Handling section of the modal, specify how to handle errors in this step of the Agentic Workflow.

The error handling options in the Add Action modal
6

Save the FHIR action

Select Save.


Set Up a FHIR Read Action

The FHIR Read action reads a single FHIR resource by its type and ID.

To set up a FHIR Read action:

1

Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the Input Source dropdown menu, and then configure the source with the additional controls that appear.

The script inputs for the FHIR Read action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

Access Token

String

The access token from the FHIR Authenticate action

Yes

FHIR Base URL

String

The base URL of the FHIR server from the FHIR Authenticate action

Yes

Resource ID

String

The ID of the FHIR resource to read

Yes

Resource Type

String

The type of the FHIR resource to read in PascalCase, such as Patient or PractitionerRole

Yes

2

Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the Output Destination dropdown menu, and then configure the destination with the additional controls that appear.

The script outputs for the FHIR Read action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

HTTP Status Code

Number

The HTTP status code that the read operation returned

No

Result

String

The result of the read operation in JSON format

No


Set Up a FHIR Search Action

The FHIR Search action runs a search on FHIR resources of the specified type and returns the results for use in your Agentic Workflow.

Note: The FHIR Search action returns the first page of results only. For large results sets, use _count in the search parameters to control page size and handle pagination manually in the Agentic Workflow.

To set up a FHIR Search action:

1

Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the Input Source dropdown menu, and then configure the source with the additional controls that appear.

The script inputs for the FHIR Search action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

Access Token

String

The access token from the FHIR Authenticate action

Yes

FHIR Base URL

String

The base URL of the FHIR server from the FHIR Authenticate action

Yes

Resource Type

String

The type of the FHIR resource to search in PascalCase, such as Patient or PractitionerRole

Yes

Search Parameters

String

The parameters of the search, like this: _count=10&_lastUpdated=gt2026-02-10T00:00:00Z

No

Note: If you don't specify search parameters, the integration returns all FHIR resources of that type.

2

Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the Output Destination dropdown menu, and then configure the destination with the additional controls that appear.

The script outputs for the FHIR Search action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

HTTP Status Code

Number

The HTTP status code that the search operation returned.

No

Result

String

The result set as a JSON string.

No

Total Count

Number

The total number of entries on the first page of results. Note that this isn't necessarily the same as the total number of FHIR bundles.

No

Note: Large search results might cause timeouts. Consider streamlining the search by providing targeted search parameters.


Set Up a FHIR Create Action

The FHIR Create action creates a new FHIR resource of the specified type from data in Kizen.

Note: The FHIR Create action can't consume a FHIR Search result directly. You must parse the result with the Parse FHIR Resource action first.

To set up a FHIR Create action:

1

Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the Input Source dropdown menu, and then configure the source with the additional controls that appear.

The script inputs for the FHIR Create action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

Access Token

String

The access token from the FHIR Authenticate action

Yes

FHIR Base URL

String

The base URL of the FHIR server from the FHIR Authenticate action

Yes

Resource Body

String

The FHIR resource to create as a JSON string. Take this value from the output of a FHIR Read step.

Yes

Resource Type

String

The type of the FHIR resource to create in PascalCase, such as Patient or PractitionerRole.

Yes

2

Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the Output Destination dropdown menu, and then configure the destination with the additional controls that appear.

The script outputs for the FHIR Create action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

Created Resource ID

String

The ID of the created FHIR resource

No

HTTP Status Code

Number

The HTTP status code that the create operation returned

No

Result

String

The JSON string of the created FHIR resource

No


Set Up a FHIR Update Action

The FHIR Update action replaces an existing FHIR resource of the specified type by overwriting it completely with data from Kizen.

To set up a FHIR Update action:

1

Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the Input Source dropdown menu, and then configure the source with the additional controls that appear.

The script inputs for the FHIR Update action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

Access Token

String

The access token from the FHIR Authenticate action

Yes

FHIR Base URL

String

The base URL of the FHIR server from the FHIR Authenticate action

Yes

Resource Body

String

The FHIR resource to update as a JSON string

Yes

Resource ID

String

The ID of the FHIR resource to update

Yes

Resource Type

String

The type of the FHIR resource to update in PascalCase, such as Patient or PractitionerRole

Yes

2

Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the Output Destination dropdown menu, and then configure the destination with the additional controls that appear.

The script outputs for the FHIR Update action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

HTTP Status Code

Number

The HTTP status code that the update operation returned

No

Result

String

The JSON string of the updated FHIR resource

No


Set Up a FHIR Patch Action

The FHIR Patch action partially updates a FHIR resource of the specified type with data from Kizen. Unlike FHIR Update, this action doesn't overwrite the resource completely.

To set up a FHIR Patch action:

1

Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the Input Source dropdown menu, and then configure the source with the additional controls that appear.

The script inputs for the FHIR Patch action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

Access Token

String

The access token from the FHIR Authenticate action

Yes

FHIR Base URL

String

The base URL of the FHIR server from the FHIR Authenticate action

Yes

Patch Body

String

The JSON Patch or FHIR Patch string to apply to the FHIR resource.

Yes

Patch Content Type

String

The technical content type of the patch body. The default value is application/json-patch+json.

No

Resource ID

String

The ID of the FHIR resource to patch.

Yes

Resource Type

String

The type of the FHIR resource to patch in PascalCase, such as Patient or PractitionerRole.

Yes

Note: Give the patch body in either the JSON Patch format (RFC 6902) or the FHIR Patch format.

2

Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the Output Destination dropdown menu, and then configure the destination with the additional controls that appear.

The script outputs for the FHIR Patch action in the Add Action modal

The fields are as follows:

Field
Type
Description
Required?

HTTP Status Code

Number

The HTTP status code that the patch operation returned

No

Result

String

The JSON string of the patched FHIR resource

No


What's Next

Continue to Synchronize Data Between FHIR and Kizen in an Agentic Workflow to learn how to use Agentic Workflows to keep your FHIR data in Kizen up to date.


HL7, FHIR, and the FHIR FLAME DESIGN are the registered trademarks of Health Level Seven International, and their use does not constitute endorsement by HL7.

Last updated

Was this helpful?