Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Specification

Purpose

This WS is designed to reject previously created Medication request Request (patch).

Input parameters (filters)

  • id

Authorize

  1. Verify the validity of access token

  2. Check user scope (scope = 'medication_request_request:reject') in order to perform this action

    1. In case error - generate 401 response

Validate User

Do reject Medication request Request allowed for User if he has one of the following active and approved employee that:

  1. is an author of the Medication request Request (medication_request_request.employee_id)

  2. has an approval on write Care plan if Medication request Request based on the Care plan (medication_request_request.based_on)

  3. is a Doctor who has declaration with the Patient.

    1. in case of error - return 409 ("Only an author, employee with approval on care plan or doctor with an active declaration with the patient can reject medication request request")

Validation transition

  1. For info - status charts: Medication_request_Request

  2. Get Request for Medication request status by $.id

  3. Check status == NEW

    1. if invalid - return 409 error (message: "Invalid status Request for Medication request for reject transition!")'

Update status

  1. Update (Set values) Request for Medication request

    1. status  =  REJECTED

    2. updated_by = user_id

    3. updated_at = timestamp