Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

openIMIS table - tblInsurees, tblFamilies

FHIR R4 field

openIMIS field

Notes

Mapping status

identifier

InsureeID / CHFID / passport / TypeOfId / InsureeUUID

there is a 0..* relation on identifier

InsureeID / CHFID / passport / InsureeUUID is mapped

name

LastName / OtherNames

name field contains values that are being mapped for both LastName and OtherNames fields

mapped

birthDate

DOB

mapped

gender

Gender

Link to gender_codes configuration key

mapped

maritalStatus

Marital

maritalStatus.text in [Married, Single, Divorced, Widowed, Not specified]

mapped

telecom

Phone / Email

telecom field contains values that are being mapped for both Phone and Email fields

mapped

photo.url

tblInsuree.PhotoID not → tblPhotos.PhotoFolder + PhotoFileName

Should include the base URL

mapped

photo. creation

tblInsuree.PhotoID → tblPhotos.PhotoDate

not mapped

generalPractitioner

HFID

reference/HeathcareService

not mapped

address

CurrentAddress / GeoLocation

The patient can contain multiple addresses

mappedpovertyStatus

link.other

tblInsuree → tblFamilies → Poverty

Extension valueBoolean

If Poverty from tblFamilies is “None” nothing is returned and the field is empty, else it’s “True” or “False”

mapped

link.other

link to tblInsureelink to tblInsuree.FamilyId → FamilytblFamilies.InsureeId → InsureetblInsurees.InsureeUUID

reference Patient/UUID
UUID is head of the family

not mapped

link.type

tblInsuree.relationship → tblRelations.Relation OR tblRelations.RelationId

Based on module configuration. tblRelations.Relation by default. relation

not mapped

Endpoint specification

Example of endpoint URL

http://localhost:8000/api_fhir_R4/Patient/

Supported HTTP operation

CREATE - POST HTTP method

Used to create new FHIR Patient (Insuree). List of supported fields can be found in the table which shows the mapping between openIMIS and FHIR. Should be used the POST HTTP method and the body as JSON representation (example can be found below).

  • The `head` model attribute isn't currently covered by the current API (related to the not supported familyId). By the default value is False (can be modified by the module configuration).

  • The `card_issued` model attribute isn't currently covered by the current API. By the default value is False (can be modified by the module configuration).

  • The `validity_from` attribute is set as the current value of date when the object is created

  • The `audit_user_id` - the user which interact with the FHIR API is the `TechnicalUser` (Backend security - Models and Concepts) which hasn't representation in tblUsers. That's why the value of the `audit_user_id` attribute is set based on the following algorithm:

    1. Try to get that value from the 'auditUserId' query parameter

    1. If missing get that value then use the value from the module configuration (by default 1)

READ - GET HTTP method

By default, returns the list of all available Patient resources. To fetch information about a specific object, you should add the UUID (e.g. 01DB0819-69F6-44F9-BF3D-0BCC5D4803E2) key to URL :

Code Block
http://localhost:8000/api_fhir_R4/Patient/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2

Should be used the GET HTTP method.

UPDATE - PUT HTTP method

...

extension.isHead

tblInsuree.IsHead

url: isHead
type: valueBoolean

mapped

extension.registrationDate

tblInsuree.ValidityFrom

url: registrationDate
type: valueDateTime

mapped

extension.locationCode

link to tblInsuree.FamilyId → tblFamilies.LocationId→ tblLocations.LocationUUID

url: locationCode
type: valueReference

mapped

extension.educationCode.valueCoding.code
extension.educationCode.valueCoding.display

tblInsuree.Education → tblEducations.EducationId
tblInsuree.Education → tblEducations.Education

utl: educationCode
type: valueCoding

mapped

extension.professionCode.valueCoding.code
extension.professionCode.valueCoding.display

tblInsuree.Profession → tblProfessions.ProfessionId
tblInsuree.Profession → tblProfessions.Profession

utl: professionCode
type: valueCoding

mapped

extension.povertyStatus

tblInsuree → tblFamilies → Poverty

url: povertyStatus
type: valueBoolean

mapped

extension.group

link to tblInsuree.FamilyId → tblFamilies.FamilyUUID

reference/Group/UUID

not mapped (warning)

Endpoint specification

Example of endpoint URL

http://localhost:8000/api_fhir_r4/Patient/

Supported HTTP operation

CREATE - POST HTTP method

Used to create new FHIR Patient (Insuree). List of supported fields can be found in the table which shows the mapping tablebetween openIMIS and FHIR. Should be used the PUT POST HTTP method and the body as JSON representation (example can be found below). The requested URL needs to point to a specific object to do that you should add the UUID (e.g. 01DB0819-69F6-44F9-BF3D-0BCC5D4803E2) key to URL for instance:

Code Block
languagepowershell
http://localhost:8000/api_fhir_R4/Patient/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2
  • The `head` model attribute isn't updated

  • The `head` model attribute isn't updated

  • The UPDATE operation will update the specific row of the database and doesn't create the history of changes (like in the legacy openIMIS)

