Purpose
This method is designed to create reimbursement report which is based on Medication request and Medication dispense data for NHS admin
Specification
Logic
API paragraph not found
Request structure
API paragraph not found
Authorize
Verify the validity of access token
Return 401 in case validation fails
Check user scopes in order to perform this action (scope = 'reimbursement_report:download')
Return 403 in case invalid scope(s)
Headers
API paragraph not found
Request data validation
Validate input dates
There is 2 available dates for the filtering: date_from_dispense and date_to_dispense. Both of them must be filled.
In case of error show 422 error with message must be shown ( "Input dates must be filled")
Validate input date_from and date_to
if date_from_request is not null then: date_from_dispense<=date_to_dispense and date_to_dispense must be filled
in case of error - return 422 error:
{:error, [{%{
description: "Input dates are not valid",
params: [],
rule: :invalid
}, "$.date_from_dispense"}]}
Input dates filter the field:
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 file, no error is shown.
Processing
API paragraph not found
Response structure
Prepare response
Output format - text/csv
Response example
Prepare response with fields described below and conditions described below:
first row is for headers (REQUESTED_FIELD which is below)
NHS admin will receive all Medication Dispenses and corresponding Medication Requests.
in case there is no Medication Dispenses for Medication Requests, Medication Requests won't be shown in the report
for Medication Dispense: status='PROCESSED'
REQUESTED_FIELD | REPORT_FIELD | SOURCE | COMMENT |
---|---|---|---|
Назва суб’єкту господарювання (аптека) | pharmacy_name | medication_dispense.legal_entity.name | |
Код ЄДРПОУ суб'єкту господарювання (аптека) | pharmacy_edrpou | medication_dispense.legal_entity.edrpou | |
Назва закладу охорони здоров’я | msp_name | medication_request.legal_entity.name | |
Код ЄДРПОУ закладу охорони здоров’я | msp_edrpou | medication_request.legal_entity.edrpou | |
Лікар, що виписав рецепт (ПІБ) | doctor_name | medication_request.employee.party.last_name&first_name&second_name | |
Лікар, що виписав рецепт (ID) | doctor_id | medication_request.employee.id | |
№ Номер рецепта | request_number | medication_request.request_number | |
Дата створення рецепта | created_at | medication_request.created_at | |
Дата відпуску рецепта | dispensed_at | medication_dispense.dispensed_at | |
Міжнародна непатентована назва лікарського засобу (словник реєстру) | innm_name | select i.namefrom ingredients ing inner join innms i on ing.innm_child_id=i.id where ing.parent_id=$medication_dispense.innm_dosage.id and is_primary=true | |
Лікарська форма | innm_dosage_name | medication_request.medication.name | innm_dosage |
Торгова назва лікарського засобу | medication_name | medication_dispense.details.medication.name | |
Сила дії (дозування) | ----- | do not show | |
Форма випуску (словник реєстру) | form | medication_dispense.details.medication.form | |
Кількість одиниць лікарської форми відповідної дози в упаковці, од. | package_qty | medication_dispense.details.medication.package_qty | |
Кількість відпущених упаковок, упак /Кількість відпущених ліків, одиниць | medication_qty | medication_dispense_details.medication_qty | units, not packages |
Фактична роздрібна ціна реалізації упаковки, грн | sell_amount | medication_dispense_details.sell_amount | |
Розмір відшкодування вартості лікарського засобу за упаковку, грн | reimbursement_amount | medication_dispense_details.reimbursement_amount | |
Сума відшкодування, грн | discount_amount | medication_dispense_details.discount_amount | |
Сума доплати за упаковку ЛЗ, грн / Фактична роздрібна ціна за одиницю, грн | sell_price | medication_dispense_details.sell_price | instead we show all fields to be able to calculate this value |
Номер фіксального чеку | payment_id | medication_dispense.payment_id | |
Сума транзакції | payment_amount | medication_dispense.payment_amount |
Post-processing processes
API paragraph not found