ЕСОЗ - публічна документація
RC_PreQualify Medication request request (CSI-2140)
…
Validate compliance for programs
Some checks (below in the text) must be passed for the programs
if passed - save the response by this program - status = VALID
if not passed - save response by this program - status = INVALID
Check each medical program in the array is:
is exists
in case of error - return status = INVALID and reject reason = “Medical program not found”
is_active = true
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, that has setting request_allowed = true
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 = "Not found any medications allowed for create medication request for this medical program!"
Check if there is at list one record of Brand with requested primary container volume
a. if not exist - return 422 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)
a. if not exist - return 422 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 (or package_qty if PRM.program_medications.package_qty_divisible == false) from all related brands, connected to found program medications
Define min value among package_min_qty as lowest_package_min_qty (or lowest_package_qty if PRM.program_medications.package_qty_divisible == false)
a. Validate that remainder of the division: (highest_max_daily_dosage × (ended_at - started_at+1)) / one of package_min_qty (or package_qty if PRM.program_medications.package_qty_divisible == false) is equal to 0
i. if true - check medication_qty <= (highest_max_daily_dosage × (ended_at - started_at+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 (or lowest_package_qty if PRM.program_medications.package_qty_divisible == false)
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:
if PRM.program_medications.package_qty_divisible == true:
remainder of the division (medication_qty/package_min_qty) is equal to 0
in case it is not equal to zero - return 422 “The amount of medications in medication request must be divisible to package_min_qty (or package_qty if program_medication.package_quantity_divisible = false)“
else:
remainder of the division (medication_qty/package_qty) is equal to 0
in case it is not equal to zero - return 422 “The amount of medications in medication request must be divisible to package_min_qty (or package_qty if program_medication.package_quantity_divisible = false)“
…
ЕСОЗ - публічна документація