Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
Specification 

...

This WS is designed to return Medication request detail.

According to requirements:

  • User of MSP (DOCTOR, etc)  can see all Medication request for which he is the a doctor (employee_id) 
  • User of MSP (DOCTOR, etc) can see all the Medication requests of the patients whom he has an active decleration with by yourself a doctor (employee_id) 
  • User of PHARMACY or NHS_ADMIN (PHARMACIST, etc) can see all Medication request (without limitations)

Input parameters (filters)

...

Validate request

Validate FK

  1. Validate id - medication_request_id exists
    1. Return  404 in case not found record in DB with this ID
  2.  Read data from `ops_db.medication_requests` by `id`
  3. Validate legal_entity_id - legal_entity_id exists
    • Return 422 in case validation fails (422 EView)
  4. Validate employee_id - employee_id exists
    • Return 422 in case validation fails (422 EView)
  5. Validate division_id - division_id exists
    • Return 422 in case validation fails (422 EView)
  6. Validate medical_program_id - medical_program_id exists
    • Return 422 in case validation fails (422 EView)
  7. Validate all medication_id - medication_id exists
    • Return 422 in case validation fails (422 EView)
  8. Validate person_id - mpi_id exists
    • Return 422 in case validation fails (422 EView)

...

  1. Verify the validity of access token
    1. Return 401 in case validation fails
  2. Check user scopes in order to perform this action (scope = 'medication_request:detaildetails')
    1. Return 403 in case invalid scope(s)
  3. Get `client_type` from `mithril.clients

...