Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Lab order FHIR for R5, Added Lab Result FHIR #1

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

172 changes: 147 additions & 25 deletions importer/openhim-core/openhim-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"name": "FHIR Server",
"description": "A FHIR server (HAPI FHIR)",
"urlPattern": "^/raw-fhir.*$",
"urlPattern": "^/hapi-fhir-jpaserver/fhir.*$",
"isAsynchronousProcess": false,
"methods": [
"GET",
Expand All @@ -53,10 +53,10 @@
"type": "http",
"status": "enabled",
"secured": false,
"host": "hapi-fhir",
"port": 8080,
"host": "197.243.18.12",
"port": 8085,
"path": "",
"pathTransform": "s/raw-//g",
"pathTransform": "",
"primary": true,
"username": "",
"password": "",
Expand All @@ -80,7 +80,7 @@
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "667d76cff305884a415ea9b1",
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
}
},
Expand Down Expand Up @@ -133,21 +133,21 @@
"txViewAcl": [],
"txViewFullAcl": [],
"txRerunAcl": [],
"alerts": [],
"status": "enabled",
"rewriteUrls": false,
"addAutoRewriteRules": true,
"rewriteUrlsConfig": [],
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "667d76cff305884a415ea9b1",
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
},
"alerts": []
}
},
{
"name": "EMR Lab Order",
"urlPattern": "^/emr-lab-order$",
"name": "Get Lab Results",
"urlPattern": "^^/get-lab-results.*$$",
"isAsynchronousProcess": false,
"methods": [
"GET",
Expand All @@ -171,13 +171,13 @@
"authType": "public",
"routes": [
{
"name": "Generate Lab Source ID",
"name": "Get Lab Results",
"type": "http",
"status": "enabled",
"secured": false,
"host": "rwanda-custom-mapping-mediator",
"port": 8084,
"path": "/lab-orders-source-id",
"path": "",
"pathTransform": "",
"primary": true,
"username": "",
Expand All @@ -194,21 +194,20 @@
"txViewAcl": [],
"txViewFullAcl": [],
"txRerunAcl": [],
"alerts": [],
"status": "enabled",
"rewriteUrls": false,
"addAutoRewriteRules": true,
"rewriteUrlsConfig": [],
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "667d76cff305884a415ea9b1",
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
},
"alerts": [],
"priority": 2
}
},
{
"name": "VLSM And FHIR Lab Order",
"name": "FHIR Lab Order UUID Generation",
"urlPattern": "^/vlsm/order$",
"isAsynchronousProcess": false,
"methods": [
Expand All @@ -223,6 +222,7 @@
"PATCH"
],
"type": "http",
"priority": 2,
"tcpPort": null,
"tcpHost": null,
"pollingSchedule": null,
Expand Down Expand Up @@ -256,21 +256,20 @@
"txViewAcl": [],
"txViewFullAcl": [],
"txRerunAcl": [],
"alerts": [],
"status": "enabled",
"rewriteUrls": false,
"addAutoRewriteRules": true,
"rewriteUrlsConfig": [],
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "667d76cff305884a415ea9b1",
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
},
"alerts": [],
"priority": 2
}
},
{
"name": "Smart FHIR",
"name": "Lab Order FHIR",
"urlPattern": "^/lab-order$",
"isAsynchronousProcess": false,
"methods": [
Expand All @@ -285,6 +284,7 @@
"PATCH"
],
"type": "http",
"priority": 3,
"tcpPort": null,
"tcpHost": null,
"pollingSchedule": null,
Expand Down Expand Up @@ -318,14 +318,136 @@
"txViewAcl": [],
"txViewFullAcl": [],
"txRerunAcl": [],
"alerts": [],
"status": "enabled",
"rewriteUrls": false,
"addAutoRewriteRules": true,
"rewriteUrlsConfig": [],
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
}
},
{
"name": "Post VLSM Lab Results To FHIR",
"urlPattern": "^/lab-results$",
"isAsynchronousProcess": false,
"methods": [
"GET",
"POST",
"DELETE",
"PUT",
"OPTIONS",
"HEAD",
"TRACE",
"CONNECT",
"PATCH"
],
"type": "http",
"tcpPort": null,
"tcpHost": null,
"pollingSchedule": null,
"requestBody": true,
"responseBody": true,
"allow": [],
"whitelist": [],
"authType": "public",
"routes": [
{
"name": "Post Lab Result Mediator",
"type": "http",
"status": "enabled",
"secured": false,
"host": "rwanda-custom-mapping-mediator",
"port": 8084,
"path": "",
"pathTransform": "",
"primary": true,
"username": "",
"password": "",
"forwardAuthHeader": false
}
],
"matchContentTypes": [],
"matchContentRegex": null,
"matchContentXpath": null,
"matchContentJson": null,
"matchContentValue": null,
"properties": [],
"txViewAcl": [],
"txViewFullAcl": [],
"txRerunAcl": [],
"alerts": [],
"status": "enabled",
"rewriteUrls": false,
"addAutoRewriteRules": true,
"rewriteUrlsConfig": [],
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
}
},
{
"name": "OpenHIM Mapping Mediator",
"urlPattern": "^/endpoints.*$",
"isAsynchronousProcess": false,
"methods": [
"GET",
"POST",
"DELETE",
"PUT",
"OPTIONS",
"HEAD",
"TRACE",
"CONNECT",
"PATCH"
],
"type": "http",
"tcpPort": null,
"tcpHost": null,
"pollingSchedule": null,
"requestBody": true,
"responseBody": true,
"allow": [],
"whitelist": [],
"authType": "public",
"routes": [
{
"name": "Mapping Mediator",
"type": "http",
"status": "enabled",
"secured": false,
"host": "openhim-mapping-mediator",
"port": 3003,
"path": "",
"pathTransform": "",
"primary": true,
"username": "",
"password": "",
"forwardAuthHeader": false
}
],
"matchContentTypes": [],
"matchContentRegex": null,
"matchContentXpath": null,
"matchContentJson": null,
"matchContentValue": null,
"properties": [],
"txViewAcl": [],
"txViewFullAcl": [],
"txRerunAcl": [],
"status": "enabled",
"rewriteUrls": false,
"addAutoRewriteRules": true,
"rewriteUrlsConfig": [],
"autoRetryEnabled": false,
"autoRetryPeriodMinutes": 60,
"updatedBy": {
"id": "667d76cff305884a415ea9b1",
"id": "66bca8368e4b6e6029568565",
"name": "Super User"
},
"alerts": []
Expand All @@ -349,8 +471,8 @@
],
"defaultChannelConfig": [],
"configDefs": [],
"_lastHeartbeat": "2024-06-28T06:12:25.042Z",
"_uptime": 20155.843693203
"_lastHeartbeat": "2024-08-14T13:18:59.080Z",
"_uptime": 1651.129535758
}
],
"ContactGroups": []
Expand Down
7 changes: 7 additions & 0 deletions importer/openhim-mapping-mediator/docker-compose.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
target: /metadata.js
- source: mediator-config-jsonToFhirLabOrder.json
target: /jsonToFhirLabOrder.json
- source: mediator-config-jsonToFhirLabResult.json
target: /jsonToFhirLabResult.json
networks:
mapping-mediator:
# This command will only attempt to import the config when the uptime responds with a 2xx
Expand All @@ -28,6 +30,11 @@ configs:
name: mediator-config-jsonToFhirLabOrder.json-${mediator_config_jsonToFhirLabOrder_json_DIGEST:?err}
labels:
name: fhir
mediator-config-jsonToFhirLabResult.json:
file: ./jsonToFhirLabResult.json
name: mediator-config-jsonToFhirLabResult.json-${mediator_config_jsonToFhirLabResult_json_DIGEST:?err}
labels:
name: fhir

