ЕСОЗ - публічна документація
RC_Create Medication Dispense by Pharmacy User (CSI-2140)
…
Validate Program medication
In case medications are dispensed to patient under specific medical program, program medication id must be provided provided by client or calculated by the system
In case program medication id exists in request:
Check that this program medication id relates to provided medical program and relates to provided medication
in case of error - return 422 ('Invalid program medication id')
Calculate program medication id if it is absent in request:
Get last program_medication_id related to medical program and medication
in case of error - return 422 ('There are no active program medications for this program and medication')
Validate Medication multiplicity
if PRM.program_medications.package_qty_divisible == true:
Check that requested medication quantity in dispense for all medications is multiplier of package_min_qty for this medications.id
Mod($medication_qty, medications.package_min_qty) = 0
in case of error (if at least one of medication don't pass verification) - return 422 error ('Requested medication brand quantity must be a multiplier of package_min_qty (or package_qty if program_medication.package_quantity_divisible = false)')
else:
Check that requested medication quantity in dispense for all medications is multiplier of package_qty for this medications.id
Mod($medication_qty, medications.package_qty) = 0
in case of error (if at least one of medication don't pass verification) - return 422 error ('Requested medication brand quantity must be a multiplier of package_min_qty (or package_qty if program_medication.package_quantity_divisible = false)')
…
ЕСОЗ - публічна документація