Info |
---|
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
...
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
...
MR should be found by number
Configuration parameters
Description of the configuration parameters that are used when processing a request in the system
Dictionaries
MEDICATION_FORM
COUNTRY
MEDICATION_UNIT
Input parameters
Description of input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | id | M | String | Medication request identifier | 2848a935-5fd7-48ba-b235-a9b5d475c647 |
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Expand | ||
---|---|---|
| ||
|
...
Verify Care plan:
It should be in active status
in case of error - return 409 (message: "Invalid care plan status").
Care plan's period end (if exist) should be greater than current date or equal
in case of error - return 409 (message: “Care plan expired“).
Verify care plan Activity:
It has scheduled, in_progress status
in case of error - return 409 (message: "Invalid activity status").
Validate quantity is not exceeded
Select all MD (medication dispenses) in status PROCESSED related to the Medication requests which based_on one activity
Sum medication_qty in the filtered Medication dispenses as dispensed_qty
medication_qty from current MR as current_qtyCalculate remaining_qty = activity.quantity - (dispensed_qty
+current_qty)
Check remaining_qty is greater then zero
error return 409 "The total amount of the dispensed medication quantity exceeds quantity in care plan activity"
Validate division
Validate division is active
in case of error - return 409 ("Division is not active")
Validate division belongs to user's legal entity
in case of error - return 409 ("Division does not belong to user's legal entity")
If chart parameter DISPENSE_DIVISION_DLS_VERIFY is on, then validate division is DLS verified (dls_verified=true)
in case of error - return 409 "Division is not verified in DLS"
Check division participates in submitted programs. Validate Provision for each Medical Program:
If the medical program has no setting skip_contract_provision_verify or it is equal to false/null:
if medical program in the request has funding_source one of NHS, LOCAL
In case of error - return status=INVALID for a program, rejection_reason="Program was configured incorrectly. Either incorrect source of funding or option skip_contract_provision_verify"
provision exist and active for the division:
in case of error - return status=INVALID for a program, rejection_reason= "Division does not provide the medical program"
if medical program in the request has funding_source = NHS:
provision relates to the actual reimbursement contract: contract.start_date <= current_date <= contract.end_date, is_active = true, status = VERIFIED, contracts.type==reimbursement, contracts.contractor_legal_entity_id=token.client_id, contracts.medical_program_id==$.medical_program_id
in case of error - return status=INVALID for a program, rejection_reason="Medical program provision is not related to any actual contract for the current date"
contract is_suspended = false
in case of error - return status=INVALID for a program, rejection_reason="Contract with number <contract_number> is suspended"
if medical program in the request has funding_source = LOCAL, then check medical_program_provision.msp_legal_entity_id = medication_request.legal_entity_id
in case of error - return status=INVALID for a program, rejection_reson = "Medical program can not be provided for the legal entity specified in the medication request"
else if skip_contract_provision_verify = true, then skip provision verification for the medical program
Get license_types_allowed parameter from settings of medical program from request $.medical_program_id:
if it is exists and not empty, get list of all license types from parameter.
Check that division has active healthcare services with following parameters:legal_entity_id = client_id from access token
division_id = division_id from request
status = 'ACTIVE'
licensed_healthcare_service.status = 'ACTIVE'
healthcare_service.license_id is not null and licenses.type = value from license_types_allowed parameter
in case of error - return status=INVALID for a program, rejection_reason = 'Division does not have active licenses to provide the medical program'
Logic for qualify (analyze compliance with programs)
...
Validation purpose: There is a list of medications (which links to innm_dosage) which can be used for the program. It must be check whether there is at least one available medication for the innm_dosage for the particular program.
Check that there is at least one medication (brand or innm_dosage) associated with medical program that can be dispensed to the patient
Get info from Medication request by id in payload, set temp variable object `_MR`
Validate the compatibility of innm with the medication program list
Search for active innm_dosages that associated with medical program
medications.is_active = true
medications.type = INNM_DOSAGE
program_medications.is_active = true
Search for active brands that have innm_dosage as primary ingredient and are associated with medical program
medications.is_active = true
medications.type = BRAND
ingredients.is_primary = true
program_medications.is_active = true
if nothing found:
add to response: status = INVALID
add to response: rejection_reason = "Innm not on the list of approved innms for program '#{program.name}"
...
Access to the method is defined by the scope medication_request:details. Permission for this scope is determined by the System administrator by configuring scopes in the context of clients and roles.
Processing
A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST API
Response structure examples
...
Collect response array for all programs in payload with status for each (VALID or INVALID) and rejection_reason
For all VALID programs - Get linked medications (type = BRAND) with reimbursement info
Show only active program medications based on start_date and end (start_date must be earlier or equal to current date or empty, end_date must be greater or equal to current date or empty)
Filter participants simultaneously by container_dosage and max_request_dosage
|
...
Also see on Apiary.
Example:
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API response structure, example
Expand | ||
---|---|---|
| ||
|
...
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 | 401 | response | |||
3 | |||||
4 | Специфічні | ||||
5 | 404 | not found medication request in DB with this ID | Не знайдено електронний рецепт у базі даних з цим ідентифікатором | ||
4 | 409 | Invalid status Medication request for qualify action! | Недопустимий статус електронного рецепту для перевірки на відповідність програмі реімбурсації | ||
5 | 409 | Invalid care plan status | Невірний статус плану лікування | ||
6 | 409 | Care plan expired | Закінчився термін дії плану лікування | ||
7 | 409 | Invalid activity status | Недопустимий статус призначення | ||
8 | 409 | The total amount of the dispensed medication quantity exceeds quantity in care plan activity | Загальна кількість лікарського засобу, що зазначена у рецепті перевищує кількість лікарського засобу, що доступна у призначенні плану лікування | ||
9 | 409 | Division is not active | Структурний підрозділ не активний | ||
10 | 409 | Division does not belong to user's legal entity | Структурний підрозділ не належить юридичній особі користувача | ||
11 | 409 | Division is not verified in DLS | У структурного підрозділу відсутня ліцензія на роздрібну торгівлю лікарськими засобами | ||
12 | Program was configured incorrectly. Either incorrect source of funding or option skip_contract_provision_verify | Неправильно визначені налаштування програми. Або вказане некоректне джерело фінансування або встановлено опцію "скинути налаштування верифікації контракту АЗ з НСЗУ | |||
13 | Division does not provide the medical program | Для структурного підрозділу не вказано можливість відпуску ліків за даною програмою відшкодування | |||
14 | Medical program provision is not related to any actual contract for the current date | Забезпечення медичної програми не пов'язане з будь-яким фактичним договором на поточну дату | |||
15 | Contract with number <contract_number> is suspended | Договір з номером <contract_number> призупинено | |||
16 | Medical program can not be provided for the legal entity specified in the medication request | Створення рецепта за обраною програмою не дозволене для вашого закладу | |||
17 | Division does not have active licenses to provide the medical program | Підрозділ не має активної ліцензії для відпуску ліків за даною медичною програмою | |||
18 | Innm not on the list of approved innms for program '#{program.name} | Лікарський засіб відсутній у програмі реімбурсації #{program.name} | |||
19 | For the patient at the same term there can be only 1 dispensed medication request per one and the same innm! | Для пацієнта на той самий термін може бути лише 1 погашений рецепт на один і той самий лікарський засіб | |||
20 | Sum of dispense's medication quantity can not be more then medication_request.medication_qty | Загальна кількість ЛЗ до погашення не може бути більшою, ніж кількість ЛЗ, зазначена у рецепті | |||
21 | Специфічні | ||||
22 | 422 | not found medical program in DB with this ID | Не знайдено медичну програму у базі даних з цим ідентифікатором |
Post-processing processes
No
Technical modules where the method is used
List of pages describing technical modules where the method is used
Page Properties Report | ||||
---|---|---|---|---|
|
...