Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Current »

List of content:

Description:

The OpenIMIS HF object (from the openimis-be-location_py module) was mapped to the FHIR Location resource. 

Notes / Assumptions:

  • The endpoint uses the UUID as a primary key
  • The current version of mapping will be focused on aspects of claiming.
  • In the current version of the openimis-be-location_py missing services layer which can be used to perform operations (CRUD - Create, Read, Update, Delete) on entities. That's why the current version of API use directly database layer manager for managing the HealthFacility objects. This leads to differences between the operation between legacy and new OpenIMIS, for instance, the update operation doesn't create the database row with a history of the object and the delete operation permanently remove the object from the database.
  • legalForm - missing in the current version of the HealthFacility model (from the openimis-be-location_py module). That's why the current version of API doesn't cover that field. Attribute needs to be nullable type in the Database Schema.
  • locationid - missing in the current version of the HealthFacility model (from the openimis-be-location_py module). That's why the current version of API doesn't cover that field. Attribute needs to be nullable type in the Database Sche

FHIR resource:

Location

Fields mapping:

Table legend:

ColorDescription

Mapped - the final choice, the most suitable choice

Need to be found the best place for the field (not mapped currently)

Currently not important - not mapped

Mapping:

OpenIMIS fieldDB typeFHIR fieldDescriptionNoteSTPHMapping status
HfIDintIdentifier


This is the Database ID and should be used only internally
HfUUIDuniqueidentifierIdentifierThe unique identifier used as PK for FHIR

mapped
HFCodenvarchar(8)Identifier


mapped
HFNamenvarchar(100)name


mapped
LegalFormFK(tblLegalForms)
G: Government
C: Charity
D: District organization
P: Private organization
The FHIR Location object don't contains that kind of information. If this information is valuable for external systems then we can add FHIR extension (if needed).
Will be added after when the final approach will be established. That field isn't supported by the current version of openimis-be-location (0.0.1).
HFLevelchar(1)typeC - health center
H - hospital
D - dispensary


mapped
HFSublevelFK(tblHFSublevel)
I: Integrated
R: Reference
N: No Sublevel
The FHIR Location object don't contains that kind of information. If this information is valuable for external systems then we can add FHIR extension (if needed).
Will be added after when the final approach will be established. That field isn't supported by the current version of openimis-be-location (0.0.1).
HFAddressnvarchar(100)Address


mapped
LocationIdFK(tblLocations)partOf - Reference(Location)
The FHIR Location will be used to represent the tblHF and tblLocations. The FHIR location.mode field can be used to distinguish between those object.
Will be added after when the final approach will be established. That field isn't supported by the current version of openimis-be-location (0.0.1).
Phonenvarchar(50)telecom


mapped
Faxnvarchar(50)telecom


mapped
eMailnvarchar(50)telecom


mapped
HFCareTypechar(1)
I - In-Patient
O - Out-Patient
B - both
The FHIR Location object don't contains that kind of information. If this information is valuable for external systems then we can add FHIR extension (if needed).
Will be added after when the final approach will be established. Currently for creating a new object is used the default value based on the module configuration.
PLServiceIDFK(tblPLServices)

If needed we can add the FHIR extension, try to use the "Location.endpoint" to represent this field or try to use the FHIR HealthcareService.
Will be added after when the final approach will be established. That field isn't supported by the current version of openimis-be-location (0.0.1).
PLItemIDFK(tblPLItems)

As above.
Will be added after when the final approach will be established. That field isn't supported by the current version of openimis-be-location (0.0.1).
AccCodenvarchar(25)
Account CodeI'm not sure if this information should be available for external systems. If needed we can add this information to the "location.description" or we can add the FHIR extension.
Will be added after when the final approach will be established.
OffLinebit

I'm not sure but this is probably used to determine the source of row (offline/online app). Probably information isn't valuable for external systems.

ValidityFromdatetime
This information are valuable for OpenIMIS but I probably not required by external systems.


ValidityTodatetime


LegacyIDint


AuditUserIDint


