-
Notifications
You must be signed in to change notification settings - Fork 13
FHIR REST Interfaces (1.1)
The adapter provides synchronous FHIR REST Interfaces. They offer in general the same features like the import and export of data, but they use technical IDs that are based on the technical IDs of DHIS 2 resources instead of the technical IDs of connected systems.
In the default configuration file of the Adapter FHIR REST Interfaces for DSTU3 and R4 are enabled.
dhis2.fhir-adapter:
# Specifies if the FHIR interfaces should be enabled.
fhir-rest-interfaces:
# Specifies if DSTU3 FHIR interfaces should be enabled.
dstu3-enabled: true
# Specifies if R4 FHIR interfaces should be enabled.
r4-enabled: true
Without configuring the Adapter, FHIR Location and FHIR Organization resources can be accessed. After performing the initial setup with the setup user interface, also the FHIR Patient resource can be accessed.
The FHIR REST Interface endpoints are accessible below the following context relative URIs.
FHIR Version | Endpoint |
---|---|
DSTU3 | /fhir/dstu3/default |
R4 | /fhir/r4/default |
The FHIR REST Interfaces support DHIS 2 Basic and OAuth2 Authentication. The permissions of the corresponding DHIS 2 user is applied when performing any request on DHIS 2.
The Adapter provides FHIR identifiers for FHIR Resources that are mapped to DHIS 2 Organization Units and DHIS 2 Tracked Entity Types. The following tables contains the system URIs that are used by these identifiers.
FHIR Resource | System URI |
---|---|
Condition | http://www.dhis2.org/dhis2-fhir-adapter/systems/condition-identifier |
Diagnostic Report | http://www.dhis2.org/dhis2-fhir-adapter/systems/diagnostic-report-identifier |
Encounter | http://www.dhis2.org/dhis2-fhir-adapter/systems/encounter-identifier |
Immunization | http://www.dhis2.org/dhis2-fhir-adapter/systems/immunization-identifier |
Location | http://www.dhis2.org/dhis2-fhir-adapter/systems/location-identifier |
Medication Request | http://www.dhis2.org/dhis2-fhir-adapter/systems/medication-request-identifier |
Observation | http://www.dhis2.org/dhis2-fhir-adapter/systems/observation-identifier |
Organization | http://www.dhis2.org/dhis2-fhir-adapter/systems/organization-identifier |
Patient | http://www.dhis2.org/dhis2-fhir-adapter/systems/patient-identifier |
Practitioner | http://www.dhis2.org/dhis2-fhir-adapter/systems/practitioner-identifier |
Related Person | http://www.dhis2.org/dhis2-fhir-adapter/systems/related-person-identifier |
The following example assumes that DHIS 2 uses Sierra Leone demo database and the DHIS 2 Tracked Entity Type named Person has been setup with all DHIS 2 Tracked Entity Attributes that are offered in the initial setup user interface of the Adapter for Sierra Leone demo database.
$ curl -u admin:district 'http://localhost:8081/fhir/dstu3/default/Organization?identifier=http%3A%2F%2Fwww.dhis2.org%2Fdhis2-fhir-adapter%2Fsystems%2Forganization-identifier%7COU_278320&_format=json&_pretty=true'
{
"resourceType": "Bundle",
"id": "bbf4fa01-e944-4112-9f47-e78d7c7e9a4e",
"meta": {
"lastUpdated": "2019-03-04T12:40:23.806+01:00"
},
"type": "searchset",
"total": 1,
"link": [
{
"relation": "self",
"url": "http://localhost:8081/fhir/dstu3/default/Organization?_format=json&_pretty=true&identifier=http%3A%2F%2Fwww.dhis2.org%2Fdhis2-fhir-adapter%2Fsystems%2Forganization-identifier%7COU_278320"
}
],
"entry": [
{
"fullUrl": "http://localhost:8081/fhir/dstu3/default/Organization/ou-ldXIdLNUNEn-d0e1472a05e647c9b36bff1f06fec352",
"resource": {
"resourceType": "Organization",
"id": "ou-ldXIdLNUNEn-d0e1472a05e647c9b36bff1f06fec352",
"meta": {
"lastUpdated": "2017-05-22T15:21:48.511+02:00"
},
"identifier": [
{
"system": "http://www.dhis2.org/dhis2-fhir-adapter/systems/organization-identifier",
"value": "OU_278320"
}
],
"active": true,
"type": [
{
"coding": [
{
"system": "http://hl7.org/fhir/organization-type",
"code": "prov"
}
],
"text": "Facility"
}
],
"name": "Connaught Hospital"
}
}
]
}
The following command line snippet can be used to create a FHIR patient. It contains the technical ID of the FHIR Organization that has been retrieved above.
curl -u admin:district -XPOST -H 'Content-Type: application/fhir+json' http://localhost:8081/fhir/dstu3/default/Patient -d '{
"resourceType": "Patient",
"identifier": [
{
"system": "http://www.dhis2.org/dhis2-fhir-adapter/systems/patient-identifier",
"value": "826371"
}
],
"name": [
{
"family": "West",
"given": [
"Joe",
"Alan",
"Scott"
]
}
],
"gender": "male",
"birthDate": "2019-02-17",
"address": [
{
"text": "Water Road 675 / Apartment 62 / Freetown"
}
],
"managingOrganization": {
"reference": "Organization/ou-ldXIdLNUNEn-d0e1472a05e647c9b36bff1f06fec352"
}
}'
Copyright (c) 2004-2019, University of Oslo. All rights reserved.
- Default FHIR Patient to DHIS 2 Tracked Entity Instance Mapping
- FHIR Administrative Gender to DHIS 2 Code Set Code
- Initial Setup
- Excel Import of Mappings
- FHIR REST Interfaces
- Connect a new FHIR Server
- Constants
- Coding Systems
- Configure FHIR Resources
- Export and Import
- Limitations
- REST API for Administration and Mapping
- Javascript API for Rules and Transformations to DHIS 2
- Javascript API for Rules and Transformations from DHIS 2
- Connect HAPI FHIR JPA Server
- Connect Jembi HEARTH FHIR Server
- Direct FHIR Import from OpenMRS
- Default FHIR Patient to DHIS 2 Tracked Entity Instance Mapping
- FHIR Administrative Gender to DHIS 2 Code Set Code
- Create Tracker Program with Vital Sign
- Add SNOMED CT Code for Vital Sign
- Export Organizations and Locations to FHIR Server
- Export Patients to FHIR Server
- Handle custom Tracked Entity Instance with no Attributes
- Mapping of Organizations