Versions Compared

Key

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

Purpose

This WS is designed to Pre-qualify data of Medication request Request (post) - check whether it's possible to use Medication request within the particular Medical program.

There are two types of medication requests:

  • plan - The request represents an intention to ensure something occurs without providing authorization for others to act. Medication request with type plan can't be dispensed and only provide the instruction to administer the medicine. It also can't be qualified

  • order - The request represents a request/demand and authorization for action. Medication request with type order can be dispensed.

Key points

...

Only authenticated and authorized users with appropriate scope can invoke Prequalify Medication Request Request (MRR)

...

This method simply returns the result of data validation within each submitted medical program, but not creates any entities in the system

...

Each Medical program may have its unique conditions for the medication dispense. It can be based on analysis of personal info, medications list, terms, locations and combinations of them

...

Any Medical program can have separate block of branching logic configured at medical program settings by NHS administrator

...

Сompatibility is checked only for programs which are available in payload (array)

...

Table of Contents

Purpose

This WS is designed to Pre-qualify data of Medication request Request (post) - check whether it's possible to use Medication request within the particular Medical program.

There are two types of medication requests:

  • plan - The request represents an intention to ensure something occurs without providing authorization for others to act. Medication request with type plan can't be dispensed and only provide the instruction to administer the medicine. It also can't be qualified

  • order - The request represents a request/demand and authorization for action. Medication request with type order can be dispensed.

Specification

Page Properties

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-reimbursement/medication-request-requests/prequalify-medication-request-request

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

Resource

/api/medication_request_requests/prequalify

Посилання на ресурс, наприклад: /api/persons/create

Scope

medication_request_request:write

Scope для доступу

Components

ePrescription

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

POST

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Sync

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

Public/Private/Internal

Public

Logic

API paragraph not found

prequalify

Посилання на ресурс, наприклад: /api/persons/create

Scope

medication_request_request:write

Scope для доступу

Components

ePrescription

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

POST

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Sync

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

Public/Private/Internal

Public

Preconditions

  1. Only authenticated and authorized users with appropriate scope can invoke Prequalify Medication Request Request (MRR)

  2. This method simply returns the result of data validation within each submitted medical program, but not creates any entities in the system

  3. Each Medical program may have its unique conditions for the medication dispense. It can be based on analysis of personal info, medications list, terms, locations and combinations of them

  4. Any Medical program can have separate block of branching logic configured at medical program settings by NHS administrator

  5. Сompatibility is checked only for programs which are available in payload (array)

  6. Successful invocation of the method returns decision for each program if it is valid or not to create Medication Request with submitted combination of parameters in the payload. If program status is invalid, the reason must be saved and returned in response.

Logic

Технічний опис бізнес-процесу виписування рецепту в ЕСОЗ (загальний процес для усіх рецептурних ЛЗ, в т.ч. і тих, які підлягають реімбурсації)

Input parameters

ATTRIBUTES - see on Apiary

...

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

Request data validation

Validate container_dosage field

$.container_dosage - volume of a medication’s primary container, which is requested by a doctor or issuer of a medication request, to be dispensed to patient.

  1. Validate $.container_dosage field by schemata

    1. $.container_dosage.code and $.container_dosage.value should be both filled

      1. in case of error return 422 error ("required property %{property} was not present")

    2. $.container_dosage.system should be “MEDICATION_UNIT”

      1. in case of error return 422 error ("value is not allowed in enum")

    3. if $.container_dosage is filled then $.container_dosage.unit should be checked with the MEDICATION_UNIT dictionary by $.container_dosage.code as a key.

      1. in case of error return 422 error ("value is not allowed in enum")

Validate priority

  1. Check by schemata if $.priority is filled with the value of MEDICATION_REQUEST_PRIORITY dictionary

    1. in case of error return 422 error ("value is not allowed in enum")

Validate prior_prescription

  1. Check that $.prior_prescription is UUID, exists and belongs to this person:

    1. is_active = true, and the same person. 

      1. in case of error - return 422 (message: "Prior prescription is not found")

Validate medication request type

