-
Notifications
You must be signed in to change notification settings - Fork 3
Failure to Sync Encounters and Observations from CHT to OpenMRS via Mediator #157
Copy link
Copy link
Open
Labels
Type: BugFix something that isn't working as intendedFix something that isn't working as intended
Description
Describe the bug
Encounters and Observations created in CHT fail to sync to OpenMRS via the Mediator, with an error logged: "Not re-sending encounter from CHT."
To Reproduce
- Start the docker container using
./startup.sh up-openmrs - Follow the steps in OpenHIM Admin Console guide, installing
CHT MediatorandOpenMrs Mediator - Follow the steps in Local setup of CHT Configuration guide
- Use the OpenMRS Interop.postman_collection.json with the corresponding dev.json env variables.
- Change
"key": "CHT_ADMIN_USER"to have valueadmininstead ofmedic - Execute the first six calls in the postman collection:
- Mediator Status
- OpenMRS Api Status
- createPatientIdentifierType
- createDocumentIdentifierType
- CHT Create Patient
- Get FHIR Patient
- Until this point, the mediator log looks fine. No errors. The last lines in the log:
2025-01-20 14:28:41 Node.js v18.20.5
2025-01-20 14:28:43
2025-01-20 14:28:43 > mediator@1.0.0 start
2025-01-20 14:28:43 > node ./dist/index.js
2025-01-20 14:28:43
2025-01-20 14:28:45 2025-01-20 17:28:45 INFO: Server listening on port 6000
2025-01-20 14:28:46 2025-01-20 17:28:46 INFO: Successfully registered mediator.
2025-01-20 14:28:46 2025-01-20 17:28:46 INFO: Successfully registered mediator.
- Execute OpenMRS FHIR Sync Patient
- Everything looks as expected.
- Transactions log OpenHIM Admin console:
- Mediator log:
2025-01-20 14:43:11 2025-01-20 17:43:11 INFO: Comparing Patient
2025-01-20 14:43:11 2025-01-20 17:43:11 INFO: Incoming:
2025-01-20 14:43:11 2025-01-20 17:43:11 INFO: Outgoing: 2843bb6d46e7889001a1db73990007f9
2025-01-20 14:43:11 2025-01-20 17:43:11 INFO: Sending Patient 2843bb6d46e7889001a1db73990007f9 to OpenMRS
2025-01-20 14:43:13 2025-01-20 17:43:13 INFO: Updating Patient 2843bb6d46e7889001a1db73990007f9 with openMRSId cb643218-41e0-4dcf-9f1b-83c63a8c1bc9
2025-01-20 14:43:14 2025-01-20 17:43:14 INFO: Comparing Encounter
2025-01-20 14:43:14 2025-01-20 17:43:14 INFO: Incoming:
2025-01-20 14:43:14 2025-01-20 17:43:14 INFO: Outgoing:
- Execute the GET OpenMRS Patient step. It was successful with a response body containing
"total": 1 - Execute CHT Create Report. The transactions log looks as expected:
- Get FHIR Encounter returned a
"total": 1and Get FHIR Observations should return"total": 2as expected. - Execute OpenMRS FHIR Sync Encounter
- Mediator log shows an error:
2025-01-20 14:52:18 2025-01-20 17:52:18 INFO: Comparing Patient
2025-01-20 14:52:18 2025-01-20 17:52:18 INFO: Incoming:
2025-01-20 14:52:18 2025-01-20 17:52:18 INFO: Outgoing:
2025-01-20 14:52:18 2025-01-20 17:52:18 INFO: Comparing Encounter
2025-01-20 14:52:18 2025-01-20 17:52:18 INFO: Incoming:
2025-01-20 14:52:18 2025-01-20 17:52:18 INFO: Outgoing: 26a633b6-9f43-43d5-a00a-302ffea26223
2025-01-20 14:52:18 2025-01-20 17:52:18 ERROR: Not re-sending encounter from cht 26a633b6-9f43-43d5-a00a-302ffea26223
- Transactions log in OpenHIM admin console look like this:
- GET OpenMRS Encounter returns
"total": 0, expected 1 - GET OpenMRS Observations returns
"total": 0, expected 2.
Expected behavior
The OpenMRS Encounter and Observations should be created.
Environment
- Branch: at the moment of the creation of this ticket, the branch I use is openmrs-mediator
- Client platform: Docker desktop on MacOS Intel
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugFix something that isn't working as intendedFix something that isn't working as intended


