ЕСОЗ - публічна документація
RC_Qualify Medication request by ID (CSI-2803)
Зміни стосуються розділу “Request data validation”, підрозділу “Validate related Care plan”:
Validate related Care plan
If medication_request.based_on is present and not null:
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 quantity is not exceeded
Select all MD (medication dispenses) in status PROCESSED related to the Medication requests which based_on one activity
Sum medication_qty in the filtered Medication dispenses as dispensed_qty
medication_qty from current MR as current_qty
Calculate remaining_qty = activity.quantity - (dispensed_qty+current_qty)
Check remaining_qty is greater then zero
error return 409 "The total amount of the dispensed medication quantity exceeds quantity in care plan activity"
ЕСОЗ - публічна документація