openimis-be-claim-ai_py
openIMIS Backend Claim AI reference module
This repository holds the files of the openIMIS Backend Claim AI reference module. It is dedicated to be deployed as a module of openimis-be_py.
ORM mapping:
None
Docker Setup:
For setting up dockerized instance .env file have to be added to openimis-be-claim_ai_py.
- env file must provide following variables:
CHANNELS_HOST=<rabbitmq host used by channels layer> ASGI_PORT=<Port on which the application is available>- If local instance of rabbitmq is used then
amqp://guest:guest@127.0.0.1/can be used as CHANNELS HOST.
- If local instance of rabbitmq is used then
In openimis-be-claim_ai_py directory files regarding model evaluation - Scaler, Encoder and Model have to be added. By default, expected file names are:
- Scaler.obj
- Encoder.obj
- joblib_Voting_Model.pkl
Used files can be changed by adjusting variables in module_config.json.
For the default files a hot reload is applied. If files other than defaults are used,
hot reload can be added by adjusting volume paths in claim-ai service in docker-compose.
Listened Django Signals
None
Services
ClaimConsumer, websocket service responsible for AI evaluation
Websocket connection is available at claim_ai/ws/Claim/<process_id>/. It accepts bytes which payloads which after
decoding utf-8 decoding are in format:
{
'type': <type>,
'content': <payload_content>
}
Payload types:
-
'claim.bundle.payload'
Request:
{ 'type': 'claim.bundle.payload', 'content': <FHIR Claim Bundle>, 'bundle_id': <bundle_id> // Optional argument with bundle id used for bundle distinction }
Response:
{ 'type': 'claim.bundle.payload', 'content': <FHIR ClaimResponse Bundle>, 'index': <bundle_id> // bundle_id if it was given in request, subsequent numbers otherwise }
Used for claim evaluation, request payload have to contain claim bundle in FHIR format, after request was accepted
'claim.bundle.acceptance'is sent. After evaluation proper 'claim.bundle.payload' response with evaluation result is sent. -
'claim.bundle.acceptance'
Request:
{ 'type': 'claim.bundle.acceptance', 'content': <bundle_id> // index receieved from claim.bundle.payload }
Response:
{ 'type': 'claim.bundle.acceptance', 'content': 'Accepted', 'index': <bundle_id> // bundle_id if it was given in request, subsequent numbers otherwise }
Request is expected to be receieved from client after FHIR claim repsonse bundle was correctly receieved. Response is sent after claim.bundle.payload was receieved from the server.
-
'claim.bundle.authentication_exception'
Response:
{ 'type': 'claim.bundle.authentication_exception', 'content': 'Invalid authentication token' }
If token authentication is used and invalid token was provided by client this payload is sent and connection is closed immediately.
-
'claim.bundle.authentication_exception'
Response:
{ 'type': 'claim.bundle.evaluation_exception', 'content': <error_message>, 'index': <bundle_id> }
If any exceptions occurred during the evaluation exception message is returned to client.
Reports (template can be overloaded via report.ReportDefinition)
None
GraphQL Queries
None
GraphQL Mutations - each mutation emits default signals and return standard error lists (cfr. openimis-be-core_py)
None
Configuration options (can be changed via core.ModuleConfiguration)
- authentication: list of allowed tokens, when new connection is established client have to send token in auth-token header, if authentication is empty list then all connection request are allowed. Empty by default.
- claim_response_url: url used in FHIR response as resource 'fullUrl' prefix,
- claim_response_organization: organization used in FHIR response, by default 'openIMIS-Claim-AI',
- date_format: date format used in FHIR response, by default YYYY-mm-dd
openIMIS Modules Dependencies
The module is independent of the others.
Metadata
Release files for openimis-be-claim-ai 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openimis-be-claim_ai-2.0.0.tar.gz | 75.1 kB | Without provenance | Details for openimis-be-claim_ai-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openimis_be_claim_ai-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for openimis_be_claim_ai-2.0.0-py3-none-any.whl |
Total release size: 181.4 kB
Release files / openimis-be-claim_ai-2.0.0.tar.gz
| Download URL | openimis-be-claim_ai-2.0.0.tar.gz |
|---|---|
| Size | 75.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c24f64699eb35bd81532ddf5cb3b77bc4bdd1a3cf3f3ca928d6d970ef2dc361a
|
|
BLAKE2b-256 checksum How to use checksums |
e011dcf1f6d4934a40e939aad806a35dc5adebd6cd3367d8fd6386e2f29f09bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / openimis_be_claim_ai-2.0.0-py3-none-any.whl
| Download URL | openimis_be_claim_ai-2.0.0-py3-none-any.whl |
|---|---|
| Size | 106.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
755e79788cbd9d0d26637c411aad7364c53b1c2795eec29057eccc6647edf7a5
|
|
BLAKE2b-256 checksum How to use checksums |
8c1a6d20b8157016b3dbac0cf4d2ad59f482c1feec75a13e6312b086f1c63235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for openimis-be-claim-ai 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.