Table of Contents |
---|
...
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
- Validate id - medication_request_id exists
- Return 404 in case not found record in DB with this ID
- Read data from `ops_db.medication_requests` by `id`
- Validate legal_entity_id - legal_entity_id exists
- Return 422 in case validation fails (422 EView)
- Validate employee_id - employee_id exists
- Return 422 in case validation fails (422 EView)
- Validate division_id - division_id exists
- Return 422 in case validation fails (422 EView)
- Validate medical_program_id - medical_program_id exists
- Return 422 in case validation fails (422 EView)
- Validate all medication_id - medication_id exists
- Return 422 in case validation fails (422 EView)
- Validate person_id - mpi_id exists
- Return 422 in case validation fails (422 EView)
...
- Verify the validity of access token
- Return 401 in case validation fails
- Check user scopes in order to perform this action (scope = 'medication_request:detaildetails')
- Return 403 in case invalid scope(s)
- Get `client_type` from `mithril.clients`
...