...

Expand
titleSQL script example
Code Block
SELECT m0.id, m2.id, m2.package_qty, m2.package_min_qty, m3.id, m3.name
FROM medications AS m0
         INNER JOIN ingredients AS i1 ON i1.medication_child_id = {$.medication_id}
         INNER JOIN medications AS m2 ON i1.parent_id = m2.id
         INNER JOIN medical_programs AS m3 ON m3.id = {$.medical_program_id}
         INNER JOIN program_medications AS p4 ON (m3.id = p4.medical_program_id) AND (p4.medication_id = m2.id)
WHERE (i1.is_primary = TRUE)
  AND (m0.id = {$.medication_id})
  AND (m0.type = 'INNM_DOSAGE')
  AND (m0.is_active = TRUE)
  AND (m2.is_active = TRUE)
  AND (m3.medication_request_allowed = TRUE)
  AND (p4.is_active = TRUE)
  AND (p4.medication_request_allowed = TRUE)

2. Check if there is at list one record of Brand with requested primary container volume

a. if not exist - return 404 error (message: "Not found any appropriate medication with such container parameters")

3. Check if there is at list one record medication_qty <= max_request_dosage or (max_request_dosage is null)

a. if not exist - return 404 error (message: "Not found any appropriate medication complying with max_request_dosage limit")

4. Check compliance of medication quantity: remainder of the division (medication_qty/package_min_qty) is equal to 0

a. in case it is not equal to zero - return 422 “The amount of medications in medication request must be divisible to package minimum quantity“

...

Validate employee_id as described on Create Medication request Request. Except on Prequalify method a declaration has not checked for the employee.

6. Check Care plan and Activity

...

  1. Validate "context" is an active (not entered-in-error) entity from corresponding dictionary, that belongs to the current patient

    1. Validate there is an entity in collection $.data.context.identifier.type.coding[0].code with id == $.data.context.identifier.value that belongs to the current patient

      1.  in case of error - return 200 with status = INVALID and rejection_reason = “Entity not found“

    2. encounter diagnosis is not empty in $.encounter.diagnosis

      1. in case of error return 422 ("Encounter without diagnosis can not be referenced")

    3. Validate context.identifier.type.coding[0].code = encounter

      1. in case of error return 422 ("value is not allowed in enum")

    4. encounter diagnosis is not empty in $.encounter.diagnosis

      1. in case of error return 422 ("Encounter without diagnosis can not be referenced")

9. Check person

It is needed to check if person has allowed verification status to get medication.

...

11. Check provision for a programs

It is needed to check if medical program can be provided by pharmacies.

  1. If medical program has funding_source = LOCAL:

    1. Check there is exists any active medical program provision with msp_legal_entity_id equal to employee's legal entity

      1. in case of error - return 200 with status = INVALID and rejection_reason = "Medical program is not provided for legal entity specified in the medication request"

Dictionaries

API paragraph not found

...

Expand
titleResponse example
Code Block
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  },
  "data": [
    {
      "program_id": "59781de0-2e64-4359-b716-bcc05a32c10f",
      "program_name": "Програма \"Доступні ліки\"",
      "status": "INVALID",
      "rejection_reason": "Innm not on the list of approved innms for program 'DOSTUPNI LIKI' !"
    }
  ]
}

Post-processing processes

...

HTTP status codes

HTTP status code

Message

What caused the error

200

Response

 

401

Invalid access token

403

Your scope does not allow to access this resource. Missing allowances: medication_request_request:write

409

Plan can't be qualified

422

  • required property %{property} was not present

  • value is not allowed in enum

  • Prior prescription is not found

  • Only employee of active divisions can create medication request!

  • Ended date must be >= Started date!

  • Started date must be >= Created date!

  • Create date must be >= Current date - MRR delay input!

  • The amount of medications in medication request must be divisible to package minimum quantity

  • It's to early to create new medication request for such innm_dosage and medical_program_id

  • Encounter without diagnosis can not be referenced

  • The amount of medications in medication request must be divisible to package minimum quantity

 

Backward compatibility

...