DELETE - DELETE HTTP method

The operation can be used to remove the specific object from the database. Should be used the DELETE HTTP method. The requested URL needs to point to a specific object to do that you should add the UUID (e.g. 01DB0819-69F6-44F9-BF3D-0BCC5D4803E2) key to URL for instance:

...

  • The `head` model attribute isn't currently covered by the current API (related to the not supported familyId). By the default value is False (can be modified by the module configuration).

  • The `card_issued` model attribute isn't currently covered by the current API. By the default value is False (can be modified by the module configuration).

  • The `validity_from` attribute is set as the current value of date when the object is created

  • The `audit_user_id` - the user which interact with the FHIR API is the `TechnicalUser` (Backend security - Models and Concepts) which hasn't representation in tblUsers. That's why the value of the `audit_user_id` attribute is set based on the following algorithm:

    1. Try to get that value from the 'auditUserId' query parameter

    2. If missing get that value then use the value from the module configuration (by default 1)

READ - GET HTTP method

By default, returns the list of all available Patient resources. To fetch information about a specific object, you should add the UUID (e.g. 01DB0819-69F6-44F9-BF3D-0BCC5D4803E2

...

Note

The DELETE operation will permanently remove the row from the database.

Module configuration used by the endpoint:

...

Configuration key

...

Description

...

Default value

...

default_audit_user_id

...

default value which will be used for 'audit_user_id' field

...

"default_audit_user_id": 1

...

gender_codes

...

configuration of codes used by the openIMIS to represent gender (male, female, other)

...

"gender_codes": {
"male": "M",
"female": "F",
"other": "O"
}

...

R4_fhir_identifier_type_config

...

configuration of system and codes used to represent the specific types of identifiers

...

) key to URL :

Code Block
http://localhost:8000/api_fhir_r4/Patient/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2

Should be used the GET HTTP method.

UPDATE - PUT HTTP method

Updates the value of the specific object. List of supported fields can be found in the mapping table. Should be used the PUT HTTP method and the body as JSON representation (example can be found below). The requested URL needs to point to a specific object to do that you should add the UUID (e.g. 01DB0819-69F6-44F9-BF3D-0BCC5D4803E2) key to URL for instance:

Code Block
languagepowershell
http://localhost:8000/api_fhir_r4/Patient/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2
  • The `head` model attribute isn't updated

  • The `head` model attribute isn't updated

  • The UPDATE operation will update the specific row of the database and doesn't create the history of changes (like in the legacy openIMIS)

DELETE - DELETE HTTP method

The operation can be used to remove the specific object from the database. Should be used the DELETE HTTP method. The requested URL needs to point to a specific object to do that you should add the UUID (e.g. 01DB0819-69F6-44F9-BF3D-0BCC5D4803E2) key to URL for instance:

Code Block
http://localhost:8000/api_fhir_r4/Patient/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2
Note

The DELETE operation will permanently remove the row from the database.

Module configuration used by the endpoint:

Configuration key

Description

Default value

default_audit_user_id

default value which will be used for 'audit_user_id' field

"default_audit_user_id": 1

gender_codes

configuration of codes used by the openIMIS to represent gender (male, female, other)

"gender_codes": {
"male": "M",
"female": "F",
"other": "O"
}

R4_fhir_identifier_type_config

configuration of system and codes used to represent the specific types of identifiers

"R4_fhir_identifier_type_config":{
"system":"https://hl7.org/fhir/valueset-identifier-type.html",
"fhir_code_for_imis_claimdb_codeuuid_type":"MRUUID",
"fhir_code_for_imis_locationdb_codeid_type":"LCACSN",
"fhir_code_for_imis_diagnosis_code_chfid_type":"SB",
"fhir_code_for_imis_passport_type":"DCPPN",
"fhir_code_for_imis_itemfacility_codeid_type":"ICFI",
"fhir_code_for_imis_claim_serviceadmin_code_type":"SCFILL"
}

R4_fhir_marital_status_config

configuration of system and codes used to represent the specific types of marital status

"R4_fhir_marital_status_config":{
"system":"http://hl7.org/fhir/valueset-marital-status.html",,
"fhir_code_for_imis_claim_code_type":"MR"
"fhir_code_for_married_imis_location_code_type":"MLC",
"fhir_code_for_imis_diagnosis_nevercode_marriedtype":"SDC",
"fhir_code_for_divorced_imis_item_code_type":"DIC",
"fhir_code_for_widowed":"W",
"fhir_imis_service_code_for_unknowntype":"USC"
},

defaultR4_valuefhir_ofmarital_patientstatus_head_attribute

default value for 'head' attribute used for creating new Insuree object

"default_value_of_patient_head_attribute": False,

default_value_of_patient_card_issued_attribute

default value for 'card_issued' attribute used for creating new Insuree object

"default_value_of_patient_card_issued_attribute": False,

Example JSON representation of content:

