Table of Contents | ||||
---|---|---|---|---|
|
...
If approval has resource != (care_plan & terms_of_service = ‘INPATIENT’ for care_plan&granted_to.employees.legal_entity_id = care_plans.managing_organization):
If authentication_method_current.type = OTP
system checks verification code via otp_verification service PATCH /verifications/:phone_number/actions/complete
if verification code matches - change is_verified to true
If not - return error
if resource from granted_to = employee AND access_level=read :
Check if there are items /wiki/spaces/FORBIDDEN/pages/2087190554Medical Events filtration by Forbidden groups#Medical-events-to-filter for entities from granted_resource and\or from reason included to the forbidden groups
if there are active items from forbidden group
create approval on each forbidden_group block whose elements appear entities from granted_resource and\or from reason
set is_verified = true
set reason = id of the approval which was verified
set created_by - the same user as for approval, which is verified
set granted_to - the same employee as for approval, which is verified
set granted_by - the same patient as for approval, which is verified
If authentication_method_current.type = offline or null OR approval with resource = care_plan where terms_of_service = ‘INPATIENT’ for care_plan&granted_to.employees.legal_entity_id = care_plans.managing_organization::
change is_verified to true
Search if there exists
active andnot expired approvals with current patient_id, for the same granted_resources, granted_to and access_level as in request:If found - set for existing approvals:
updated_at = now()
updated_by = current user
expired_at = now()
Request structure
See on Apiary
...
Verify the validity of access token
Check user scope approval:create in order to perform this action
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer d368a4b0-4a0e-457a-b267-32359fa6288f
...