Table of Contents |
---|
Purpose
...
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.
...
Page Properties | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
ATTRIBUTES - see on Apiary
Filters
No
Request structure
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.
Validate $.container_dosage field by schemata
$.container_dosage.code and $.container_dosage.value should be both filled
in case of error return 422 error ("required property %{property} was not present")
$.container_dosage.system should be “MEDICATION_UNIT”
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.in case of error return 422 error ("value is not allowed in enum")
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
Check by schemata if $.priority is filled with the value of MEDICATION_REQUEST_PRIORITY dictionary
in case of error return 422 error ("value is not allowed in enum")
Validate prior_prescription
Check that $.prior_prescription is UUID, exists and belongs to this person:
is_active = true, and the same person.
in case of error - return 422 (message: "Prior prescription is not found")
Validate medication request type
...
Check ended_at >= started_at
in case of error - return 422 error “Ended date must be >= Started date!“
Check Validate started_at >= created_at, but not greater than (created_at
in case of error - return 422 “Started date must be >= Created date!”
Check + MEDICATION_REQUEST_REQUEST_EXTENDED_LIMIT_STARTED_AT_DAYS)
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).")
in case of error - return 422 “StartedValidate started_at >= current_date()if invalid - return 422 error (message: "Started date must be >=Currentcurrent date!”")
Check created_at >= (current date - MEDICATION_REQUEST_REQUEST_DELAY_INPUT)
in case of error - return 422 “Create date must be >= Current date - MRR delay input!”
...
There is a list of medications (BRANDs, which links to Innmsmedications.type = BRAND OR medications.type = INNM_DOSAGE) 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
Check compatibility of innm with medication list for the program
if data is not found:
add to response: status = INVALID
add to response: rejection_reason = "Innm not on the list of approved innms for program {program_name}"
Expand | ||
---|---|---|
| ||
|
2. Check if there is at list one record of Brand with requested primary container volume in case when found medications is not medications.type = INNM_DOSAGE:
a. if not exist - return 404 error (message: "Innm not on the list of approved innms for program {program_name}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 quantityone 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")
Check max allowed quantity for the treatment period. If there in a list of medications is at list one record with medications.type = INNM_DOSAGE do p.4.2 and skip p.4.1
4.1. in case when found medications is medications.type = BRAND:
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))
ii. 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”.
4.2. in case when found medications is medications.type = INNM_DOSAGE:
Get non-null max_daily_dosage from all filtered above program medications
Define max value among max_daily_dosage as highest_max_daily_dosage
a. Validate: ((highest_max_daily_dosage × (ended_at - started_at+1)) - medication_qty) >= 0
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”
Check compliance of medication quantity in case when found medications is not medications.type = INNM_DOSAGE: 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“
2. Check absence the same medications for the programs
...
Example validation: without crossing time
EP | Preconditions # 1 | Result validate #1 | Preconditions #2 | Result validate #2 | Preconditions #3 | Result validate #2 |
---|---|---|---|---|---|---|
PreQualifyMedicationRequestRequest | No records in MedicationRequest | OK | Created record in MedicationRequest | Not valid | Medications request | Not valid |
QualifyMedicationRequestByID | No records in MedicationRequest | Not possible | Create record in MedicationRequest | OK | Medications request | Not valid |
For info - status charts: Medication_request
Get `check_innm_id`
Expand | ||
---|---|---|
| ||
|
...
if found and medical program setting
skip_mnn_in_treatment_periodskip_treatment_period= false (absent):add to response: status = INVALID
add to response: rejection_reason = "It can be only 1 active / completed medication request request or medication request per one innm for the same patient at the same period of time!"
Fetch Medication Request by $
innm_dosge, $medical_program_id, $person_id and max(end_date). In case there is found Medication Request with ended_at>=current_date then next one can be done in:
if (ended_at - started_at + 1) >= MEDICATION_REQUEST_REQUEST_STANDARD_DURATION chart param then
created_at at from prequalify request should be greater then (ended at - MEDICATION_REQUEST_MAX_RENEW_DAY) of the found MRin case of error return 422 error ('It's to early to create new medication request for such innm_dosage and medical_program_id')
if (ended_at - started_at + 1) < MEDICATION_REQUEST_REQUEST_STANDARD_DURATION chart DURATION chart param then
created_at from prequalify request should be greater then (ended at - MEDICATION_REQUEST_MIN_RENEW_DAY) of the found MRin case of error return 422 error ('It's to early to create new medication request for such innm_dosage and medical_program_id')
...
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
...
If medication request has program with
MEDICATION_REQUEST_MAX_PERIOD_DAYrequest_max_period_day in medical program setting:Check that medication request period (ended_at - started_at + 1) less than or equal to medical program setting MEDICATIONsetting
MEDICATION_REQUEST_MAX_PERIOD_DAYrequest_max_period_dayparameterin case of error - return 200 with status = INVALID and rejection_reason = “Period length exceeds allowed value for the medical program“
If medication request has program without MEDICATION
MEDICATION_REQUEST_MAX_PERIOD_DAYrequest_max_period_dayin medical program setting:Check that medication request period (ended_at - started_at + 1) less than or equal to MEDICATIONto
MEDICATION_REQUEST_MAX_PERIOD_DAYrequest_max_period_day parameter from chartsin case of error - return 200 with status = INVALID and rejection_reason = “Period length exceeds default maximum value“
...
Validate "context" is an active (not entered-in-error) entity from corresponding dictionary, that belongs to the current patient
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
in case of error - return 200 with status = INVALID and rejection_reason = “Entity not found“
encounter diagnosis is not empty in $.encounter.diagnosis
in case of error return 422 ("Encounter without diagnosis can not be referenced")
Validate context.identifier.type.coding[0].code = encounter
in case of error return 422 ("value is not allowed in enum")
encounter diagnosis is not empty in $.encounter.diagnosis
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.
...
Declaration should always be validated for each program. Validate skip_medication_request_employee_declaration_verify skip_request_employee_declaration_verify and skip_medication_request_legal_entity_declaration_verify skip_request_legal_entity_declaration_verify parameters at medical program settings as described at Create Medication request Request if there are some exclusions.
11. Check provision for a programs
It is needed to check if medical program can be provided by pharmacies.
If the medical program has no setting skip_contract_provision_verify or it is equal to false/null:
If medical program has funding_source = LOCAL:
Check there is exists any active medical program provision with msp_legal_entity_id equal to employee's legal entity
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
Processing
...
Response structure
Collect array for all programs in payload with status for each (VALID or INVALID) and rejection_reason.
...
Expand | ||
---|---|---|
| ||
|
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 |
|
|