Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Purpose

  • Specification

  • Preconditions

  • Logic

  • Input parameters

  • Filters

  • Request structure

  • Authorize

  • Headers

  • Request data validation

  • Response structure

  • HTTP status codes

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

...

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

...

 

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

Filters

No

Request structure

See on Apiary

Example:

...

titleRequest example

...

Authorize

  1. Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails

  2. Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”)

  3. Check user scopes in order to perform this action (scope = 'medication_request_request:write')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_request_request:write”) in case of invalid scope(s)

Headers

Content-Type:application/json

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.

Validate $.container_dosage field by schemata

...

$.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")

...

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

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

 

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

Filters

No

Request structure

See on Apiary

Example:

Expand
titleRequest example
Code Block

Authorize

  1. Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails

  2. Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”)

  3. Check user scopes in order to perform this action (scope = 'medication_request_request:write')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_request_request:write”) in case of invalid scope(s)

Headers

Content-Type:application/json

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")

  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")

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")if $.container_dosage is filled then $.container_dosage.unit should be checked with the MEDICATION_UNIT dictionary by $.container_dosage.code as a key.

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 error (message: "value Prior prescription is not allowed in enum")

  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")

Validate priority

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

Validate medication request type

Only medication request with type (intent) order can be qualified.

  1. Check medication request intent is order

    1. in case intent == plan - return 409, "Plan can't be qualified"

Validate division

Validate it is exists and active, relates to current legal entity (client_id from token)

  • in case of error - return 422 error

...

Validate prior_prescription

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

...

  • “Only employee of active divisions can create medication request!“

Validate dates:

  1. Check ended_at >= started_at

  2. Check ended_at >= started_at

    1. in case of error - return 422 error “Ended date must be >= Started date!“

  3. Validate started_at >= created_at, but not greater than (created_at +
    1. in case of error - return 422

      (message: "Prior prescription is not found")

Validate medication request type

Only medication request with type (intent) order can be qualified.

  1. Check medication request intent is order

    1. in case intent == plan - return 409, "Plan can't be qualified"

Validate division

Validate it is exists and active, relates to current legal entity (client_id from token)

  • in case of error - return 422 error “Only employee of active divisions can create medication request!“

Validate dates:

    1. error “Ended date must be >= Started date!“

  1. Validate started_at >= created_at, but not greater than (created_at + MEDICATION_REQUEST_REQUEST_EXTENDED_LIMIT_STARTED_AT_DAYS)

    1. if invalid - return 422 error  (message: "The start date should be equal to or greater than the creation date, but the difference between them should be not exceed {{MEDICATION_REQUEST_REQUEST_EXTENDED_LIMIT_STARTED_AT_DAYS}} day(s).")

  2. Validate started_at >= current_date()

    1. if invalid - return 422 error  (message: "Started date must be >= current date!")

  3. Check created_at >= (current date - MEDICATION_REQUEST_REQUEST_EXTENDED_LIMIT_STARTED_AT_DAYS)

    1. if invalid - return 422 error  (message: "The start date should be equal to or greater than the creation date, but the difference between them should be not exceed {{MEDICATION_REQUEST_REQUEST_EXTENDED_LIMIT_STARTED_AT_DAYS}} day(s).")

  4. Validate started_at >= current_date()

    1. if invalid - return 422 error  (message: "Started date must be >= current date!")

  5. Check created_at >= (current date - MEDICATION_REQUEST_REQUEST_DELAY_INPUT)DELAY_INPUT)

    1. in case of error - return 422 “Create date must be >= Current date - MRR delay input!”

Validate dosage instructions

Validate each item as described at Create Medication Request Request: Validate dosage instruction

Validate compliance for programs

Some checks (below in the text) must be passed for the programs

  1. if passed - save the response by this program - status = VALID

  2. if not passed - save response by this program - status = INVALID

Check each medical program in the array is:

  1. is exists

    1. in case of error - return status = INVALID and reject reason = “Medical program not found”

  2. is_active = true

    1. in case of error - return 422 “Create date must be >= Current date - MRR delay input!”

Validate dosage instructions

Validate each item as described at Create Medication Request Request: Validate dosage instruction

Validate compliance for programs

Some checks (below in the text) must be passed for the programs

  1. if passed - save the response by this program - status = VALID

  2. if not passed - save response by this program - status = INVALID

Check each medical program in the array is:

  1. is exists

    1. in case of error - return status = INVALID and reject reason = “Medical program not found”

  2. is_active = true

    1. in case of error - return status = INVALID and reject reason = “Medical program is not active”

1. Check INNM complience for the programs

There is a list of medications (BRANDs, which links to Innms)  which can be used for the program. It must be check whether there is at least one available medication (with `medication_request_allowed` == TRUE)  for the Innm for the particular program 

  1. Check compatibility of innm with medication list for the program

    1. if data is not found:

      1. add to response: status = INVALID

      2. add to response: rejection_reason = "Innm not on the list of approved innms for program {program_name}"

...

titleSQL script example

...

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

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

...

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

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

Check max allowed quantity for the treatment period:

...

Get non-null max_daily_dosage from all filtered above program medications

...

Define max value among max_daily_dosage as highest_max_daily_dosage

...

Get package_min_qty from all related brands, connected to found program medications

...

Define min value among package_min_qty as lowest_package_min_qty

...

    1. status = INVALID and reject reason = “Medical program is not active”

1. Check INNM complience for the programs

There is a list of medications (BRANDs, which links to Innms)  which can be used for the program. It must be check whether there is at least one available medication (with `medication_request_allowed` == TRUE)  for the Innm for the particular program 

  1. Check compatibility of innm with medication list for the program

    1. if data is not found:

      1. add to response: status = INVALID

      2. add to response: rejection_reason = "Innm not on the list of approved innms for program {program_name}"

Expand
titleSQL script example
Code Block

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

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

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

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

  3. Check max allowed quantity for the treatment period:

  • Get non-null max_daily_dosage from all filtered above program medications

  • Define max value among max_daily_dosage as highest_max_daily_dosage

  • Get package_min_qty from all related brands, connected to found program medications

  • Define min value among package_min_qty as lowest_package_min_qty

a. Validate that remainder of the division: (highest_max_daily_dosage × (ended_at - started_at+1)) / one of package_min_qty is equal to 0

i. if true - check medication_qty <= (highest_max_daily_dosage × (ended_at - started_at+1))

1.in case of error - return 422 “The amount of medications in medication request is greater than available maximum for the max_daily_dosage and treatment period limit” 

b. Validate: (medication_qty - (highest_max_daily_dosage × (ended_at - started_at+1))) <

...

lowest_package_min_qty

i. in case of error - return 422 “The amount of medications in medication request is not complying with max_daily_dosage

...

and treatment period limit”

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

...