{ "resourceType": "Patient", "address": [

config

Code Block
languagejson

configuration of system and codes used to represent the specific types of marital status

"R4_fhir_marital_status_config":{
"system":"http://hl7.org/fhir/valueset-marital-status.html",
"fhir_code_for_married":"M",
"fhir_code_for_never_married":"S",
"fhir_code_for_divorced":"D",
"fhir_code_for_widowed":"W",
"fhir_code_for_unknown":"U"
},

default_value_of_patient_head_attribute

default value for 'head' attribute used for creating new Insuree object

"default_value_of_patient_head_attribute": False,

default_value_of_patient_card_issued_attribute

default value for 'card_issued' attribute used for creating new Insuree object

"default_value_of_patient_card_issued_attribute": False,

Example JSON representation of content:

Code Block
languagejson
{
    "resourceType": "Patient",
    "address": [
        {
            "text": "5 Tsoka",
            "type": "physical",
            "use": "home"
        }
    ],
    "birthDate": "1987-01-07",
    "extension": [
        {
            "url": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960069653/isHead",
            "valueBoolean": true
        },
        {
            "url": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960331779/registrationDate",
            "valueDateTime": "2020-05-13T06:21:37.810000"
        {},
         {
  "text": "",             "type": "physical"url": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960495619/locationCode",
            "usevalueReference": "home"
        },
    {
   {             "textreference": "0.0 0.0",
   Location/BEE392F1-07D8-482F-B601-6C8BBA0BF2A9"
        "type": "both",    }
        },
 "use": "home"      {
  }     ],     "birthDateurl": "1974-06-11",https://openimis.atlassian.net/wiki/spaces/OP/pages/960331788/educationCode",
        "contact": [   "valueCoding": {
    {            "code": "relationship3":,
 [               "display": "Secondary {school"
            }
       "coding": [ },
        {
            "url": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960135203/professionCode",
 {           "valueCoding": {
                "code": "relatedPerson"
    "3",
                "display": "Self Employee"
 }           }
        },
],        {
            "texturl": "Son/Daughter"https://openimis.atlassian.net/wiki/spaces/OP/pages/1556643849/povertyStatus",
                }
            ]"valueBoolean": true
        }
    ],
    "extensiongender": ["M",
    "id": "01EEDC6C-436C-465F-86C2-6FF68644D751",
  {     "identifier": [
       "url": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960069653/FHIR+extension+isHead", {
            "valueBooleantype": {
    false         },   "coding": [
    {             "url": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960331779/FHIR+extension+registrationDate",  {
          "valueString": "2018-03-27T06:44:14.533000"               },"code": "UUID",
           {             "urlsystem": "https://openimishl7.atlassian.netorg/wiki/spaces/OP/pages/960495619/FHIR+extension+Location",
 fhir/valueset-identifier-type.html"
                    }
          "valueString": "R1D1M1V1"     ]
   },         {},
            "urluse": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960331788/FHIR+extension+Educationusual",
             "valueString": ""value": "01EEDC6C-436C-465F-86C2-6FF68644D751"
        },
        {
            "urltype": "https://openimis.atlassian.net/wiki/spaces/OP/pages/960135203/FHIE+extension+Profession",{
            "valueString": ""         }"coding": [
    ],     "gender": "female",       "id": "0DAC3D8A-3A7C-42B4-97B4-3F3968D4B35C",   {
 "identifier": [         {             "typecode": { "SB",
                         "coding": ["system": "https://hl7.org/fhir/valueset-identifier-type.html"
                    {}
                ]
       "code": "UUID",            },
            "systemuse": "https://hl7.org/fhir/valueset-identifier-type.html"usual",
            "value": "6561"
      }  },
        {
     ]       "type":  {
   },             "usecoding": [
"usual",             "value": "0DAC3D8A-3A7C-42B4-97B4-3F3968D4B35C"      {
  },         {             "typecode": "PPN",
  {                 "coding": [    "system": "https://hl7.org/fhir/valueset-identifier-type.html"
               {     }
                 ]
 "code": "SB",            },
            "systemuse": "https://hl7.org/fhir/valueset-identifier-type.html"usual",
            "value": "6561"
      }  }
    ],
    "maritalStatus":  {
  ]          "coding": [
  },          {
  "use": "usual",             "valuecode": "070707092M",
        },         {"system": "http://hl7.org/fhir/valueset-marital-status.html"
            "type":}
{        ],
        "codingtext": "Married"
[    },
    "name": [
        {
 {           "family": "Banda",
            "codegiven": "PPN",[
                   "James"
    "system": "https://hl7.org/fhir/valueset-identifier-type.html"       ],
             }"use": "usual"
        }
    ],
  ]  "photo": [
         },{
            "usecreation": "usual1900-01-01",
            "valueurl": "Images\\Updated\\"
        }
    ],
    "nametelecom": [
        {
            "familysystem": "Macintyrephone",
            "givenuse": "home",
 [           "value": ""
    "Adele"    },
        ],{
            "usesystem": "usual"
     email",
  }     ],     "telecomuse": "home",
  [         { "value": "           "system": "phone",             "use": "home",             "value": ""         },         {             "system": "email",             "use": "home",             "value": ""
        }
    ]
}