...
FHIR R4 Resource - Patient
openIMIS table - tblInsurees, tblFamilies
FHIR R4 field | openIMIS field | Notes | Mapping status | |||
---|---|---|---|---|---|---|
Identifieridentifier | InsureeID / CHFID / passport / TypeOfId / InsureeUUID | there is a 0..* relation on identifier | InsureeID / CHFID / passport is mapped | RelatedPerson | FamilyID | not / InsureeUUID is mapped |
LastName / OtherNames | name field contains values that are being mapped for both LastName and OtherNames fields | mapped | ||||
DOB | mapped | |||||
Gender | Link to | mapped | ||||
Marital | mapped | RelatedPerson.Relationship | IsHead | not maritalStatus.text in [Married, Single, Divorced, Widowed, Not specified] | mapped | |
Phone / Email | telecom field contains values that are being mapped for both Phone and Email fields | mapped | ||||
PhotoID | not tblInsuree.PhotoID → tblPhotos.PhotoFolder + PhotoFileName | Should include the base URL | mapped | |||
tblInsuree.PhotoID → tblPhotos.PhotoDate | not mapped | |||||
managingOrganizationgeneralPractitioner | HFID | reference/HeathcareService | not mapped | |||
CurrentAddress / GeoLocation | The patient can contain multiple addresses | mappedpovertyStatus | ||||
link to tblInsuree.FamilyId → tblFamilies.InsureeId → Poverty | Extension valueBoolean If Poverty from tblFamilies is “None” nothing is returned and the field is empty, else it’s “True” or “False” | 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:
Try to get that value from the 'auditUserId' query parameter
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 :
...
tblInsurees.InsureeUUID | reference Patient/UUID | mapped | |
tblInsuree.relationship → tblRelations.Relation OR tblRelations.RelationId | Based on module configuration. tblRelations.Relation by default. | mapped | |
extension.isHead | tblInsuree.IsHead | url: isHead | mapped |
extension.registrationDate | tblInsuree.ValidityFrom | url: registrationDate | mapped |
extension.locationCode | link to tblInsuree.FamilyId → tblFamilies.LocationId→ tblLocations.LocationUUID | url: locationCode | mapped |
extension.educationCode.valueCoding.code | tblInsuree.Education → tblEducations.EducationId | utl: educationCode | mapped |
extension.professionCode.valueCoding.code | tblInsuree.Profession → tblProfessions.ProfessionId | utl: professionCode | mapped |
extension.povertyStatus | tblInsuree → tblFamilies → Poverty | url: povertyStatus | mapped |
extension.group | link to tblInsuree.FamilyId → tblFamilies.FamilyUUID | reference/Group/UUID | not mapped |
Endpoint specification
Example of endpoint URL
http://localhost:8000/api_fhir_
...
...
Should be used the GET HTTP method.
UPDATE - PUT HTTP method
Updates the value of the specific object
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 | ||
---|---|---|
| ||
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
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:
Try to get that value from the 'auditUserId' query parameter
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 for instance :
Code Block |
---|
http://localhost:8000/api_fhir_R4r4/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_db_id_type":"ACSN",
"fhir_code_for_imis_chfid_type":"SB",
"fhir_code_for_imis_passport_type":"PPN",
"fhir_code_for_imis_facility_id_type":"FI",
"fhir_code_for_imis_claim_admin_code_type":"FILL",
"fhir_code_for_imis_claim_code_type":"MR"
}
...
R4_fhir_marital_status_config
...
configuration of system and codes used to represent the specific types of marital status
...
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 | ||
---|---|---|
| ||
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": { | |
R4_fhir_identifier_type_config | configuration of system and codes used to represent the specific types of identifiers | Code Block | |
| 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:
chfid_type":"SB", | ||
R4_fhir_marital_status_config | configuration of system and codes used to represent the specific types of marital status | "R4_fhir_marital_status_config":{ |
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:
|