...
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)
Validate
...
ID
Check person_id ID exists and belongs to preperson
Check ID exists in MPI.personsCheck there is no
In case error - 404
Check the entry in MPI.persons with this person_idID has flag preperson=true
In case error - return 422 (Person_id doesn’t belong to preperson)
Convert person_id into patient_id. Check patient_id exists in medical_data.patients collection
In case error - 404
Check preperson has status=active
In case error - return 422 (Preperson is not active)
...
Check external_id is not empty.
In case of error - return 422 (external_id should not be empty)
Update object in DB
...
persons table
Parameter | Source | Description |
---|---|---|
external_id | Request: external_id | Identifier from external system, required. Get from request body. Required |
updated_at | timestamp: now() | Get current date-time |
updated_by | uuid | Extract user from token |