Table of Contents | ||||
---|---|---|---|---|
|
...
Validate id - medication_request_id exists
Return 404 in case (not found medication request in DB with this ID)
Validate [programs.id] - medical programs id exists
Return 422 in case validation fails (422 EView - not found medical program in DB with this ID)
...
Verify Care plan:
It should be in active status
in case of error - return 409 (message: "Invalid care plan status")
Care plan's period end (if exist) should be greater than current date or equal.
in case of error - return 409 (message: “Care plan expired“)
Verify care plan Activity:
It has scheduled, in_progress status
in case of error - return 409 (message: "Invalid activity status")
Validate division
If division_id submitted:
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")
If chart parameter DISPENSE_DIVISION_DLS_VERIFY is on, then validate division is DLS verified (dls_verified=true)
in case of error - return 409 "Division is not verified in DLS"
If chart parameter MEDICAL_PROGRAM_PROVISION_VERIFY, then check division provide each submitted program. For each Medical Program Provision validate following:
If the medical program has no setting skip_contract_provision_verify or it is equal to false/null:
provision exist and active:
in case of error - return status=INVALID for a program, rejection_reason= "Division does not provide the medical program"
provision relates to the actual reimbursement contract: contract.start_date <= current_date <= contract.end_date, is_active = true, status = VERIFIED.
in case of error - return status=INVALID for a program, rejection_reason="Medical program provision is not related to any actual contract for the current date"
else if skip_contract_provision_verify = true, then skip provision verification for the medical program
Logic for qualify (analyze compliance with programs)
...