> For the complete documentation index, see [llms.txt](https://docs.geoprismregistry.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.geoprismregistry.com/readme/current-1/external-system-integration/4.2-register-and-synchronize-an-external-system/4.2.3-fhir.md).

# 4.2.3. FHIR

## 4.2.3.1. Registration

The process for registering a FHIR instance in GeoPrism Registry is as follows:

1. Navigate to the *Settings* page using the burger menu.\\

   <figure><img src="https://lh3.googleusercontent.com/Mjs1dPobR-fLkJrgb4GVHyS4_mCR0stID7QYzh2ZCnPtCuwa0wlL8Sr2LYlyK2XVmCBYX5-HTMnaUn2SiDDg1ICZ9iH5E4KGUL-HnnZ692GVAS0_E4aqULXWF4_XgzAzqm5YBvWyGcF48XPJQvfWSpHISabhWwaZeKh3Byz2ETT3zkZVcE6Au1gP" alt=""><figcaption></figcaption></figure>
2. Scroll down to the *External Systems* section and click on the **+** button to open the *Registration* modal.\\

   <figure><img src="https://3732932512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9giVyCrmTxAs33YrSRbJ%2Fuploads%2FNmO9dQ2Wpzdg9DxWP6jr%2Fimage.png?alt=media&amp;token=c789831a-174b-41be-b1bb-4e321df12028" alt=""><figcaption></figcaption></figure>
3. Select 'FHIR' from the *Type* dropdown and fill out the other fields (descriptions in the table below).\\

   | Field name   | Description                                                                                                                 | Required? |
   | ------------ | --------------------------------------------------------------------------------------------------------------------------- | --------- |
   | Type         | The type of external system.                                                                                                | Yes       |
   | Organization | The organization the user belongs to. An external system will only be available to data and users within this organization. | Yes       |
   | ID           | The identifier for this external system.                                                                                    | Yes       |
   | Label        | The label of the external system.                                                                                           | Yes       |
   | Description  | A description of the external system.                                                                                       | No        |
   | URL          | The URL for the FHIR system.                                                                                                | Yes       |
   | System       | The FHIR system to use when exporting or importing                                                                          | Yes       |

<figure><img src="https://3732932512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9giVyCrmTxAs33YrSRbJ%2Fuploads%2Fgit-blob-0ec288736ca0aec77b51ed2ab6c12babeca954d4%2FScreenshot%202022-11-01%20130337.jpg?alt=media" alt=""><figcaption></figcaption></figure>

## 4.2.3.2. Compatibility

Integration with FHIR requires use of FHIR OAuth security integration. Not all versions of [HAPI FHIR](https://hapifhir.io/) are known to be capable of integrating with GeoPrism Registry via OAuth. The following table shows whether or not the steps in this document have been found to work with the listed version of HAPI FHIR.

| HAPPI FHIR version | Integration via OAuth possible? |
| ------------------ | ------------------------------- |
| 5.3.0              | Yes                             |

## 4.2.3.3. Synchronization

{% hint style="info" %}
A registered FHIR external system must exist in GeoPrism Registry.
{% endhint %}

{% hint style="info" %}
A system synchronization must be created separately for a pull and push of data. GeoPrism Registry does not support using one external synchronization that does both a pull and a push.
{% endhint %}

External system synchronizations enable the ability to push and pull data between a GeoPrism Registry instance and a FHIR instance.

### A. Pushing data to FHIR instance from a GeoPrism Registry instance <a href="#pushing-data-to-fhir-from-the-cgr" id="pushing-data-to-fhir-from-the-cgr"></a>

1. Navigate to the *Settings* page.
2. Find the *External System Synchronizations* section and click the + button to register synchronizations.
3. Click the create button on the *Synchronization Configurations* page.\\

   <figure><img src="https://lh4.googleusercontent.com/266T4bH2_5Q0C-oJ1VxvtdZIwrlnZM750n0HvEVnddkht0vxVNv4k9bB9KlynvGxsSERlUUUeQQ-SGAIu7UPj75ceWZelha7PrMPFF25YTiIEsHyecXZ1OLfyBVb4Dhc1WMaBdHK9aZpZpSh0kkQ2xZycnOmRF25kEiG7z7kFvZxr2DclU8x_A9Fxg" alt=""><figcaption></figcaption></figure>
4. Fill out the modal fields being sure to select *Export* for the *Synchronization Type*.\\

   <figure><img src="https://3732932512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9giVyCrmTxAs33YrSRbJ%2Fuploads%2Fgit-blob-e5f331e2fc6ec20fc6e0ccd0e6cc67c9b09af42b%2FScreenshot%202022-11-01%20134209.jpg?alt=media" alt=""><figcaption></figcaption></figure>

   | Field           | Description                                                                                               |
   | --------------- | --------------------------------------------------------------------------------------------------------- |
   | Label           | Label of the synchronization configuration.                                                               |
   | Organization    | The organization the synchronization configuration will be available to.                                  |
   | Hierarchy       | The hierarchy this synchronization will use to push data to an external system.                           |
   | External System | The registered external system that this synchronization will use to push data to an external system.     |
   | Org Units       | A mapping between the Geo-Object Types in the selected GPR hierarchy and the types in the DHIS2 instance. |
5. Click Submit.

### B. Pulling data from a FHIR instance to a GeoPrism Registry instance

{% hint style="danger" %}
Pulling data from a FHIR instance to GeoPrism Registry requires a custom transformation to be integrated with the GeoPrism Registry instance which defines how data is pulled into GeoPrism Registry. Contact your System Administrator to get more information. System Administrators can see [section 3.7](https://github.com/terraframe/geoprism-registry-documentation/blob/main/readme/current/deployment-and-setup/3.7-fhir-custom-implementation) for documentation on how to setup the FHIR custom implementations.
{% endhint %}

1. Navigate to the Settings page.
2. Find the *External System Synchronizations* section and click the **+** button to register synchronizations.
3. Click the **Create** button on the *Synchronization Configurations* page.\\

   <figure><img src="https://lh4.googleusercontent.com/266T4bH2_5Q0C-oJ1VxvtdZIwrlnZM750n0HvEVnddkht0vxVNv4k9bB9KlynvGxsSERlUUUeQQ-SGAIu7UPj75ceWZelha7PrMPFF25YTiIEsHyecXZ1OLfyBVb4Dhc1WMaBdHK9aZpZpSh0kkQ2xZycnOmRF25kEiG7z7kFvZxr2DclU8x_A9Fxg" alt=""><figcaption></figcaption></figure>
4. Fill out the modal fields being sure to select 'Import' for the *Synchronization Type*.\\

   | Field           | Description                                                                                           |     |
   | --------------- | ----------------------------------------------------------------------------------------------------- | --- |
   | Label           | Label of the synchronization configuration.                                                           | Yes |
   | Organization    | The organization the synchronization configuration will be available to.                              | Yes |
   | External System | The registered external system that this synchronization will use to push data to an external system. | Yes |
   | Synchronization | Export data to the FHIR instance or Import data to the GeoPrism Registry instance.                    | Yes |
   | Type            | The GeoPrism Registry instance.                                                                       | Yes |
   | Implementation  | The custom implementation of a HAPI FHIR synchronization configuration.                               | Yes |

   <figure><img src="https://lh5.googleusercontent.com/exnu4HLjcpICJ4BE2i5AbridnGwmjkNmnrnr215Q60CB8oh3_Tc7iXgBKhRgtmFhli_5BVdDLN1_ZCrTDBL-hm5RGwUSeSTLlEP-L50gP3H80Gjg1_W_88I2TNuXW_RLv5s92K31PAGePNMdcIsJ2Sm5Jly0sbqIgolm1QrZ8ZJkkHSuXZu9Bss8sA" alt=""><figcaption></figcaption></figure>
5. Click **Submit**.

### C. Run a synchronization <a href="#execute-a-synchronization" id="execute-a-synchronization"></a>

1. Navigate to the *Setting* page.
2. Find the *External System Synchronizations* section and scroll to an existing configuration.
3. Click on the **View** button of the FHIR configuration.
4. Click the view button on the FHIR configuration row.

   <figure><img src="https://3732932512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9giVyCrmTxAs33YrSRbJ%2Fuploads%2FKO2nDToM2YAIbqyPtpDL%2Fimage.png?alt=media&amp;token=fe5d9b35-3e27-4323-b54a-fccb6a3d9fe9" alt=""><figcaption></figcaption></figure>
5. On the synchronization page click the “Run now“ button to queue a new synchronization job. The results of the job will appear in the “Jobs“ section lower on the page. The user can also click on “Generate Bundle“ to generate a JSON bundle of the data which would be exported.

\
\\