networks:
mapping-mediator:
Expand Down
16 changes: 9 additions & 7 deletions importer/openhim-mapping-mediator/jsonToFhirLabOrder.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@

"fullUrlPerfORG": "$exists(requestBody.performingOrganizationID) ? 'Organization/' & requestBody.performingOrganizationID : null",
"resourceIdPerfORG": "$exists(requestBody.performingOrganizationID) ? requestBody.performingOrganizationID : null",
"provinceId": "$exists(requestBody.provinceIds) ? requestBody.provinceIds : null",
"requestUrlPerfORG": "$exists(requestBody.performingOrganizationID) ? 'Organization/' & requestBody.performingOrganizationID : null",

"fullUrlServiceReq": "$exists(requestBody.serviceRequestID) ? 'ServiceRequest/' & requestBody.serviceRequestID : null",
"valueServiceReq": "$exists(requestBody.labsourceid) ? requestBody.labsourceid : null",
"valueServiceReq": "$exists(requestBody.upid) ? requestBody.upid : null",
"resourceIdServiceReq": "$exists(requestBody.serviceRequestID) ? requestBody.serviceRequestID : null",
"subjectReferenceServiceReq": "$exists(requestBody.patientId) ? 'Patient/' & requestBody.patientId : null",
"encounterReferenceServiceReq": "$exists(requestBody.encounterID) ? 'Encounter/' & requestBody.encounterID : null",
"occurrenceDateTimeServiceReq": "$exists(requestBody.requestDate) ? requestBody.requestDate : null",
"requesterReferenceServiceReq": "$exists(requestBody.requestingPractitionerID) ? 'Practitioner/' & requestBody.requestingPractitionerID : null",
"performerReferenceServiceReq": "$exists(requestBody.performingPractitionerID) ? 'Practitioner/' & requestBody.performingPractitionerID : null",
"reasonReferenceServiceReq": "$exists(requestBody.reasonForHIVTestingID) ? 'Observation/' & requestBody.reasonForHIVTestingID : null",
Expand Down Expand Up @@ -150,6 +152,7 @@
"subjectReferenceObsHivTestResult": "$exists(requestBody.patientId) ? 'Patient/' & requestBody.patientId : null",
"encounterReferenceObsHivTestResult": "$exists(requestBody.encounterID) ? 'Encounter/' & requestBody.encounterID : null",
"performerObsHivTestResult": "$exists(requestBody.organizationID) ? 'Organization/' & requestBody.organizationID : null",
"lastViralLoadResult": "$exists(requestBody.vlResult) ? requestBody.vlResult : 1001",
"notereferenceObsHivTestResult": "$exists(requestBody.organizationID) ? 'Organization/' & requestBody.organizationID : null",
"requestUrlObsHivTestResult": "$exists(requestBody.hivTestResultID) ? 'Observation/' & requestBody.hivTestResultID : null",

