Table of Contents | ||||
---|---|---|---|---|
|
...
Page Properties | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Процеси роботи з випискою електронних рецептів
Preconditions
No
Global and configurable parameters
No
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id | String | Required | a89f6a26-4221-4597-a1d2-542d5e40b565 |
...
No
Authorize
Verify the validity of access token
in case of error - return 401 (“Invalid access token”) in case of validation fails.
Verify that token is not expired
in case of error - return 401 (“Invalid access token”).
Check user scopes in order to perform this action (scope = 'medication_request_request:reject')
return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_request_request:reject”) in case of invalid scope(s).
...
is an author of the Medication request request (medication_request_request.employee_id);
has an approval on write Care plan if Medication request request based on the Care plan (medication_request_request.based_on);
is med_admin from legal entity where Medication request request is created
in case of error - return 409 ("Employee is not author of medication request request, doesn't have approval or required employee type").
Validate transition
Get status of Medication request request by $.id in IL DB. Check that Medication request request is in status 'NEW'
in case of error - return 409 ("Invalid status Request for Medication request for reject transition!")
...
Update Medication request request data in IL DB:
set status = 'REJECTED'
updated_by = user_id
updated_at = now()
if the medication request request is based on the activity with quantity:
Recalculate and set remaining_quantity for the activity as described at Create Medication Request: Validate based_on (p. 2.d.1 )and do not include current MRR
Response structure
See on Apiary
...
Expand | ||
---|---|---|
| ||
|
Post-processing processes
...
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Invalid access token |
|
403 | Your scope does not allow to access this resource. Missing allowances: medication_request_request:reject | |
409 |
|
Backward compatibility
...