Table of Contents |
---|
...
plan - The request represents an intention to ensure something occurs without providing an authorization for others to act. Medication request with type plan can't be dispensed and only provide the instruction to administer the medicine. It also can't be qualified
order - The request represents a request/demand and authorization for action. Medication request with type order can be dispensed
Input parameters (filters)
...
Only medication request with type (intent) order can be qualified.
Check medication request intent
if medication request intent == plan - return 409, "Plan can't be qualified"
...
Each Medical program may have its unique conditions for the medication dispense. It can be based on analysis of personal info, medications list, terms, locations and combinations of them.
For nowthere are only conditionsfor the following programs "Dostupni liky", "Netsukrovyy diabet", "Insuliny z doplatoyu", "Insuliny bezoplatno" and we check them.Also, it is possible to have the medication dispensewithoutany Medical program.However for any Medical program we need a separate block of branching logic.
Check compatibility only for programs which are available in payload (array).
If program status is invalid, the reason must be saved and returned in response.
...
1. Check INNM complience for the programs
Applies to the following programs:
Dostupni likyNetsukrovyy diabetInsuliny z doplatoyuInsuliny bezoplatno
Validation purpose: There is a list of medications (which links to Innms) which can be used for the program. It must be check whether there is at least one available medication (with `medication_request_allowed` == TRUE) for the Innm for the particular program
...
2. Check absence the same medications for the programs
Applies to the following programs:
Dostupni liky
Validation purpose: It can be only 1 Medication request (ACTIVE, COMPLETED) per one innm for the one patient at defined period of time.
...
3. Check that care plan is mandatory for programs
Applies to the following programs:
Netsukrovyy diabetInsuliny z doplatoyuInsuliny bezoplatno
Validation purpose: It is need to check if the medication request with a program need a care plan (with `care_plan_required` == TRUE) for a this program.
...
4. Check diagnosis comply with programs
Applies to programs: any
Validation purpose: It is needed to check if medication request with a program needed a context (encounter) with a specified diagnosis.
If program has CONDITIONS_ICD10_AM_ALLOWED parameter in medical_program_settings:
Check if primary diagnosis from the encounter in context has code from eHealth/ICD10_AM/condition_codes dictionary
Check diagnosis code in CONDITIONS_ICD10_AM_ALLOWED
in case of error - return 200 with status = INVALID and rejection_reason = “Encounter in context has no primary diagnosis allowed for the medical program“
If program has CONDITIONS_ICPC2_ALLOWED parameter in medical_program_settings:
Check if primary diagnosis from the encounter in context has code from eHealth/ICPC2/condition_codes dictionary
Check diagnosis code in CONDITIONS_ICPC2_ALLOWED
in case of error - return 200 with status = INVALID and rejection_reason = “Encounter in context has no primary diagnosis allowed for the medical program“
5. Validate employee
Applies to programs: any
Validation purpose: It is needed to check if medication request with a program allowed to create for specified employee.
Validate employee_id as described on Create Medication request Request
6. Validate Care plan and Activity
Applies to programs: any
Validation purpose: It is needed to check if medication request with a program allowed to create for specified care plan and activity.
Validare based_on as described on Create Medication request Request
7. Validate period
Validation purpose: It is needed to check if medication request period does not exceed allowed maximum of days.
...
Validate "context" is an active (not entered-in-error) entity from corresponding dictionary, that belongs to the current patient
Validate there is an entity in collection $.data.context.identifier.type.coding[0].code with id == $.data.context.identifier.value that belongs to the current patient
in case of error - return 200 with status = INVALID and rejection_reason = “Encounter entity is not found for program“
encounter diagnosis is not empty in $.encounter.diagnosis
in case of error return 422 ("Encounter without diagnosis can not be referenced")
9. Valdate person
Applies to programs: any
Validation purpose: It is needed to check if person has allowed verification status to get medication.
Validate person's verification status as described on Create Medication request Request
10. Validate declaration for a program
Validation purpose: It is needed to check specified params for each medical program.
Declaration should always be validated for each program. Validate skip_medication_request_employee_declaration_verify and skip_medication_request_legal_entity_declaration_verify parameters at medical program settings as described at Create Medication request Request if there are some exclusions.
Generate structure for response
...