Table of Contents | ||||
---|---|---|---|---|
|
Purpose
...
Table of Contents | ||||
---|---|---|---|---|
|
Purpose
This WS is designed to reject previously created Medication request Request (patch)Request
Key points
Only authenticated and authorized user with appropriate scope can reject Medication request Request.
Medication request Request can be rejected only from ‘NEW' status.
Specification
Page Properties | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Version API paragraph not found 1.0 Date of release API paragraph not found Link Посилання на Apiary або Swagger Resource api/medication_request_requests/{{id}}/actions/reject Наприклад: /api/persons/create Scope medication_request_request:reject Зазначається потрібний scope Components ePrescription, Reimbursement Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription Microservices API paragraph not found Перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABAC Protocol type REST Тип протоколу, який використовується запитом, наприклад: SOAP | REST Request type PATCH Тип HTTP методу, який використовується запитом, наприклад: POST | GET… Sync/Async Sync Метод є синхронним чи асинхронним? |
Logic
API paragraph not found
Preconditions
No
Global and configurable parameters
No
Input parameters
...
Input parameter
...
Values
...
Type
...
Description
...
Example
...
id
...
String
...
Required
...
a89f6a26-4221-4597-a1d2-542d5e40b565
Filters
No
Request structure
API paragraph not found
Authorize
Verify the validity of access token
Check user scope (scope = 'medication_request_request:reject') in order to perform this action
In case error - generate 401 response
Check user's legal entity is legal entity where Medication request Request has been created (medication_request_request.data.legal_entity_id = client_id from token)
In case error - generate 403 response “Medication request Request can not be rejected by employee from another legal entity”
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Validate request
Do reject Medication request Request 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_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 a Doctor whohas declarationwith the Patient.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")
Request data validation
Validation transition
For info - status charts: Medication_request_Request
Get Request for Medication request status by $.id
Check status == NEW
if invalid - return 409 error (message: "Invalid status Request for Medication request for reject transition!")'
Parameters that are used when processing the request
Configuration parameters
Access to the method is defined by the scope medication_request_request:reject. Permission for this scope is determined by the System administrator by configuring scopes in the context of clients and roles.
Dictionaries
API paragraph not found
Processing
Update status
Update (Set values) Request for Medication request
...
status = REJECTED
...
updated_by = user_id
...
|
Logic
Процеси роботи з випискою електронних рецептів
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id | String | Required | a89f6a26-4221-4597-a1d2-542d5e40b565 |
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).
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
Validate user
Medication request 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_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!")
For more information look at Medication request status model .
Parameters that are used when processing the request
Configuration parameters
Access to the method is defined by the scope medication_request_request:reject. Permission for this scope is determined by the System administrator by configuring scopes in the context of clients and roles.
Dictionaries
MEDICATION_REQUEST_BLOCK_REASON
MEDICATION_REQUEST_INTENT
MEDICATION_REQUEST_CATEGORY
MEDICATION_REQUEST_PRIORITY
eHealth/SNOMED/additional_dosage_instructions
eHealth/SNOMED/anatomical_structure_administration_site_codes
eHealth/SNOMED/route_codes
eHealth/SNOMED/administration_methods
eHealth/SNOMED/dose_and_rate
eHealth/ICD10_AM/condition_codes
eHealth/ICPC2/condition_codes
Processing
Update status
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
Example:
Expand | ||
---|---|---|
| ||
|
Post-processing processes
No
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Invalid access token |
|
403Invalid | scopeYour scope does not allow to access this resource. Missing allowances: medication_request_request:reject | |
409 | Error |
Backward compatibility
...
|