ЕСОЗ - публічна документація

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:

  1. Check that this program medication id relates to provided medical program and relates to provided medication

    1. in case of error - return 422 ('Invalid program medication id')

Calculate program medication id if it is absent in request:

  1. Get last program_medication_id related to medical program and medication

    1. in case of error - return 422 ('There are no active program medications for this program and medication')

Validate Medication multiplicity

  1. if PRM.program_medications.package_qty_divisible == true:

    1. Check that requested medication quantity in dispense for all medications is multiplier of package_min_qty for this medications.id

      1.  Mod($medication_qty, medications.package_min_qty) = 0

        1. 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)')

  2. else:

    1. Check that requested medication quantity in dispense for all medications is multiplier of package_qty for this medications.id

      1.  Mod($medication_qty, medications.package_qty) = 0

        1. 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)')

 

ЕСОЗ - публічна документація