Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Mapping of Organizations (1.1)

Volker edited this page Jun 14, 2019 · 1 revision

Overview

The Adapter can map and external identifier system to the identifiers used by DHIS2. For example, the identifier system http://www.dhis2.org/dhis2-fhir-adapter/systems/DHIS2-FHIR-Identifier can be used to specify the ID used by DHIS 2. This example demonstrated how to map the organization identifier of an external system to the Organisation Unit ID that is used by DHIS2.

Add a system independent organization code

Add a system independent organization code for health center Ngelehun CHC. The code may be used by the Adapter and its mappings. It is neither used for FHIR nor for DHIS 2 resources. The code must be assigned to an existing code category. In this case it is assigned to the organization code category.

curl -XPUT -u admin:district -H 'Content-Type: application/json' http://localhost:8081/api/codes/929633e6-4847-4ecd-83df-684429d84c83 -d '{
  "name": "Organization Ngelehun CHC",
  "code": "ORG_NGELEHUN_CHC",
  "codeCategory": "http://localhost:8081/api/codeCategories/9e1c64d8-82df-40e5-927b-a34c115f14e9"
}'

Add the DHIS 2 ID for the organization

The system independent code needs to be linked to the DHIS 2 ID that uses system http://www.dhis2.org/dhis2-fhir-adapter/systems/DHIS2-FHIR-Identifier (system ID fa133f34-280f-40d0-ac9a-523d8ea8f23b). The code is the ID that is used bu DHIS 2 for that organisation unit.

curl -XPUT -u admin:district -H 'Content-Type: application/json' http://localhost:8081/api/systemCodes/5e0f76aa-2176-4414-9b6c-cc21c7198e22 -d '{
  "name": "Organisation Unit Ngelehun CHC",
  "code": "http://localhost:8081/api/codes/929633e6-4847-4ecd-83df-684429d84c83",
  "system": "http://localhost:8081/api/systems/fa133f34-280f-40d0-ac9a-523d8ea8f23b",
  "systemCode": "DiszpKrYNg8",
  "displayName": "Ngelehun CHC"
}'

Add the external identifier system

Add the external identifier system with system URI http://example.sl/organizations.

curl -XPUT -u admin:district -H 'Content-Type: application/json' http://localhost:8081/api/systems/c4e9ac6a-cc8f-4c73-aab6-0fa6775c0ca3 -d '{
  "name": "Sierra Leone Organization ID",
  "code": "SL_ORGANIZATION_ID",
  "systemUri": "http://example.sl/organizations",
  "fhirDisplayName": "Sierra Leone Organization ID"
}'

Add the external identifier for the organization

Lets assume the external system uses SL_92783721 as the identifier for the health center Ngelehun CHC. The following snippet adds the mapping. Afterwards the identifiers used by DHIS 2 and the external system are joined together.

curl -XPUT -u admin:district -H 'Content-Type: application/json' http://localhost:8081/api/systemCodes/5e0f76aa-2176-4414-9b6c-cc21c7198e22 -d '{
  "name": "Organisation Unit Ngelehun CHC",
  "code": "http://localhost:8081/api/codes/929633e6-4847-4ecd-83df-684429d84c83",
  "system": "http://localhost:8081/api/systems/c4e9ac6a-cc8f-4c73-aab6-0fa6775c0ca3",
  "systemCode": "SL_92783721",
  "displayName": "Ngelehun CHC"
}'
Clone this wiki locally