Expand All @@ -163,7 +166,7 @@
"fullUrlSpecimenDefspeciConserv":"$exists(requestBody.hivLabResultTaskID) ? 'Task/' & requestBody.hivLabResultTaskID : null",
"resourceIdSpecimenDefspeciConserv": "$exists(requestBody.hivLabResultTaskID) ? requestBody.hivLabResultTaskID : null",
"valueIntegerSpecimenDefspeciConserv": "$exists(requestBody.resultStatus) ? requestBody.resultStatus : null",
"identifiervalueSpecimenDefspeciConserv": "$exists(requestBody.labsourceid) ? requestBody.labsourceid : null",
"identifiervalueSpecimenDefspeciConserv": "$exists(requestBody.upid) ? requestBody.upid : null",
"basedOnrefoneSpecimenDefspeciConserv": "$exists(requestBody.serviceRequestID) ? 'ServiceRequest/' & requestBody.serviceRequestID : null",
"basedOnreftwoSpecimenDefspeciConserv": "$exists(requestBody.sampleDispatchedToLabID) ? 'Transport/' & requestBody.sampleDispatchedToLabID : null",
"basedOnrefthreeSpecimenDefspeciConserv": "$exists(requestBody.resultDispatchedToRequestingFacilityID) ? 'Transport/' & requestBody.resultDispatchedToRequestingFacilityID : null",
Expand Down Expand Up @@ -441,7 +444,7 @@
"transforms.resourceIdPerfORG":"entry[3].resource.id",
"constants.profilePerfORG":"entry[3].resource.meta.profile[0]",
"constants.urlPerfOrgProvince":"entry[3].resource.extension[0].url",
"requestBody.provinceId":"entry[3].resource.extension[0].valueInteger",
"transforms.provinceId":"entry[3].resource.extension[0].valueInteger",
"constants.urlPerfOrgDistrict":"entry[3].resource.extension[1].url",
"constants.valueIntegerPerfOrgDistrict":"entry[3].resource.extension[1].valueInteger",
"constants.codingSystemPerfORG":"entry[3].resource.identifier[0].type.coding[].system",
Expand Down Expand Up @@ -476,7 +479,7 @@
"constants.textCodeServiceReq":"entry[4].resource.code.concept.text",
"transforms.subjectReferenceServiceReq":"entry[4].resource.subject.reference",
"transforms.encounterReferenceServiceReq":"entry[4].resource.encounter.reference",
"constants.occurrenceDateTimeServiceReq":"entry[4].resource.occurrenceDateTime",
"transforms.occurrenceDateTimeServiceReq":"entry[4].resource.occurrenceDateTime",
"transforms.requesterReferenceServiceReq":"entry[4].resource.requester.reference",
"transforms.performerReferenceServiceReq":"entry[4].resource.performer[].reference",
"transforms.reasonReferenceServiceReq":"entry[4].resource.reason[].reference.reference",
Expand Down Expand Up @@ -757,7 +760,7 @@
"transforms.encounterReferenceObsHivTestResult":"entry[18].resource.encounter.reference",
"requestBody.lastViralLoadTestDate":"entry[18].resource.effectiveDateTime",
"transforms.performerObsHivTestResult":"entry[18].resource.performer[].reference",
"requestBody.lastViralLoadResult":"entry[18].resource.valueInteger",
"transforms.lastViralLoadResult":"entry[18].resource.valueInteger",
"constants.interpretationSystemCodeObsHivTestResult":"entry[18].resource.interpretation[].coding[].system",
"constants.interpretationCodeCodeObsHivTestResult":"entry[18].resource.interpretation[].coding[].code",
"constants.interpretationDisplayCodeObsHivTestResult":"entry[18].resource.interpretation[].coding[].display",
Expand Down Expand Up @@ -1143,7 +1146,6 @@
"codeCodeServiceReq": "25836-8",
"displayCodeServiceReq": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection",
"textCodeServiceReq": "Test Type",
"occurrenceDateTimeServiceReq": "2012-01-05",
"timeServiceReq": "2015-02-07T13:28:17-05:00",
"textUrlServiceReq": "additional notes here",
"methodServiceReq": "PUT",
Expand Down Expand Up @@ -1526,7 +1528,7 @@
"headers": {
"contentType": "application/json"
},
"url": "http://openhim-core:5001/raw-fhir"
"url": "http://openhim-core:5001/hapi-fhir-jpaserver/fhir/"
},
"extract": {
"JeMPIResponse": "$.body"
Expand Down
Loading