Versions Compared

Key

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

Purpose

...

Page Properties

Project Name

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

COVID-certificate

Project abreviation

ePrescription

SVC

Developer

API paragraph not found

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

Project Manager

API paragraph not found

Mykhailo Zhushman (Unlicensed)

Tech Lead

API paragraph not found

Product Owner

API paragraph not found

Yevhen Batura NHSU

Вusiness analyst

API paragraph not found

Taras Khometa (Unlicensed)

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-request/qualify-medication-request-by-id

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

Resource

/api/medication_requests/{{id}}/actions/qualify

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

Scope

medication_request:details

Зазначається потрібний 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

API paragraph not found

...

Get Medication Request 

Invoke Get Medication request by ID 

Validation status

  1. For info - status charts: Medication_request

  2. Check Medication Request `status` = ACTIVE

    1. if invalid - return 409 error (message: "Invalid status Medication request for qualify action!")'

...

  1. Verify Care plan:

    1. It should be in active status

      1. in case of error - return 409 (message: "Care plan is not active")

    2. Care plan's period end (if exist) should be greater than current date or equal.

      1. in case of error - return 409 (message: “Care plan expired“)

  2. Verify care plan Activity:

    1. It has scheduled, in_progress status

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

    2. If it has quantity then calculate remaining quantity:

      1. select all MRR in status NEW which based on current activity

      2. select all MR in statuses ACTIVE, COMPLETED based on current activity

      3. calculate reserved at the moment medication quantity as sum of medication_qty in the filtered MRR  and MR list, including medication_qty from current MRR

      4. calculate remaining quantity by subtracting reserved quantity from activity quantity

      5. Check remaining quantity is greater then or equal to zero

        1. in case of error return 409 "The total amount of the prescribed medication quantity exceeds quantity in care plan activity"

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 409 ("Division is not provide the medical program")

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

      1. in case of error - return 409 ("Medical program provision is not actual for the current date")

Logic for qualify (analyze compliance with programs)

...

  1. Dostupni liky

  2. Netsukrovyy diabet

  3. Insuliny z doplatoyu

  4. Insuliny bezoplatno

  5. Epilepsiya

  6. Rozlady psykhiky ta povedinky

Validation purpose: It could be done several dispenses for one medication request per one innm for one patient until sum(medication_dispenses.medication_qty) < medication_request.medication_qty

...

Post-processing processes

API paragraph not foundNo

HTTP status codes

HTTP status code

Message

What caused the error

200

Response

 

401

Invalid access token

 

404

Not found medication request in DB with this ID

 

409

Error

 

422

Error

...