Skip to main content

The openIMIS Backend FHIR API reference module.

Project description

openIMIS Backend FHIR API reference module

Note
This repository currently supports basic functionality of FHIR API and might miss some openIMIS specific validations. Please use it with caution if you want to connect it to a production database.

License: AGPL v3

Maintainability Test Coverage

Description

This repository holds the files of the openIMIS Backend FHIR API reference module. It is dedicated to be deployed as a module of openimis-be_py.

The module is mapping objects between openIMIS and FHIR representation, and allows external applications to use HL7 FHIR standardised communication protocol when interacting with openIMIS.

Documentation

The documentation for this module can be found at openIMIS Wiki page.

Implementation setup

This module is published on Python Package Index as openimis-be-api-fhir.

The FHIR API will be available after the module is deployed on openimis-be_py. Check the openimis-be_py's readme file on how to activate the module (add the 'api_fhir' module to openimis.json) and start the openIMIS backend.

Configurations Options

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" }
stu3_fhir_identifier_type_config configuration 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_marital_status_config configuration of system and codes used to represent the specific types of marital status "stu3_fhir_marital_status_config":{ "system":"https://www.hl7.org/fhir/STU3/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 of usage

To fetch information about all openIMIS Insurees (as FHIR Patients), send a GET request on:

http://127.0.0.1:8000/api_fhir/Patient/

127.0.0.1:8000 is the server address (if run on your local host).

Example of response (mapping description):

{
    "resourceType": "Bundle",
    "entry": [
        {
            "fullUrl": "http://127.0.0.1:8000/api_fhir/Patient/1D464C09-5334-407F-9882-14C097B89BBD",
            "resource": {
                "resourceType": "Patient",
                "address": [
                    {
                        "text": "address",
                        "type": "physical",
                        "use": "home"
                    },
                    {
                        "text": "geolocation",
                        "type": "both",
                        "use": "home"
                    }
                ],
                "birthDate": "2000-01-02",
                "gender": "female",
                "id": "1D464C09-5334-407F-9882-14C097B89BBD",
                "identifier": [
                    {
                        "type": {
                            "coding": [
                                {
                                    "code": "ACSN",
                                    "system": "https://hl7.org/fhir/valueset-identifier-type.html"
                                }
                            ]
                        },
                        "use": "usual",
                        "value": "1D464C09-5334-407F-9882-14C097B89BBD"
                    },
                    {
                        "type": {
                            "coding": [
                                {
                                    "code": "SB",
                                    "system": "https://hl7.org/fhir/valueset-identifier-type.html"
                                }
                            ]
                        },
                        "use": "usual",
                        "value": "Insuree ID (e.g. 123456789)"
                    },
                    {
                        "type": {
                            "coding": [
                                {
                                    "code": "PPN",
                                    "system": "https://hl7.org/fhir/valueset-identifier-type.html"
                                }
                            ]
                        },
                        "use": "usual",
                        "value": "passport number"
                    }
                ],
                "maritalStatus": {
                    "coding": [
                        {
                            "code": "U",
                            "system": "https://www.hl7.org/fhir/STU3/valueset-marital-status.html"
                        }
                    ]
                },
                "name": [
                    {
                        "family": "test patient",
                        "given": [
                            "test patient"
                        ],
                        "use": "usual"
                    }
                ],
                "telecom": [
                    {
                        "system": "phone",
                        "use": "home",
                        "value": "phone number"
                    },
                    {
                        "system": "email",
                        "use": "home",
                        "value": "email@email.com"
                    }
                ]
            }
        }
    ],
    "link": [
        {
            "relation": "self",
            "url": "http://127.0.0.1:8000/api_fhir/Patient/?_count=2"
        },
        {
            "relation": "next",
            "url": "http://127.0.0.1:8000/api_fhir/Patient/?_count=2&page-offset=2"
        }
    ],
    "total": 9,
    "type": "searchset"
}

Dependencies

All required dependencies can be found in the setup.py file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

openimis_be_api_fhir-1.1.0-py3-none-any.whl (101.7 kB view details)

Uploaded Python 3

File details

Details for the file openimis_be_api_fhir-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: openimis_be_api_fhir-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 101.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.8

File hashes

Hashes for openimis_be_api_fhir-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c55b6ec525db1d6be13239d9b3f71183e7f97732946b51920cf586e64c94f0b
MD5 d4ce05ed77be52d4f181fb7b4d36cc53
BLAKE2b-256 04055564ae4bbcf9b2cd69017bdde65a8ff6ca52077442ec73bbc34dc58353d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page