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

RC_Reject Medication Request (RMDN-356)

Source link - Reject Medication Request

Validate Medication request

  • Get Medication request identifier from the URL. Check Medication request exists in OPS DB

    • in case of error - return 404 (“Not found“).

Validate user

Medication Request rejection is allowed for user if he has one of the following active and approved employee that:

  • is an author of the Medication request Request (medication_request.employee_id);

  • has an approval on write Care plan if Medication Request based on the Care plan (medication_request.based_on);

  • is Med_Admin from legal entity where Medication Request is created

    • in case of error - return 409 ("Employee is not author of medication request, doesn't have approval or required employee type").

  • is an Employee from legal entity where Medication Request is created

    • in case of error - return 409 ("Only an employee from legal entity where medication request is created can reject medication request")

Validate content

  • Validate request using JSON schema

    • in case of error - return 422 ('schema does not allow additional properties' OR 'required property type was not present').

  • Check that signed content contains all required fields and is equal to stored object

    • Decode signed content.

    • Render requested medication request.

    • Check that rendered and decoded data matches (except for reject_reason_code and reject_reason fields)

      • in case of error - return 422 ("Signed content does not match the previously created content").

Note! Medication Request with intent plan and order has different structure:

  • Medical program is required in order.

  • Medical program is absent in plan.

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