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

RC_CSI-3326 CR-550 Create Medication Dispense by Pharmacy User

….
Validate Division

Division must have active pharmacy license in order to dispense medications

  1. Validate division is exist

    1. in case of error - return 409 ("Division not found")

  2. Validate division is active

    1. in case of error - return 409 ("Division is not active")

  3. Validate division belongs to user's legal entity

    1. in case of error - return 409 ("Division does not belong to user's legal entity")

  4. Check division parameters

    1. division.dls_verified must be true

      1. otherwise - return 409 error ('Invalid division dls status')

  5. Get license_types_allowed parameter from settings of medical program from request $.medical_program_id:

    1. 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:

      1. legal_entity_id = client_id from access token

      2. division_id = division_id from request

      3. status = 'ACTIVE'

      4. type=’SALE’

      5. licensed_healthcare_service.status = 'ACTIVE'

      6. healthcare_service.license_id is not null and licenses.type = value from license_types_allowed parameter

        1. in case of error - return 409 ('Division must have active licenses to dispense medication request')

  6. Validate production license for division

    1. Get medication_id from request

    2. Check if medications.type == INNM_DOSAGE

    3. Check that division from request has active healthcare service with following parameters:

      1. status = 'ACTIVE'

      2. type=’PRODUCTION’

      3. licensed_healthcare_service.status = 'ACTIVE'

        1. in case of error - return 409 ('Division does not have active license to produce medication')

 

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