Info |
---|
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
Table of Contents |
---|
Properties of a REST API method document
...
id | page_properties_method_REST API |
---|
...
Document type
...
Метод REST API
...
Document title
...
[Document status] REST API [Назва методу] [ID методу]
...
Guideline ID
...
GUI-0011
...
Author
...
@
...
Document version
...
1
...
Document status
...
DRAFT
...
Date of creation
...
ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)
...
Date of update
...
ХХ.ХХ.ХХХХ (дата зміни версії)
...
Method API ID
...
API-005-001-001-0017
...
Microservices (namespace)
...
IL
...
Component
...
Contract reports
...
Component ID
...
COM-005-001
...
Link на API-специфікацію
...
...
Resource
...
{{host}}//api.ehealth.gov.ua/api/patients/id/encounter_package
...
Scope
...
reimbursement_report:read
...
Protocol type
...
REST
...
Request type
...
GET
...
Sync/Async
...
Sync
...
Public/Private
...
Public
Purpose
This method is designed to create reimbursement report which is based on Medication request and Medication dispense data.
Logic
The access and ability to create and get the report have
MSP (OWNER)
PHARMACY (PHARMACY_OWNER)
...
Info |
---|
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
Table of Contents |
---|
Properties of a REST API method document
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
Purpose
This method is designed to create reimbursement report which is based on Medication request and Medication dispense data.
Logic
The access and ability to create and get the report have
MSP (OWNER)
PHARMACY (PHARMACY_OWNER)
To get the report the creator must input requested period (date_from_request, date_to_request, date_from_dispense, date_to based on date of dispense or request). In response will be received the json with data.
OWNER will receive info only about Medication Requests which were made by his legal_entity and corresponding Medication Dispenses.
PHARMACY_OWNER is allowed to view only info related to Medication Dispenses which were made by his PHARMACY and corresponding Medication Requests.
Configuration parameters
Description of the configuration parameters that are used when processing a request in the system
Dictionaries
Provides a list of links to dictionaries that are available in Confluence
Input parameters
Description of input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | composition_id | M | String ($uuid) (path) | Composition object ID | 89678f60-4cdc-4fe3-ae83-e8b3ebd35c59 |
2 |
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Expand | ||
---|---|---|
| ||
|
...
Validate input date_from and date_to
if date_from_request is not null then: date_from_request<=date_to_request and date_to_request must be filled
in case of error - return 422 error:
Code Block {:error, [{%{ description: "Input dates are not valid", params: [], rule: :invalid }, "$.date_from_request"}]}
if date_from_dispense is not null then: date_from_dispense<=date_to_dispense and date_to_dispense must be filled
in case of error - return 422 error:
Code Block {:error, [{%{ description: "Input dates are not valid", params: [], rule: :invalid }, "$.date_from_dispense"}]}
Input dates filter the field:
date_from_request/date_to_request comparing to field medication_requests.created_at
date_from_dispense/date_to_dispense comparing to field medication_dispenses.dispensed_at
If there is no data available for the requested period of time in response must be sent empty json, no error is shown.
Processing
...
date_from_dispense"}]}
Input dates filter the field:
date_from_request/date_to_request comparing to field medication_requests.created_at
date_from_dispense/date_to_dispense comparing to field medication_dispenses.dispensed_at
If there is no data available for the requested period of time in response must be sent empty json, no error is shown.
Processing
Prepare response
Prepare response with fields described below.
To get most of the fields FULL OUTER JOIN tables medication_requests and medication_dispenses (in case there is no dispense to request fill only first part of the table related to Medication Request). To get more details about employee, division, legal_entity, medication, medical_program, dispense_details next tables also should be joined:
employees
parties
legal_entities
divisions
medications
medical_programs
medication_dispense_details
Source | Field | Name | Description |
---|
Source | Field | Name | Description |
---|---|---|---|
medication_requests | id | medication_request_id |
|
medication_requests | request_number | request_number |
|
medication_requests | created_at | request_created_at |
|
medication_requests | started_at | request_started_at |
|
medication_requests | ended_at | request_ended_at |
|
medication_requests | dispense_valid_from | dispense_valid_from |
|
medication_requests | dispense_valid_to | dispense_valid_to |
|
medication_requests | person_id | request_person_id |
|
employees | employee_id | employee_id |
|
employees | legal_entity_id | msp_id |
|
legal_entities | name | msp_name |
|
legal_entities | edrpou | msp_edrpou |
|
employees | party_id | doctor_party_id |
|
parties | last_name | doctor_last_name |
|
parties | first_name | doctor_first_name |
|
parties | second_name | doctor_second_name |
|
employees | position | doctor_position |
|
employees | employee_type | employee_type |
|
medication_requests | division_id | msp_division_id |
|
divisions | name | msp_division_name |
|
divisions | addresses.[type='RESIDENCE'] | msp_addresses |
|
divisions | mountain_group | msp_division_mountain_group |
|
medication_requests | medication_id | innm_dosage_id |
|
medications | name | innm_dosage_name |
|
medications | form | innm_dosage_form |
|
medication_requests | medication_qty | request_medication_qty |
|
medication_requests | status | request_status |
|
medication_requests | rejected_at | request_rejected_at |
|
medication_requests | rejected_by | request_rejected_by |
|
medication_requests | reject_reason | request_reject_reason |
|
medication_requests | medical_program_id | request_medical_program_id |
|
medical_programs | name | request_medical_program_name |
|
medical_programs | is_active | request_medical_program_is_active |
|
medication_dispenses | id | medication_dispense_id |
|
medication_dispense_details | medication_id | medication_id |
|
medications | name | medication_name |
|
medications | manufacturer.name | manufacturer_name |
|
medications | code_atc | code_atc |
|
medications | form | medication_form |
|
medications | {container} | container |
|
medications | package_qty | package_qty |
|
medication_dispense_details | medication_qty | disbursed_medication_qty |
|
medication_dispense_details | sell_price | sell_price |
|
medication_dispense_details | sell_amount | sell_amount |
|
medication_dispense_details | discount_amount | discount_amount |
|
medication_dispense_details | reimbursement_amount | reimbursement_amount |
|
medication_dispenses | medical_program_id | dispense_medical_program_id |
|
medical_programs | name | dispense_medical_program_name |
|
medication_dispenses | dispensed_at | dispensed_at |
|
medication_dispenses | legal_entity_id | pharmacy_id |
|
medication_dispenses | party_id | pharmacist_id |
|
parties | first_name | pharmacist_first_name |
|
parties | second_name | pharmacist_second_name |
|
parties | last_name | pharmacist_last_name |
|
legal_entities | name | pharmacy_name |
|
legal_entities | edrpou | pharmacy_edrpo |
|
medication_dispenses | division_id | pharmacy_divsion_id |
|
divisions | division_name | pharmacy_divsion_name |
|
divisions | addresses.[type='RESIDENCE'] | pharmacy_addresses |
|
divisions | mountain_group | pharmacy_division_mountain_group |
|
medication_dispenses | status | dispense_status |
|
Response structure examples
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 | 1000 | 200200 | ResponseResponse |
| 200 | ||||
3 | 401401 |
| Access Access token validation failed | 401 | |||||
4 | 403 | Employee is not active |
| ||||||
5 | 403 | Invalid scope | |||||||
6 | 403 | Legal_entity type is not allowed to get the report | |||||||
7 | 403 | Legal entity is not active Employee is not active |
| 403 | 5 | 422 | |||
8 | 422 | At least one of input dates must be not empty | Validation failed422 | ||||||
9 | 6 | Специфічні | |||||||
710 | 422 | Only for active MPI record can be created medication request! |
Post-processing processes
Description of actions performed on data after processing
Technical modules where the method is used
List of pages describing technical modules where the method is used
Page Properties Report | ||||
---|---|---|---|---|
|
...