Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

This method is designed to create hold (reservation) on medication in order to prevent multiple dispenses under the same Medication Request. This hold lasts certain time (configuration parameter MEDICATION_DISPENSE_EXPIRATION) after with it goes to EXPIRED status.

Specification

Page Properties

Project Name

Електронний рецепт

COVID-certificate

Project abreviation

ePrescription

SVC

Developer

API paragraph not found

Розробник методу API. Наприклад, Edenlab

Project Manager

API paragraph not found

@Єлизавета Гессен-Дармштадська

Tech Lead

API paragraph not found

@Іоанн Воїнов

Product Owner

API paragraph not found

@Нікодім Святогорцев

Вusiness analyst

API paragraph not found

@Пантелеймон Нікомедійський

Status

Status
colourGreen
titleAPPROVED

Status
colourGreen
titleAPPROVED

Version

API paragraph not found

1.0

Date of release

API paragraph not found

Link

https://uaehealthapi.docs.apiary.io/#reference/public.-reimbursement/medication-dispense/create-medication-dispense

Посилання на Apiary або Swagger

Resource

/api/medication_dispenses

Наприклад: /api/persons/create

Scope

medication_dispense:write

Зазначається потрібний scope

Components

ePrescription, Reimbursement

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

API paragraph not found

Перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABAC

Protocol type

REST

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

POST

Тип HTTP методу, який використовується запитом, наприклад: POST | GET…

Sync/Async

Sync

Метод є синхронним чи асинхронним?

Logic

Status Charts (reimbursement)

  1. Dispense of medication is possible only under Medication Request and during the period specified in Medication Request (dispense_valid_from,dispense_valid_to)

  2. Dispense details - several medications of different manufacturers with the same substance can be dispensed at a time. Total of medication_qty should be less or equal to medication quantity specified in Medication Request

  3. If patient wants to split medication dispense of his medication request into several parts, it is possible to create and process medication dispense of the medication request with the desired medication quantity.

...

  1. contracts.type==reimbursement

  2. contracts.status==VERIFIED

  3. Contract dates: start_date <= current_date & end_date >= current_date

  4. contracts.contractor_legal_entity_id=token.client_id

  5. $division_id in contract_divisions

  6. contracts.medical_program_id==$.medical_program_id

  7. сontracts.is_suspended ==false

...

  1. Verify Care plan:

    1. It should be in active status

      1. in case of error - return 409 (message: "Invalid care plan status")

  2. Verify care plan Activity:

    1. It has scheduled, in_progress status

      1. in case of error - return 409 (message: "Invalid activity status")

Validate division

If division_id submitted:

  1. Validate division is active

    1. in case of error - return 409 ("Division is not active")

  2. Validate division belongs to user's legal entity

    1. in case of error - return 409 ("Division does not belong to user's legal entity")

  3. If chart parameter DISPENSE_DIVISION_DLS_VERIFY is on, then validate division is DLS verified (dls_verified=true)

    1. in case of error - return 409 "Division is not verified in DLS"

  4. If chart parameter MEDICAL_PROGRAM_PROVISION_VERIFY, then check division provide each submitted program. For each medical program provision validate:

    1. it is exist and active:

      1. in case of error - return status=INVALID for a program, rejection_reason= "Division does not provide the medical program"

    2. it relates to the actual reimbursement contract: contract.start_date <= current_date <= contract.end_date, is_active = true, status = VERIFIED.

      1. 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"

Validate code

  1. Check that code in request is equal to code in medication_request (or both are empty)

    1. In case code exists in request - it should match with code in medication_request

      1. Return 401 in case code doesn't match (message = "Incorrect code")

    2. In case code is missing in request - check that code in medication_request is NULL

      1. Return 401 in case code in medication_request is not NULL (message = "Missing or Invalid code")

...

Validation 1: Min package quantity is equal to package quantity

  1. Check that requested discount price is equal to allowed reimbursement amount for the requested medication quantity (the way how to calculate allowed reimbursement amount is below)

  • Code Block
    discount_amount <= reimbursement_amount * (medication_qty/package_qty)

...