---
sourceDocument: Brazil Healthcare and Life Sciences
sourceDocumentLink: https://www.servicenow.com/docs/r/healthcare-life-sciences

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Healthcare and Life Sciences

ft:clusterId :

    - hcls

bundleId :

    - hcls

workflow :

    - Customer and Industry


---

# How the FHIR sync works

# How the FHIR sync works {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of How the FHIR sync works

The FHIR sync process in ServiceNow Healthcare Operations automates the import of four key FHIR resources into the platform's data model.
This synchronization runs daily by default, ensuring that healthcare data is current, consistent, and linked correctly across organizations, locations, practitioners, and practitioner roles.
Show full answer Show less  

## Scheduled Orchestration and Dependency Order

A scheduled job named **FHIR Sync --- Daily** triggers an orchestration subflow at 03:00 instance time by default. This subflow sequentially imports four FHIR resources in a strict dependency order to maintain data integrity:

* **Organizations:** Imported first, as they are referenced by other resources.
* **Locations:** Imported second; they reference their managing organization.
* **Practitioners:** Imported third; become users referenced by practitioner roles.
* **PractitionerRoles:** Imported last; reference both organizations and practitioners.

The import halts if any resource fails, preventing inconsistent data states.

## Idempotent Upsert and Data Matching

Each FHIR resource is matched to its corresponding Healthcare Operations record by the FHIR logical ID, stored as `externalid` on key tables (Organization, Location, Practitioner). Related records without an `externalid` are matched using natural keys, such as user email or organization-user pairs for memberships.

This design ensures that re-importing the same resources updates existing records rather than creating duplicates, enabling safe repeated sync runs.

## Initial Load and Delta Sync

The first sync performs a full import of all four FHIR resources. Subsequent syncs operate in delta mode, fetching only records changed since the last successful run based on timestamps stored in the **FHIR Sync Log**. This optimizes performance by minimizing data transfer.

## Logging and Error Handling

Each sync run generates a **FHIR Sync Log** entry per resource type, all linked by a correlation ID. Log entries record start/end times, counts of processed and skipped records, and final status:

* **Completed**
* **Completed with errors**
* **Failed**

Individual record issues---such as missing fields or unresolved references---are logged with correlation IDs and FHIR IDs for troubleshooting. Transport or authentication failures mark the entire resource import as failed and stop the sync.

Administrators can monitor and troubleshoot FHIR sync runs through these logs to ensure data integrity and timely resolution of errors.  
A scheduled job runs an orchestration subflow that imports the four FHIR
resources in dependency order, upserts each into the Healthcare Operations data
model --- matching primary records on the FHIR resource ID --- and records the outcome
in the FHIR Sync Log.

## Scheduled orchestration {#hco-fhir-how-it-works__hco-fhir-hiw-orchestration}

A scheduled job named FHIR Sync --- Daily runs each day
(by default at 03:00 instance time) and starts the
Import FHIR Resources orchestration subflow. The
orchestration subflow generates a correlation ID for the run and then runs the
four per-resource import subflows in order. You can also start a run on demand
with the scheduled job's Execute Now action.

## Dependency order {#hco-fhir-how-it-works__hco-fhir-hiw-order}

The four resources are imported in an order that respects cross-resource
references, and the run stops if an earlier resource fails:

1. **Organizations** --- must exist before locations and practitioner roles can reference them.
2. **Locations** --- reference their managing organization.
3. **Practitioners** --- become users that practitioner roles reference.
4. **PractitionerRoles** --- reference both an organization and a practitioner, so they import last.

## Idempotent upsert {#hco-fhir-how-it-works__hco-fhir-hiw-upsert}

Each FHIR resource is matched to its primary Healthcare record by its FHIR
logical ID, stored as `external_id` on the Healthcare (HCLS)
Organization, Location, and Practitioner tables. Related records that have no
`external_id` column --- business locations, users, and service
organization memberships --- are matched on their natural keys instead, such as a
user by email or a membership by its organization-and-user pair. Re-importing the
same resource updates the existing records rather than creating duplicates, so
repeated runs are safe. For the full field-by-field mapping, see
[FHIR-to-HCLS field
mappings](https://www.servicenow.com/docs/dACh4MQm~7LM0FLs3XaRVw "For each of the four FHIR R4 resources, the Healthcare Operations HL7 FHIR Integration maps FHIR fields to Healthcare Operations target tables and upserts records — matching the primary HCLS record on the FHIR resource ID (stored as an external identifier) and related records on their natural keys.").

## Initial load and delta sync {#hco-fhir-how-it-works__hco-fhir-hiw-delta}

The first run performs a full load of all four resources. Each subsequent run
reads the timestamp of the previous successful run from the FHIR Sync Log and
requests only resources changed since then, so routine syncs transfer only
deltas.

## Logging and error handling {#hco-fhir-how-it-works__hco-fhir-hiw-logging}

Each run writes one FHIR Sync Log row per resource type, all sharing the run's
correlation ID. A row records the start and end times, processed and skipped
counts, and a final status of Completed, Completed with errors, or Failed.
Per-record skips --- such as a resource missing a required field or an
unresolvable reference --- are logged to the system log with the correlation ID
and FHIR ID, while transport or authentication failures set the row status to
Failed and stop the run. For details, see
[Monitor and troubleshoot FHIR
sync runs](https://www.servicenow.com/docs/dmYnjaTBtuKaH4QK30P8_Q "Review the FHIR Sync Log to confirm that sync runs complete and see how many records each run processed or skipped. Trace skipped records and failures to their cause.").

