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

FHIR Administrative Gender to DHIS 2 Code Set Code (1.1)

Volker edited this page Mar 16, 2019 · 2 revisions

The FHIR Administrative Gender enumeration value can be converted automatically to a code that has been defined by a DHIS 2 Code Set. The mapped code that is defined in the configuration of the adapter is applied case insensitive. First the adapter checks if there is case sensitive match of the configured mapped code, afterwards a case insensitive match is made. The following command requests the constant values that are used as mapped codes:

$ curl -u 'admin:district' 'http://localhost:8081/api/constants?category=GENDER'
    
{
  "_embedded" : {
    "constants" : [ {
      "createdAt" : "2018-11-19T01:54:36.276Z",
      "lastUpdatedBy" : null,
      "lastUpdatedAt" : "2018-11-19T01:54:36.276Z",
      "name" : "Gender Female",
      "description" : null,
      "category" : "GENDER",
      "code" : "GENDER_FEMALE",
      "dataType" : "STRING",
      "value" : "Female",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8081/api/constants/fa4a3a0e-ca46-40e4-b832-3aec96bed55e"
        },
        "constant" : {
          "href" : "http://localhost:8081/api/constants/fa4a3a0e-ca46-40e4-b832-3aec96bed55e"
        }
      }
    }, {
      "createdAt" : "2018-11-19T01:54:36.276Z",
      "lastUpdatedBy" : null,
      "lastUpdatedAt" : "2018-11-19T01:54:36.276Z",
      "name" : "Gender Male",
      "description" : null,
      "category" : "GENDER",
      "code" : "GENDER_MALE",
      "dataType" : "STRING",
      "value" : "Male",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8081/api/constants/1ded2081-8836-43dd-a5e1-7cb9562c93ef"
        },
        "constant" : {
          "href" : "http://localhost:8081/api/constants/1ded2081-8836-43dd-a5e1-7cb9562c93ef"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8081/api/constants{?page,size,sort}",
      "templated" : true
    },
   "profile" : {
      "href" : "http://localhost:8081/api/profile/constants"
    },
  },
  "page" : {
    "size" : 20,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}

The codes GENDER_FEMALE and GENDER_MALE must not be changed. The value can be changed to the actually used code on DHIS 2. If the code on DHIS 2 is MALE nothing needs to be changed, since the the matching mapped code from the corresponding DHIS 2 code set will be done case insensitively. If the code for the gender male is M, then the following command can be used to change the mapped code:

curl -u 'admin:district' -XPATCH -H 'Content-Type: application/merge-patch+json' -d '{"value": "M"}' http://localhost:8081/api/constants/1ded2081-8836-43dd-a5e1-7cb9562c93ef
Clone this wiki locally