Building > Interoperability > Configuring
Guide to setting up forms and outbound push for interoperability
OpenMRS 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 and following the guidance in the Building interoperability with FHIR APIs documentation.
The CHT’s interoperability tools support sends patient and reports data to OpenMRS.
The steps to create an OpenMRS interoperability workflow are:
./startup.sh up-openmrs
in the interoperability project.The first step is to profile the workflow.
Depending on what data needs to be exchanged, outbound push configurations and JSON forms need to be added to CHT.
When sending patient data to OpenMRS, configure an outbound push mapping as described in the CHT FHIR config documentation.
Patients synced to OpenMRS will have two new identifier types: 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:
{
"doc": {
"_id": "75905106a4bc2a9046ed28df070016ce",
"name": "John Test",
"phone": "+2548277217095",
"date_of_birth": "1980-06-06",
"sex": "male",
"patient_id": "13985"
}
}
{
"resourceType": "Patient",
"id": "75905106a4bc2a9046ed28df070016ce",
"meta": {
"versionId": "1",
"lastUpdated": "2024-10-31T04:53:44.026+00:00"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">John <b>TEST </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>13985</td></tr><tr><td>Date of birth</td><td><span>06 June 1980</span></td></tr></tbody></table></div>"
},
"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"
}
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.
curl -X GET localhost:8090/openmrs/ws/fhir2/R4/Patient/?identifier=[identifier] -H "Authorization: Basic $(echo -n admin:Admin123 | base64)"
Any data sent from CHT to OpenMRS needs to map to a concept 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.
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:
{
"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"
}
]
}
Home Visit
encounter, a Visit Note
encounter, and one request for each observation.
If all the above look OK, you should now be able to see the encounter in OpenMRS.
curl -X GET localhost:8090/openmrs/ws/fhir2/R4/Encounter/?identifier=[identifier] -H "Authorization: Basic $(echo -n admin:Admin123 | base64)"
Once the CHT and OpenMRS configs are ready, set up OpenHIM and install the mediators by following the instructions here.
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.
The interoperability project will automatically create the following resources
sync
.When running ./startup.sh up-openmrs
, a cht instances with a sample configuration is created for testing.
This includes:
openmrs_height
.HEIGHT_WEIGHT
for outgoing encounters.In case of errors when setting up the OpenHIM project please see the Troubleshooting guide.
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.
Guide to setting up forms and outbound push for interoperability
Guide to running OpenHIM and Mediators with Docker Compose
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.