ЕСОЗ - публічна документація
RC_CSI-3326 CR-550 Create Medication Dispense by Pharmacy User
….
Validate Division
Division must have active pharmacy license in order to dispense medications
Validate division is exist
in case of error - return 409 ("Division not found")
Validate division is active
in case of error - return 409 ("Division is not active")
Validate division belongs to user's legal entity
in case of error - return 409 ("Division does not belong to user's legal entity")
Check division parameters
division.dls_verified must be true
otherwise - return 409 error ('Invalid division dls status')
Get license_types_allowed parameter from settings of medical program from request $.medical_program_id:
if it is exists and not empty, get list of all license types from parameter.
Check that division has active healthcare services with following parameters:legal_entity_id = client_id from access token
division_id = division_id from request
status = 'ACTIVE'
type=’SALE’
licensed_healthcare_service.status = 'ACTIVE'
healthcare_service.license_id is not null and licenses.type = value from license_types_allowed parameter
in case of error - return 409 ('Division must have active licenses to dispense medication request')
Validate production license for division
Get medication_id from request
Check if medications.type == INNM_DOSAGE
Check that division from request has active healthcare service with following parameters:
status = 'ACTIVE'
type=’PRODUCTION’
licensed_healthcare_service.status = 'ACTIVE'
in case of error - return 409 ('Division does not have active license to produce medication')
ЕСОЗ - публічна документація