Table of Contents |
---|
Purpose
This WS serves for receiving approval from person on action of merge with preperson.
Specification
TBD
Service logic
Only authenticated and authorized OWNER, ADMIN, RECEPTIONIST, DOCTOR employees can use this WS.
Usage of this WS allowed in EMERGENCY, MSP, MSP_PHARMACY, OUTPATIENT, PRIMARY_CARE legal entities.
Person should confirm merge with preperson by auth method chosen on create patient request or create declaration request processes.
Authentication
Verify the validity of access token
Return 401 in case validation fails
Check user scopes in order to perform this action (scope = 'preperson_merge_request:write')
Return 403 in case invalid scope(s)
Validate request
Validate request using schema (TBD)
Validate legal entity
Check that legal entity is active (status = ACTIVE, SUSPENDED)
Extract client_id from token (token.client_id == legal_entity_id)
Check legal entity status (status = ACTIVE, SUSPENDED)
In case of error - return 409 (Legal entity must be ACTIVE or SUSPENDED)
Determine authorization method
Get authorization_method from MPI.person_authentication_methods.
Next steps is similar to determine authorization method process on approve patient request
Update object in DB
mpi.merge_person_preperson_request table
Parameter | Source | Description |
---|---|---|
status | Request: status | Status of the request, required. Set APPROVED |
updated_by | uuid | Extract user from token |
updated_at | timestamp | Get current date-time |