diff --git a/content/en/building/concepts/interoperability.md b/content/en/building/concepts/interoperability.md
index db3e5c12c..79ffc5d61 100644
--- a/content/en/building/concepts/interoperability.md
+++ b/content/en/building/concepts/interoperability.md
@@ -7,7 +7,9 @@ description: >
keywords: interoperability integrations fhir icd openhie openhim
relatedContent: >
building/features/integrations
- building/guides/interoperability/fhir
+ building/guides/interoperability/cht-config
+ building/guides/interoperability/openhim
+ building/guides/interoperability/ltfu
aliases:
- /apps/concepts/interoperability
---
diff --git a/content/en/building/guides/interoperability/fhir.md b/content/en/building/guides/interoperability/cht-config.md
similarity index 98%
rename from content/en/building/guides/interoperability/fhir.md
rename to content/en/building/guides/interoperability/cht-config.md
index ba07d14ce..d40ad42b0 100644
--- a/content/en/building/guides/interoperability/fhir.md
+++ b/content/en/building/guides/interoperability/cht-config.md
@@ -1,12 +1,14 @@
---
-title: "Building Interoperability with FHIR systems"
-linkTitle: "Building Interoperability with FHIR systems"
-weight:
+title: "Configuring CHT applications for interoperability workflows"
+linkTitle: "Configuring"
+weight: 1
description: >
- Exchange patients and reports with FHIR compliant systems
+ Guide to setting up forms and outbound push for interoperability
keywords: interoperability fhir integrations openmrs
aliases:
- /building/guides/integrations/fhir/
+ - /building/guides/interoperability/fhir/
+ - /building/guides/interoperability/cht-config/
relatedContent: >
building/concepts/interoperability/
---
@@ -296,7 +298,7 @@ Using the above example form, this transition will create a patient document and
`Encounters` and `Observations` created by interoperating systems can be sent to the CHT to be visible to CHT users.
Similarly to patients, a mediator converts the FHIR resources to a json format that is submitted to the records API.
Reports need to be linked to patients using a `patient_id` field which is the uuid of the patient document in CHT. The mediator extracts this id from the `CHT Document ID` identifier of the FHIR `Patient`.
-For patients created by CHT, they need to have been sent to the interoperating system before receiving any reports. For patients created by the interoperating system, the `CHT Document ID` needs to have been set; see the section below on [Patient Ids]({{< ref "building/guides/interoperability/fhir#populating-ids" >}}).
+For patients created by CHT, they need to have been sent to the interoperating system before receiving any reports. For patients created by the interoperating system, the `CHT Document ID` needs to have been set; see the section below on [Patient Ids](#populating-ids).
A CHT form needs to be configured to receive the reports via the records API.
In the form configuration, the names of fields which should be extracted from `Observations` should be the codes of the `Observations`. Human readable labels can be added for display.
diff --git a/content/en/building/guides/interoperability/ltfu.md b/content/en/building/guides/interoperability/ltfu.md
new file mode 100644
index 000000000..4e6bc7e72
--- /dev/null
+++ b/content/en/building/guides/interoperability/ltfu.md
@@ -0,0 +1,429 @@
+---
+title: "Loss To Follow-Up reference workflow"
+linkTitle: "Loss To Follow-Up"
+weight: 3
+description: >
+ Guide to testing the Loss to Follow-Up (LTFU) reference workflow
+keywords: openmrs interoperability
+relatedContent: >
+ building/guides/interoperability/cht-config
+ building/concepts/interoperability/
+---
+
+## Workflow Testing
+
+This section outlines the steps for testing the Loss To Follow-Up (LTFU) workflow, in addition to documenting the various endpoints available on the mediator. It provides a comprehensive guide on navigating the LTFU workflow and utilizing the endpoints to facilitate the necessary actions.
+
+## Environments
+
+The section includes placeholders for URLs. Replacing these placeholders with the appropriate endpoints for your specific environment is essential to utilize the guide correctly. Below are the endpoints provided for each available environment. It is important to note that if your setup differs from the documentation provided, you may need to use different endpoints. By ensuring that the correct endpoints are used, you can be confident in successfully implementing and utilizing the LTFU workflow.
+
+### Docker - Local Setup
+
+- **Mediator (`${MEDIATOR_ENDPOINT}`)** - http://localhost:5001/mediator
+- **OpenHIM Admin Console** - http://localhost:9000/
+- **CHT with LTFU configuration** - http://localhost:5988/
+
+## Steps
+
+The following steps assume you have running OpenHIM and CHT instances you successfully logged into.
+See the [OpenHIM guide]({{< ref "building/guides/interoperability/openhim" >}}) for instructions to set up a local development instance of OpenHIM.
+
+1. Create an **Endpoint** and an **Organization**
+
+ 1. **HTTP Request** - Use Postman to create an `Endpoint` Resource in the Mediator. You can view the API documentation for creating an `Endpoint` [here](#endpoint-resource). Once you send the request, the Mediator will return a JSON response containing the `id` of the newly created endpoint. Save this `id` for the next step.
+
+ 1. **HTTP Request** - Create an `Organization` Resource in the Mediator using as `endpoint.reference` the example value replacing `${ENDPOINT_ID}` with the actual `id` of the `Endpoint` you created in the previous step. Once you send the request, the Mediator will return a JSON response containing the `id` of the newly created `Organization`. You can view the API documentation for creating an `Organization` [here](#organization-resource).
+
+> It is important to note that you only need to create an `Organization` once, which you can use for future requests. So, after creating the `Organization`, you can save the `organization.identifier[0].value` value and use it for all future `ServiceRequest` requests.
+
+
+2. Create a **Patient**
+
+ 1. **CHT** - Log in to the CHT platform using the credentials for the `chw` user. If the `chw` user does not already exist, you can [create one]({{< ref "building/contact-management/contact-and-users-1#4-create-the-chw-user" >}}).
+ 1. **CHT** - Navigate to the `People` tab in the CHT dashboard. From there, select a Facility where you want to create a new `Person`. Click on the `New Person` button and fill in the required details for the Person. Make sure to select `Patient` as the `Person`'s role for this flow.
+ 1. **CHT** - Once you have created the new `Person`, you need to retrieve their unique identifier from the browser's URL. You can do this by copying the alphanumeric string that appears after `person/` in the URL. Keep this identifier safe as you will need it for the next steps.
+ 1. **OpenHIM Admin Console** - To verify that the `Patient` creation was successful, navigate to the `Transaction Log` in the OpenHIM Admin Console. You should see two successful API calls recorded in the log, one to `/mediator/patient/` and one to `/fhir/Patient/`.
+ 
+
+3. Request the LTFU for the Patient
+
+ 1. **HTTP Request** - To trigger the LTFU process for the newly created patient, you need to create a `ServiceRequest`. You can refer to the API documentation available [here](#servicerequest-resource) to learn how to create a `ServiceRequest`. Replace the `requester.reference` and the `subject.reference` with the `Organization` and `Patient` identifiers respectively. Once the `ServiceRequest` is received by the mediator, it will initiate the LTFU workflow for the patient, which includes reminders for follow-up appointments and check-ins.
+
+ 1. **HTTP Request** - Verify that the `ServiceRequest` was successful in both OpenHIM Mediator & FHIR Resource. Navigate to the `Transaction Log` in the Admin Console. You should see three successful API calls, as in the image below:
+ 
+
+4. Handle LTFU Task
+
+ 1. **CHT** - Navigate to the `Tasks` tab. There should be an automatically created `Task` for the Patient. If it is not the case, sync data via `Sync now` option. The `Task` should look like in the image below:
+
+
+
+ 1. **CHT** - Select an option (Yes or No) and submit the `Tasks`.
+ 1. **OpenHIM Admin Console** - Verify that the Encounter creation was successful in both OpenHIM Mediator & FHIR Resource. Navigate to the `Transaction Log` in the Admin Console. You should see two successful API calls, one to `/mediator/encounter/` and one to `/fhir/Encounter/`, as in the image below.
+ 
+ 1. If your callback URL test service was set up correctly, you should receive a notification from the mediator.
+
+
+An API test collection that can be used with Postman or similar tools can be found under `/docs/local-test` in the [cht-interoperability repository](https://github.com/medic/cht-interoperability/tree/main/docs/local-test). This collection allows testing the LTFU flow while running the instances locally.
+
+## Resources
+
+The following [FHIR Resources](https://www.hl7.org/fhir/resource.html) are used to implement the flow above:
+
+- [Patient](https://www.hl7.org/fhir/patient.html)
+- [Encounter](https://build.fhir.org/encounter.html)
+- [Subscription](https://build.fhir.org/subscription.html)
+- [Organization](https://build.fhir.org/organization.html)
+- [Endpoint](https://build.fhir.org/endpoint.html)
+
+The payload samples in the documentation contain placeholder values you must replace with the actual content. To do so, replace the entire `${}` placeholder with the appropriate value. Be aware that some placeholder keys have the format `_\_IDENTIFIER` and refer to the value in the `Resource.identifier[0].value` field. These keys differ from the `_\_ID` placeholders used in the request, which refer to the `Resource.id` field. It is important to make this distinction, as using the wrong value may cause unexpected behavior in the system. Therefore, always ensure you use the right value in the right context to avoid errors.
+
+
+> **Note:** The payload only contains the required fields or a subset of the possible options. Please refer to the appropriate FHIR resource specifications to view all the available fields.
+
+
+### `ServiceRequest` Resource
+
+The FHIR `ServiceRequest` resource represents a request for a healthcare service to be performed, such as a diagnostic test or a treatment. It contains information about the requested service, including the **type of service**, the **patient** for whom the service is requested, the **date/time the service is requested**, and the **healthcare provider or organization** making the request. In the context of the LTFU workflow, this resource is used to request a CHW follow-up in the CHT.
+
+#### `POST ${MEDIATOR_ENDPOINT}/service-request`
+
+This endpoint triggers the creation of a `record` on `CHT` and a `Subscription` resource on FHIR. The endpoint associated with the `Organization` resource in the requester is used as the callback URL for the `Subscription` which gets called when FHIR receives an `Encounter` resource with matching `Patient` identifier. The callback endpoint receives a FHIR `Subscription` response as its payload whenever the request is fulfilled. To learn more about FHIR
+subscriptions, you can visit the official documentation [here](https://build.fhir.org/subscription.html).
+
+##### Request
+
+```http
+POST ${MEDIATOR_ENDPOINT}/service-request
+```
+```json
+{
+ "intent": "order",
+ "subject": {
+ "reference": "Patient/${PATIENT_IDENTIFIER}"
+ },
+ "requester": {
+ "reference": "Organization/${ORGANIZATION_IDENTIFIER}"
+ }
+ ,
+ "status": "active"
+}
+```
+
+##### Response
+
+```json
+{
+ "resourceType": "Subscription",
+ "id": "4",
+ "meta": {
+ "versionId": "1",
+ "lastUpdated": "2023-04-19T04:41:17.656+00:00",
+ "tag": [
+ {
+ "system": "http://hapifhir.io/fhir/StructureDefinition/subscription-matching-strategy",
+ "code": "IN_MEMORY",
+ "display": "In-memory"
+ }
+ ]
+ },
+ "status": "requested",
+ "reason": "Follow up request for patient",
+ "criteria": "Encounter?identifier=003b24b5-2396-4d95-bcbc-5a4c63f43ff0",
+ "channel": {
+ "type": "rest-hook",
+ "endpoint": "https://callback.com",
+ "payload": "application/fhir+json",
+ "header": ["Content-Type: application/fhir+json"]
+ }
+}
+```
+
+### `Endpoint` Resource
+
+The FHIR `Endpoint` resource describes the network address of a system or service where messages or payloads can be exchanged. It defines the communication characteristics for sending and receiving messages, such as the **transport protocol**, the **payload format**, and the **messaging endpoint's address**. The `Endpoint` resource can specify where to send data for specific purposes, such as notifications, alerts, or reports. It can be used in various contexts, such as clinical care, public health, or research, where different systems or services need to exchange data seamlessly.
+
+#### `POST ${MEDIATOR_ENDPOINT}/endpoint`
+
+In the LTFU workflow, the `Endpoint` is crucial in creating a `ServiceRequest`. It is obtained from the `Organization` attached to the `ServiceRequest` as the requester. The `Endpoint` represents the destination where the FHIR server sends notifications about matching `Encounter` resources. When the FHIR server receives a matching `Encounter` resource, it sends a notification to the endpoint. The endpoint is used as a **callback URL** for the FHIR server to notify the requester about the status of the `ServiceRequest`. Therefore, ensuring that the endpoint is accurate and valid for successful communication between the FHIR server and the requesting system is important.
+
+- **ENDPOINT_ID:** _(Optional)_ A preferred `id` for the `Endpoint`. By default, the mediator will generate an `id` for the `Endpoint`.
+- **ENDPOINT_IDENTIFIER:** An identifier for the `Endpoint` that can be used when querying the FHIR database in the future.
+- **ORG_CALLBACK_URL:** A callback URL that the mediator can use to contact the requesting system (`Organization`) in the future when a `ServiceRequest` has been fulfilled.
+
+> **NOTE** The FHIR `Subscription` that will be created ulteriorly requires `ORG_CALLBACK_URL` to accept HTTP `PUT` requests matching this path `${ORG_CALLBACK_URL}/:resourceType/:resourceId` and return a 200. In this workflow, the callback should expect to receive an `Encounter` resource sent back to the requesting system on `${ORG_CALLBACK_URL}/Encounter/:id`.
+
+##### Request
+
+
+```http
+POST ${MEDIATOR_ENDPOINT}/endpoint
+```
+```json
+{
+ "id": "${ENDPOINT_ID}",
+ "identifier": [
+ {
+ "system": "official",
+ "value": "${ENDPOINT_IDENTIFIER}"
+ }
+ ],
+ "connectionType": {
+ "system": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type",
+ "code": "hl7-fhir-rest"
+ },
+ "payloadType": [
+ {
+ "text": "application/json"
+ }
+ ],
+ "address": "${ORG_CALLBACK_URL}",
+ "status": "active"
+}
+```
+
+##### Response
+
+
+```json
+{
+ "resourceType": "Endpoint",
+ "id": "1",
+ "meta": {
+ "versionId": "1",
+ "lastUpdated": "2023-04-19T04:40:44.401+00:00"
+ },
+ "identifier": [
+ {
+ "system": "official",
+ "value": "ENDPOINT_ID"
+ }
+ ],
+ "status": "active",
+ "connectionType": {
+ "system": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type",
+ "code": "hl7-fhir-rest"
+ },
+ "payloadType": [
+ {
+ "text": "application/json"
+ }
+ ],
+ "address": "https://callback.com"
+}
+```
+
+### `Patient` Resource
+
+The FHIR `Patient` resource represents an individual receiving or awaiting healthcare services. It includes **patient demographics**, **clinical observations**, and **medical history**. It is a foundational resource in healthcare and can be used to track patient progress, manage care plans, and facilitate communication between healthcare providers.
+
+#### `POST ${MEDIATOR_ENDPOINT}/patient`
+
+This endpoint creates a `Patient` in the LFTU workflow. Patients are created by CHT automatically whenever a new Patient is added to the system.
+
+##### Request
+
+```http
+POST ${MEDIATOR_ENDPOINT}/patient
+```
+```json
+{
+ "identifier": [
+ {
+ "system": "official",
+ "value": "${PATIENT_IDENTIFIER}"
+ }
+ ],
+ "name": [
+ {
+ "family": "Doe",
+ "given": [
+ "John"
+ ]
+ }
+ ],
+ "gender": "male",
+ "birthDate": "2000-01-01"
+}
+```
+
+##### Response
+
+
+```json
+{
+ "resourceType": "Patient",
+ "id": "3",
+ "meta": {
+ "versionId": "1",
+ "lastUpdated": "2023-04-19T04:41:01.217+00:00"
+ },
+ "text": {
+ "status": "generated",
+ "div": "
Identifier | 003b24b5-2396-4d95-bcbc-5a4c63f43ff0 |
Date of birth | 01 January 2000 |
"
+ },
+ "identifier": [
+ {
+ "system": "official",
+ "value": "003b24b5-2396-4d95-bcbc-5a4c63f43ff0"
+ }
+ ],
+ "name": [
+ {
+ "family": "Doe",
+ "given": ["John"]
+ }
+ ],
+ "gender": "male",
+ "birthDate": "2000-01-01"
+}
+```
+
+### `Encounter` Resource
+
+The FHIR `Encounter` resource represents a clinical interaction between a patient and a healthcare provider. It contains information about the **patient's visit**, such as the **location**, the **reason for the visit**, and any relevant **procedures** or **diagnoses**.
+
+#### `POST ${MEDIATOR_ENDPOINT}/encounter`
+
+The `Encounter` resource is an essential part of the LTFU workflow, which is automatically created by the CHT system after a CHW completes the workflow. It triggers FHIR to send a `Subscription` response to the requesting system when there is a match with the `Encounter` resource. This allows for efficient monitoring and follow-up care of patients in the LTFU workflow.
+
+
+**ENCOUNTER_IDENTIFIER:** An identifier for the encounter that can be used when querying the FHIR database in the future. Ideally, it should point to a document on the source system (CHT) that represents this encounter.
+
+> NOTE: The `ENCOUNTER_IDENTIFIER` should be the same as the `PATIENT_IDENTIFIER`. The FHIR Subscription won't be resolved properly if they don't match. Updating an existing `Encounter` will also trigger pending `Subscription` that matches the `Encounter` document, which is one of the downsides of using this method. You can learn more about it by visiting [Official FHIR Subscription Resource Scope](https://fhir-ru.github.io/subscription.html#scope).
+
+
+##### Request
+
+
+```http
+POST ${MEDIATOR_ENDPOINT}/encounter
+```
+```json
+{
+ "resourceType": "Encounter",
+ "identifier": [
+ {
+ "system": "cht",
+ "value": "${ENCOUNTER_IDENTIFIER}"
+ }
+ ],
+ "status": "finished",
+ "class": "outpatient",
+ "type": [
+ {
+ "text": "Community health worker visit"
+ }
+ ],
+ "subject": {
+ "reference": "Patient/${PATIENT_IDENTIFIER}"
+ },
+ "participant": [
+ {
+ "type": [
+ {
+ "text": "Community health worker"
+ }
+ ]
+ }
+ ]
+}
+```
+
+##### Response
+
+
+```json
+{
+ "resourceType": "Encounter",
+ "id": "5",
+ "meta": {
+ "versionId": "1",
+ "lastUpdated": "2023-04-19T05:00:18.031+00:00"
+ },
+ "identifier": [
+ {
+ "system": "cht",
+ "value": "003b24b5-2396-4d95-bcbc-5a4c63f43ff0"
+ }
+ ],
+ "status": "finished",
+ "type": [
+ {
+ "text": "Community health worker visit"
+ }
+ ],
+ "subject": {
+ "reference": "Patient/3"
+ },
+ "participant": [
+ {
+ "type": [
+ {
+ "text": "Community health worker"
+ }
+ ]
+ }
+ ]
+}
+```
+
+### `Organization` Resource
+
+The FHIR `Organization` resource represents a group of people or entities with a common purpose or focus. It contains the organization's **name**, **type**, and **contact details**. This resource is often used in healthcare settings to represent healthcare providers, hospitals, clinics, and other organizations involved in patient care. In the LTFU workflow, it represents the **Requesting System**, and it points to its `callback URL`.
+
+#### `POST ${MEDIATOR_ENDPOINT}/organization`
+
+The `Organization` resource in the LTFU workflow represents the Requesting System. Before creating an `Organization`, an `Endpoint` must be created. The `${ORGANIZATION_IDENTIFIER}` is intended to be randomly assigned by the requesting system. It is important to take note of this identifier, as it will be used in future `ServiceRequest`'s to identify the requesting system.
+
+##### Request
+
+
+```http
+POST ${MEDIATOR_ENDPOINT}/organization
+```
+```json
+{
+ "identifier": [
+ {
+ "system": "official",
+ "value": "${ORGANIZATION_IDENTIFIER}"
+ }
+ ],
+ "name": [
+ "Athena"
+ ],
+ "endpoint": [
+ {
+ "reference": "Endpoint/${ENDPOINT_ID}"
+ }
+ ]
+}
+```
+
+##### Response
+
+
+```json
+{
+ "resourceType": "Organization",
+ "id": "2",
+ "meta": {
+ "versionId": "1",
+ "lastUpdated": "2023-04-19T04:40:48.663+00:00"
+ },
+ "identifier": [
+ {
+ "system": "official",
+ "value": "003b24b5-2396-4d95-bcbc-5a4c63f43ff0"
+ }
+ ],
+ "name": "Athena",
+ "endpoint": [
+ {
+ "reference": "Endpoint/1"
+ }
+ ]
+}
+```
diff --git a/content/en/building/guides/interoperability/ltfu/instance-encounter.png b/content/en/building/guides/interoperability/ltfu/instance-encounter.png
new file mode 100644
index 000000000..02c2ade94
Binary files /dev/null and b/content/en/building/guides/interoperability/ltfu/instance-encounter.png differ
diff --git a/content/en/building/guides/interoperability/ltfu/instance-patient.png b/content/en/building/guides/interoperability/ltfu/instance-patient.png
new file mode 100644
index 000000000..af4721ed6
Binary files /dev/null and b/content/en/building/guides/interoperability/ltfu/instance-patient.png differ
diff --git a/content/en/building/guides/interoperability/ltfu/instance-service-request.png b/content/en/building/guides/interoperability/ltfu/instance-service-request.png
new file mode 100644
index 000000000..55b1003fc
Binary files /dev/null and b/content/en/building/guides/interoperability/ltfu/instance-service-request.png differ
diff --git a/content/en/building/guides/interoperability/ltfu/task.png b/content/en/building/guides/interoperability/ltfu/task.png
new file mode 100644
index 000000000..6629bf522
Binary files /dev/null and b/content/en/building/guides/interoperability/ltfu/task.png differ
diff --git a/content/en/building/guides/interoperability/openhim.md b/content/en/building/guides/interoperability/openhim.md
new file mode 100644
index 000000000..50fd0dfec
--- /dev/null
+++ b/content/en/building/guides/interoperability/openhim.md
@@ -0,0 +1,158 @@
+---
+title: "OpenHIM Mediators"
+linkTitle: "OpenHIM Mediators"
+weight: 2
+description: >
+ Guide to running OpenHIM and Mediators with Docker Compose
+keywords: openmrs interoperability
+relatedContent: >
+ building/guides/interoperability/cht-config
+ building/guides/interoperability/ltfu
+ building/concepts/interoperability/
+ building/guides/integrations/openmrs/
+---
+
+### Overview
+
+The components and reference information for interoperability used in CHT Interoperability project are:
+
+- [OpenHIE](https://ohie.org/) defines the architecture for an interoperability layer.
+- [OpenHIM](http://openhim.org/) is a middleware component designed to ease interoperability between systems.
+- [HL7 FHIR](https://www.hl7.org/fhir/index.html) is a messaging format to allow all systems to understand the format of the message.
+
+#### Interoperability with the CHT
+
+The structure of documents in the CHT database reflects the configuration of the system, and therefore, does not map directly to a FHIR message format. To achieve interoperability, the CHT uses a middleware to convert the CHT data structure into a standardized form so the other systems can read it. Below is the standard data workflow:
+
+
+
+CHT Interoperability uses OpenHIM as the middleware component with [Mediators](http://openhim.org/docs/configuration/mediators/) to do the conversion. [Outbound Push]({{< ref "building/reference/app-settings/outbound" >}}) is configured to make a request to the middleware when relevant documents are created or modified in the CHT. A Mediator then creates a FHIR resource which is then routed to OpenHIM. OpenHIM routes the resource to any other configured systems.
+
+Conversely, to bring data into the CHT, OpenHIM is configured to route the updated resource to the Mediator, which then calls the relevant [CHT APIs]({{< ref "building/reference/api" >}}) to update the document in the CHT database. This will then be replicated to users’ devices as per usual.
+
+See more information on the [CHT interoperability page]({{< ref "building/concepts/interoperability" >}}).
+
+### Prerequisites
+
+- `docker`
+- `Postman` or similar tool for API testing.
+- [cht-interoperability](https://github.com/medic/cht-interoperability) GitHub repository (can be cloned via `git clone https://github.com/medic/cht-interoperability`).
+
+
+{{% alert title="Note" %}}
+Users getting errors when running the following installation steps, please see the [Troubleshooting guide]({{< ref "#troubleshooting" >}}).
+{{% /alert %}}
+
+### Install & First Time Run
+
+In the cht-interoperability folder, run `./startup.sh init` to start up the docker containers on the first run or after calling `./startup.sh destroy`. Use `./startup.sh up` for subsequent runs after calling `init` without calling `destroy`.
+
+### OpenHIM Admin Console
+
+1. Visit the OpenHIM Admin Console at [http://localhost:9000](http://localhost:9000) and login with the following credentials: email - `interop@openhim.org` and password - `interop-password`. The default User username for OpenHIM is `interop@openhim.org` and password is `interop-password`. The default Client username is `interop-client` and password is `interop-password`.
+
+1. Once logged in, visit [http://localhost:9000/#!/mediators](http://localhost:9000/#!/mediators) and select the mediator named 'CHT Mediator'.
+
+1. Select the green `+` button to the right of the default channel to add the mediator.
+
+1. You can test the CHT mediator by running:
+
+```bash
+curl -X GET http://localhost:5001/mediator -H "Authorization: Basic $(echo -n interop-client:interop-password | base64)"
+```
+
+You should get as a response similar to this:
+
+```json
+{
+ "status": "success",
+ "osuptime": 74012.24,
+ "processuptime": 56940.700039383
+}
+```
+
+If everything is successful, when visiting [http://localhost:9000/#!/clients](http://localhost:9000/#!/clients) you should see this:
+
+
+
+For testing other mediators, replace the URL (http://localhost:5001/mediator) with the appropriate values for the specific mediator you are testing.
+For example if using the OpenMRS mediator, you can test it by running:
+
+```bash
+curl -X GET localhost:5001/mediator/openmrs/sync -H "Authorization: Basic $(echo -n interop-client:interop-password | base64)"
+```
+
+### CHT configuration with Docker
+
+The following steps apply when running CHT via the Docker setup provided in the cht-interoperability repository:
+
+1. CHT can be accessed via [http://localhost:5988](http://localhost:5988), and the credentials are `admin`/`password`.
+2. Create a new user in the CHT instance with the username `interop-client` using these [instructions]({{< ref "building/contact-management/contact-and-users-1#4-create-the-chw-user" >}}). For the role you can select `Data entry` and `Analytics` roles. Please note that you can use any username you prefer but you would have to update the config with the new username. You can do that by editing the `cht-config/app_settings.json` file and updating the `username` value in the `outbound` object e.g. on this [line](https://github.com/medic/interoperability/blob/main/cht-config/app_settings.json#L452).
+3. Securely save the `interop-client` user's password to the database using the instructions [here]({{< ref "building/reference/api#credentials" >}}). Change the values `mykey` and `my pass` to `openhim1` and your user's password respectively. An example of the curl request is below:
+
+```bash
+curl -X PUT -H "Content-Type: text/plain" http://admin:password@localhost:5988/api/v1/credentials/openhim1 -d 'interop-password'
+```
+
+### Local setup of CHT Configuration
+
+The following steps apply when running CHT locally in development mode and when making configuration changes locally:
+
+#### CHT Development Environment
+
+1. Set up a local CHT instance using [these instructions]({{< ref "building/local-setup" >}}).
+2. Create a new user in the CHT instance with the username `interop-client` using these [instructions]({{< ref "building/contact-management/contact-and-users-1#4-create-the-chw-user" >}}). For the role you can select `Data entry` and `Analytics` roles. Please note that you can use any username you prefer but you would have to update the config with the new username. You can do that by editing the `cht-config/app_settings.json` file and updating the `username` value in the `outbound` object e.g. on this [line](https://github.com/medic/interoperability/blob/main/cht-config/app_settings.json#L452).
+3. Securely save the `interop-client` user's password to the database using the instructions [here]({{< ref "building/reference/api#credentials" >}}). Change the values `mykey` and `my pass` to `openhim1` and your user's password respectively. An example of the curls request is below:
+
+```bash
+curl -X PUT -H "Content-Type: text/plain" http://medic:password@localhost:5988/api/v1/credentials/openhim1 -d 'interop-password'
+```
+4. After updating the mediator code or the CHT configuration, you need to run `./startup.sh up-dev` to upload the changes to docker compose.
+
+#### CHT Configuration
+
+1. Go into the `cht-config` directory by running `cd cht-config`.
+1. Run `npm install` to install the dependencies.
+1. Create a file named `.env` under `/mediator` folder, copy over the contents of `/mediator/.env.template` and update the `CHT_USERNAME` and `CHT_PASSWORD` values with the admin credentials of your CHT instance.
+1. Set up a proxy to your local CHT instance by running using something like [nginx-local-ip](https://github.com/medic/nginx-local-ip) or [ngrok](https://ngrok.com/) and update the `CHT_URL` value in the `.env` file with the new URL.
+1. Ensure you have [cht-conf](https://www.npmjs.com/package/cht-conf) installed and run `cht --local` to compile and upload the app settings configuration to your local CHT instance.
+1. To verify if the configuration is loaded correctly is to create a `Patient` and to access a URL like `https://*****.my.local-ip.co/#/contacts/patientUUID/report/interop_follow_up`. This should retrieve correctly the follow up form.
+1. To verify if the configuration in CouchDB, access `http://localhost:5984/_utils/#database/medic/settings`.
+
+### Shutdown the servers
+
+- To shut-down the containers run `./startup.sh down` to stop the instances.
+- To then restart the containers, run `./startup.sh up`. You do not need to run `init` again like you did in the initial install above.
+- To shut-down and delete _everything_, run `./startup.sh destroy`. You will have to subsequently run `./startup.sh init` if you wish to start the containers.
+
+### Troubleshooting
+
+#### Error "bind: address already in use"
+Users encountering:
+
+> Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5000 -> 0.0.0.0:0: listen tcp 0.0.0.0:5000: bind: address already in use
+
+when running `./startup.sh init` need to update ports to available values in the `/docker/docker-compose.yml` file, under the `ports` verb.
+
+#### Error when running mediator `curl` request
+If the mediator `curl` request fails, visit [http://localhost:9000/#!/clients](http://localhost:9000/#!/clients) and click on the icon the red arrow points to in the image below.
+
+
+
+#### Error "Preset ts-jest is invalid:" when running `npm test`
+Users encountering the error below when running `npm test`:
+
+> Preset ts-jest is invalid:
+> The "id" argument must be of type string. Received null
+> TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received null
+
+need to run `npm i --save-dev ts-jest` before running `npm test`.
+
+#### Error "unsuccessful npm install" when running `npm install`
+Users encountering the error when running `npm install`:
+
+> npm ERR! code EACCES
+> npm ERR! syscall unlink
+> npm ERR! path /Users/phil/interoperability/cht-config/node_modules/.package-lock.json
+
+need to run `npm install` as root user.
diff --git a/content/en/building/guides/interoperability/openhim/bad-client-screen.png b/content/en/building/guides/interoperability/openhim/bad-client-screen.png
new file mode 100644
index 000000000..8ad64f758
Binary files /dev/null and b/content/en/building/guides/interoperability/openhim/bad-client-screen.png differ
diff --git a/content/en/building/guides/interoperability/openhim/flow.png b/content/en/building/guides/interoperability/openhim/flow.png
new file mode 100644
index 000000000..cdd640f91
Binary files /dev/null and b/content/en/building/guides/interoperability/openhim/flow.png differ
diff --git a/content/en/building/guides/interoperability/openhim/good-client-screen.png b/content/en/building/guides/interoperability/openhim/good-client-screen.png
new file mode 100644
index 000000000..b3c1b5831
Binary files /dev/null and b/content/en/building/guides/interoperability/openhim/good-client-screen.png differ
diff --git a/content/en/building/guides/interoperability/openmrs.md b/content/en/building/guides/interoperability/openmrs.md
new file mode 100644
index 000000000..5bf82185d
--- /dev/null
+++ b/content/en/building/guides/interoperability/openmrs.md
@@ -0,0 +1,225 @@
+---
+title: "OpenMRS Interoperability"
+linkTitle: "OpenMRS"
+weight: 4
+description: >
+ Exchange data with systems based on OpenMRS using FHIR APIs
+keywords: openmrs interoperability
+relatedContent: >
+ building/guides/interoperability/cht-config
+ building/concepts/interoperability
+ building/guides/interoperability/openhim
+---
+
+[OpenMRS](https://openmrs.org) is an open-source electronic medical record system used in dozens of countries. Integrating CHT apps with OpenMRS can open up opportunities to improve health outcomes for patients by promoting better coordination of care. For example, referrals by CHWs in the community can be sent electronically to health facilities using OpenMRS so that nurses and clinicians can prepare for their visit and have full access to the assessment done by a CHW.
+
+Integrating CHT apps with OpenMRS can be achieved using the CHT's [Interoperability Tools]({{< ref "building/guides/interoperability/openhim" >}}) and following the guidance in the [Building interoperability with FHIR APIs documentation]({{< ref "building/guides/interoperability/cht-config" >}}).
+
+## Overview
+
+The CHT's interoperability tools support sends patient and reports data to OpenMRS.
+
+The steps to create an OpenMRS interoperability workflow are:
+
+1. Profile the workflow in terms of what data needs to be exchanged between OpenMRS and the CHT application.
+1. Set up a test environment including an OpenMRS instance, a CHT instance, and OpenHIM. The [interoperability project](https://github.com/medic/cht-interoperability) has docker compose files so that you can set this up locally by running `./startup.sh up-openmrs` in the interoperability project.
+1. Create or find [concepts](https://guide.openmrs.org/configuration/managing-concepts-and-metadata/) in OpenMRS that represent any data that needs to be exchanged.
+1. [Configure outbound push and forms]({{< ref "building/guides/interoperability/cht-config" >}}) in the CHT application to match the interoperability workflow.
+1. Test and debug any configuration issues in the test environment.
+1. Once the configuration is confirmed to be working as expected, start deploying to production by uploading the CHT configuration to production.
+1. Add any OpenMRS concepts or forms to production.
+1. [Set OpenMRS credentials and CHT credentials](#starting-the-interop-project) in the interoperability project, and start it in a production deployment.
+
+## Profiling
+
+The first step is to profile the workflow.
+
+1. Which patients should be sent to OpenMRS, and how is a patient defined in the CHT application?
+2. Which forms should be sent to OpenMRS?
+3. Which fields on those forms should be sent to OpenMRS, and which concepts do they map to?
+
+## Configuring CHT And OpenMRS
+
+Depending on what data needs to be exchanged, [outbound push]({{< ref "building/reference/app-settings/outbound" >}}) configurations and JSON forms need to be added to CHT.
+
+### Sending patients CHT->OpenMRS
+
+When sending patient data to OpenMRS, configure an outbound push mapping as described in the [CHT FHIR config documentation]({{< ref "building/guides/interoperability/cht-config#outbound-patients" >}}).
+Patients synced to OpenMRS will have two new [identifier types](https://guide.openmrs.org/getting-started/openmrs-information-model/#patient-identifier): `CHT Document Id`, the uuid of the document that is sent, and `CHT Patient ID`, if there is a `patient_id` field on the patient document.
+These identifier types are created automatically when the OpenMRS Channel is registered.
+
+After setting up the outbound push config, test that it works in the test environment by creating a patient in the CHT application.
+Log in to OpenHIM and view the transaction log. You should see:
+1. A request from the CHT application to the CHT Mediator, containing the patient document.
+ 
+ ```json
+ {
+ "doc": {
+ "_id": "75905106a4bc2a9046ed28df070016ce",
+ "name": "John Test",
+ "phone": "+2548277217095",
+ "date_of_birth": "1980-06-06",
+ "sex": "male",
+ "patient_id": "13985"
+ }
+ }
+ ```
+1. A request from the CHT mediator to the FHIR Server, using a PUT request to upsert a FHIR patient created from the CHT patient document.
+ 
+ ```json
+ {
+ "resourceType": "Patient",
+ "id": "75905106a4bc2a9046ed28df070016ce",
+ "meta": {
+ "versionId": "1",
+ "lastUpdated": "2024-10-31T04:53:44.026+00:00"
+ },
+ "text": {
+ "status": "generated",
+ "div": "Identifier | 13985 |
Date of birth | 06 June 1980 |
"
+ },
+ "identifier": [
+ {
+ "use": "official",
+ "type": {
+ "text": "CHT Patient ID"
+ },
+ "value": "13985"
+ },
+ {
+ "use": "secondary",
+ "type": {
+ "text": "CHT Document ID"
+ },
+ "value": "75905106a4bc2a9046ed28df070016ce"
+ }
+ ],
+ "name": [
+ {
+ "family": "Test",
+ "given": [
+ "John"
+ ]
+ }
+ ],
+ "telecom": [
+ {
+ "value": "+2548277217095"
+ }
+ ],
+ "gender": "male",
+ "birthDate": "1980-06-06"
+ }
+ ```
+1. A POST request to OpenMRS containing the newly created patient.
+ 
+1. A PUT request to the FHIR server updating the patient with the corresponding id from OpenMRS.
+ 
+
+If all the above look OK, you should now be able to search in OpenMRS for the patient by name, phone number, or patient id.
+
+```bash
+curl -X GET localhost:8090/openmrs/ws/fhir2/R4/Patient/?identifier=[identifier] -H "Authorization: Basic $(echo -n admin:Admin123 | base64)"
+```
+
+### Sending forms CHT->OpenMRS
+
+Any data sent from CHT to OpenMRS needs to map to a [concept](https://wiki.openmrs.org/display/docs/Concept+Dictionary+Basics) in OpenMRS. Each concept has a code which will be used to identify the concept in the CHT Application, the FHIR Server, and OpenMRS.
+For any fields to send to OpenMRS, first find or create matching concepts in OpenMRS.
+Then, using the appropriate codes, configure an outbound push as described in the [CHT FHIR config documentation]({{< ref "building/guides/interoperability/cht-config#outbound-reports" >}}).
+
+In OpenMRS, all form submissions are represented as `Home Visit` encounter types, with a `Visit Note` encounter.
+Any fields in the outbound push config are converted to FHIR observations, which are linked to the `Visit Note`.
+
+After setting up the outbound push, test that it works in the test environment by submitting a report to the form in the CHT application.
+Log in to OpenHIM and view the transaction log. You should see:
+1. A request from the CHT application to the CHT Mediator, containing all the fields from the form that were mapped to concepts.
+ 
+ ```json
+ {
+ "id": "442b0937-a32f-443e-8d28-7d9a7552fda2",
+ "patient_uuid": "75905106a4bc2a9046ed28df070016ce",
+ "reported_date": 1730355950419,
+ "observations": [
+ {
+ "code": "5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+ "valueQuantity": {
+ "value": 175,
+ "unit": "cm"
+ },
+ "label": "Height in cm"
+ },
+ {
+ "code": "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+ "valueQuantity": {
+ "value": 60,
+ "unit": "kg",
+ },
+ "label": "Weight in kg"
+ }
+ ]
+ }
+ ```
+1. A PUT request to the FHIR server to create an encounter, and one request for each observation contained in that encounter.
+ 
+1. Requests to OpenMRS to create a `Home Visit` encounter, a `Visit Note` encounter, and one request for each observation.
+ 
+1. A request to the FHIR server updating the encounter with the corresponding id from OpenMRS.
+
+If all the above look OK, you should now be able to see the encounter in OpenMRS.
+
+```bash
+curl -X GET localhost:8090/openmrs/ws/fhir2/R4/Encounter/?identifier=[identifier] -H "Authorization: Basic $(echo -n admin:Admin123 | base64)"
+```
+## Starting the interop project
+
+Once the CHT and OpenMRS configs are ready, set up OpenHIM and install the mediators by following the instructions [here]({{< ref "building/guides/interoperability/openhim" >}}).
+Set `OPENMRS_URL`, `OPENMRS_PORT`, and `OPENMRS_HOST` in .env to configure the necessary channel automatically.
+| Name | Description |
+|---------------------------|-------------------------------------------------------------------------------------------------|
+| `OPENMRS_HOST` | hostname of OpenMRS instance |
+| `OPENMRS_PORT` | port where OpenMRS FHIR API is listening |
+| `OPENMRS_PASSWORD` | OpenMRS password to use for basic authentication |
+| `OPENMRS_USERNAME` | OpenMRS password to use for basic authentication. Should be a special system or integration user |
+
+When these variables are set, a channel for OpenMRS will automatically be created on startup.
+
+### OpenHIM resources
+
+The interoperability project will automatically create the following resources
+* The CHT Mediator is used to convert CHT documents to FHIR resources and store them on the FHIR Server.
+* The OpenMRS mediator is used to send FHIR Resources from the FHIR Server to OpenMRS. It contains only one endpoint, `sync`.
+
+
+
+* The CHT Mediator Channel contains routes to the CHT Mediator.
+* The FHIR Channel contains routes to the FHIR Server. Although it is not used by this integration, it can be used to expose any CHT documents sent to it as a FHIR API.
+* The OpenMRS Channel contains routes to the FHIR API of an external deployment of OpenMRS.
+
+
+
+When running `./startup.sh up-openmrs`, a cht instances with a sample configuration is created for testing.
+This includes:
+* A sample outbound push configuration for patients.
+* A sample outbound push configuration for encounters with a form `openmrs_height`.
+* A sample form `HEIGHT_WEIGHT` for outgoing encounters.
+
+### Troubleshooting
+
+In case of errors when setting up the OpenHIM project please see the [Troubleshooting guide]({{< ref "building/guides/interoperability/openhim#troubleshooting" >}}).
+
+If the openhim project starts up correctly but something else does not work as expected, it can be helpful to first check the transaction log page of OpenHIM to see which requests were sent, and the request and response bodies.
+See the sequence diagrams above for the expected requests/responses.
+
+
+
+### CHT->OpenMRS
+* No outbound push sent: check outbound push config, and logs for sentinel
+* Outbound push request sent, but returned error: check mediator logs and outbound push config; is it using the right endpoint and request has the expected data? What is the error in the mediator logs?
+* Outbound push request sent and succeed, sync to OpenMRS returned error: check OpenMRS logs for more detail.
+
+### OpenMRS->CHT
+* Sync finds new patients/forms, error when saving to the FHIR server.
+* Outbound push request sent, but returned error: check mediator logs and outbound push config; is it using the right endpoint and request has the expected data? What is the error in the mediator logs?
+* Outbound push request sent and succeed, sync to OpenMRS returned error: check OpenMRS logs for more detail.
+
diff --git a/content/en/building/guides/interoperability/openmrs/channels.png b/content/en/building/guides/interoperability/openmrs/channels.png
new file mode 100644
index 000000000..4ea450ff1
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/channels.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-form-submission.png b/content/en/building/guides/interoperability/openmrs/cht-form-submission.png
new file mode 100644
index 000000000..8faf098ad
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-form-submission.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-incoming-forms.png b/content/en/building/guides/interoperability/openmrs/cht-incoming-forms.png
new file mode 100644
index 000000000..94df2d871
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-incoming-forms.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-incoming-patients.png b/content/en/building/guides/interoperability/openmrs/cht-incoming-patients.png
new file mode 100644
index 000000000..6df50795f
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-incoming-patients.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-outgoing-patients.png b/content/en/building/guides/interoperability/openmrs/cht-outgoing-patients.png
new file mode 100644
index 000000000..7bbd521a1
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-outgoing-patients.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-patient-creation.png b/content/en/building/guides/interoperability/openmrs/cht-patient-creation.png
new file mode 100644
index 000000000..1436a37e5
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-patient-creation.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-post-encounter.png b/content/en/building/guides/interoperability/openmrs/cht-post-encounter.png
new file mode 100644
index 000000000..227bc03b4
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-post-encounter.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/cht-post-patient.png b/content/en/building/guides/interoperability/openmrs/cht-post-patient.png
new file mode 100644
index 000000000..c8217e9cb
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/cht-post-patient.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/diagram.png b/content/en/building/guides/interoperability/openmrs/diagram.png
new file mode 100644
index 000000000..f3f754adb
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/diagram.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/fhir-put-patient.png b/content/en/building/guides/interoperability/openmrs/fhir-put-patient.png
new file mode 100644
index 000000000..51c85f51e
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/fhir-put-patient.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/mediators.png b/content/en/building/guides/interoperability/openmrs/mediators.png
new file mode 100644
index 000000000..a77503f15
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/mediators.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/openhim-put-encounter.png b/content/en/building/guides/interoperability/openmrs/openhim-put-encounter.png
new file mode 100644
index 000000000..864e6c970
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/openhim-put-encounter.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/openmrs-post-observation.png b/content/en/building/guides/interoperability/openmrs/openmrs-post-observation.png
new file mode 100644
index 000000000..671d784ea
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/openmrs-post-observation.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/openmrs-post-patient.png b/content/en/building/guides/interoperability/openmrs/openmrs-post-patient.png
new file mode 100644
index 000000000..d15d87400
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/openmrs-post-patient.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/openmrs-sync-encounter.png b/content/en/building/guides/interoperability/openmrs/openmrs-sync-encounter.png
new file mode 100644
index 000000000..8bd8c8ab8
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/openmrs-sync-encounter.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/openmrs-sync-patient.png b/content/en/building/guides/interoperability/openmrs/openmrs-sync-patient.png
new file mode 100644
index 000000000..98f88ba01
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/openmrs-sync-patient.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/openmrs_mediator.png b/content/en/building/guides/interoperability/openmrs/openmrs_mediator.png
new file mode 100644
index 000000000..320691cd4
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/openmrs_mediator.png differ
diff --git a/content/en/building/guides/interoperability/openmrs/transaction_log.png b/content/en/building/guides/interoperability/openmrs/transaction_log.png
new file mode 100644
index 000000000..14ddae10c
Binary files /dev/null and b/content/en/building/guides/interoperability/openmrs/transaction_log.png differ