...
Only authenticated and authorized SPECIALIST, ASSISTANT, RECEPTIONIST employees can update external_id of preperson.
Preperson can be updated only in OUTPATIENT or EMERGENCY legal entity type, if MPI identifier of preperson is being known (returns after Create preperson).
Only external_id field can note and status fields can not be updated.
Update allowed for prepersons with status = ACTIVE active.
Authentication
Verify the validity of access token
Return 401 in case validation fails
Check user scopes in order to perform this action (scope = 'preperson:update')
Return 403 in case invalid scope(s)
...
Check ID exists and belongs to preperson
Check ID exists in MPI.personsprepersons
In case error - 404
Check the entry in MPI.persons with this ID has flag preperson =true
In case error - return 422 (Person_id doesn’t belong to preperson)
Check preperson has status=active
In case error - return 422 (Preperson is not active)
Validate schema
Validate shcema (TBD)
Check if any allowed field is submitted and have value:
first_name
last_name
second_name
gender
external_id
birth_date
emergency_contact
confidant_person
In case of error - return 422 (Schema validation failed)
Check if any forbidden field is submitted:
note
status
In case of error - return 422 (
Schema validation failed)
Update object in DB
persons prepersons table
Parameter | Source | Description |
---|---|---|
external_id | Request: external_id | Identifier from external system, required. Get from request body. Required |
first_name | Request: first_name |
|
second_name | Request: second_name |
|
last_name | Request: last_name |
|
gender | Request: gender |
|
birth_date | Request: birth_date |
|
emergency_contact | Request: emergency_contact |
|
confidant_person | Request: confidant_person |
|
updated_at | timestamp: now() | Get current date-time |
updated_by | uuid | Extract user from token |