RowIDtimestamp

I'm not sure but this is probably some unique value used to distinguish database rows. Probably not useful for external systems.

Note:

  • the tblHF has a relation with tblHFCatchment, the information from tblHFCatchment can be added as FHIR extensions (if needed)

Endpoint specification:

Example of endpoint URL:

http://127.0.0.1:8000/api_fhir/Location/

Supported HTTP operation:

  • CREATE - used to create new FHIR Location (HF). 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).

    Note:

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

    • the `care_type` model attribute isn't currently covered by the current API. By the default value is "B" - both (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 - by default return list of all available resources. To fetch information about a specific object you should add the primary key to URL for instance:
    http://127.0.0.1:8000/api_fhir/Location/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2
    , where "01DB0819-69F6-44F9-BF3D-0BCC5D4803E2" is the value of the primary key. Should be used the GET HTTP method.
  • UPDATE - update the value of the specific object. List of supported fields can be found in the table which shows the mapping between OpenIMIS and FHIR. 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 primary key to URL for instance:
    http://127.0.0.1:8000/api_fhir/Location/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2
    , where "01DB0819-69F6-44F9-BF3D-0BCC5D4803E2" is the value of the primary key.
    Note:
    • the `offline` model attribute isn't updated
    • the `care_type` 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 - 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 primary key to URL for instance:
    http://127.0.0.1:8000/api_fhir/Location/01DB0819-69F6-44F9-BF3D-0BCC5D4803E2
    , where "01DB0819-69F6-44F9-BF3D-0BCC5D4803E2" is the value of the primary key.
    Note:
    - the DELETE operation will permanently remove the row from the database

Module configuration used by the endpoint: 

Configuration keyDescriptionDefault value
default_audit_user_iddefault value which will be used for 'audit_user_id' field"default_audit_user_id": 1,
stu3_fhir_identifier_type_configconfiguration of system and codes used to represent the specific types of identifiers

"stu3_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",

},

stu3_fhir_location_role_typeconfiguration of system and codes used to represent the specific types of location role

"stu3_fhir_location_role_type":{
  "system":"https://www.hl7.org/fhir/STU3/v3/ServiceDeliveryLocationRoleType/vs.html",
  "fhir_code_for_hospital":"HOSP",
  "fhir_code_for_dispensary":"CSC",
  "fhir_code_for_health_center":"PC",

},

default_value_of_location_offline_attributedefault value for 'offline' attribute used for creating new HF object"default_value_of_location_offline_attribute": False, 
default_value_of_location_care_typedefault value for 'care_type' attribute used for creating new HF object"default_value_of_location_care_type": "B"

Example JSON representation of content:

{
    "resourceType": "Location",
    "address": {
        "text": "HfAddress",
        "type": "physical",
        "use": "home"
    },
    "id": "72CE44C0-5D33-4452-BAD2-ECD6CA6A0DFF",
    "identifier": [
        {
            "type": {
                "coding": [
                    {
                        "code": "ACSN",
                        "system": "https://hl7.org/fhir/valueset-identifier-type.html"
                    }
                ]
            },
            "use": "usual",
            "value": "72CE44C0-5D33-4452-BAD2-ECD6CA6A0DFF"
        },
        {
            "type": {
                "coding": [
                    {
                        "code": "FI",
                        "system": "https://hl7.org/fhir/valueset-identifier-type.html"
                    }
                ]
            },
            "use": "usual",
            "value": "hfcode"
        }
    ],
    "name": "hfName",
    "telecom": [
        {
            "system": "phone",
            "use": "home",
            "value": "hfPhone"
        },
        {
            "system": "fax",
            "use": "home",
            "value": "hfFax"
        },
        {
            "system": "email",
            "use": "home",
            "value": "hfMail"
        }
    ],
    "type": {
        "coding": [
            {
                "code": "PC",
                "system": "https://www.hl7.org/fhir/STU3/v3/ServiceDeliveryLocationRoleType/vs.html"
            }
        ]
    }
}
  • No labels