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

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:

  1. Verify Care plan:

    1. It should be in active status

      1. in case of error - return 409 (message: "Invalid care plan status").

    2. Care plan's period end (if exist) should be greater than current date or equal

      1. in case of error - return 409 (message: “Care plan expired“).

  2. Verify care plan Activity:

    1. It has scheduled, in_progress status

      1. in case of error - return 409 (message: "Invalid activity status").

    2. Validate quantity is not exceeded

      1. Select all MD (medication dispenses) in status PROCESSED related to the Medication requests which based_on one activity 

        1. Sum medication_qty in the filtered Medication dispenses as dispensed_qty

        2. medication_qty from current MR as current_qty

        3. Calculate remaining_qty = activity.quantity - (dispensed_qty+current_qty)

      2. Check remaining_qty is greater then zero

        1. error return 409 "The total amount of the dispensed medication quantity exceeds quantity in care plan activity"

 

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