Table of Contents |
---|
Purpose
...
Page Properties | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
...
Preconditions
Person request must be approved.
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id |
| String | Required | eeebb86d-5cba-43c9-885b-6482ecaf826b |
Filters
No
Dictionaries
...
Request structure
Example:
...
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9{{access_token}}
api-key:uXhEczJ56adsfh3Ri9SUkc4en{{secret}}
mds_drfo:2534157686{{secret}}
Request data validation
Validate DRFO
...
|
Validate request
Validate request using JSON schema (See specification)
In case validation fails - generate 422 error.
Check patient request status
If status is not APPROVED, - returned error 'Incorrect status'.
Check signed content
Check decoded signed content with previously created on IL.db.
...
In case if they are not equal - generate 422 error (message: "Signed content does not match the previously created content")
Check legal entity id
Patient request can be signed by any employee with necessary scopes in equal legal_entity_id.
...
If "patient_signed" is not present in request, return 422 ("required property patient_signed was not present")
If "patient_signed"=false in request, return 422 ("value is not allowed in enum")
Processing
Update patient request
Update patient request:
Change entity status in IL_DB.patient_request to SIGNED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Create person
After singed patient request create new person on DB.mpi.
...
Also to table person_auth_methods add this method as default(field `default` = TRUE) - it's for all auth_method.type
Check if Person should be sent for verification
Please note, (GraphQL) Update person refers to this validation.
if person’s data match any of the following rules:
validate all Rules 01-05
Person has OFFLINE auth method
if create Person process, check Request
if update Person process, check within MPI.person_athentication_methods tablePerson's age >= no_self_auth_age and no_tax_id = true (check in Request)
Person's age >= no_self_auth_age and Person’s tax_id is invalid (i.e. not match with birth date or gender or invalid checksum) (check in Request)
Person’s age < no_self_auth_age and has document with type BIRTH_CERTIFICATE_FOREIGN (check in Request)
Person’s age >= no_self_auth_age and has document with type PERMANENT_RESIDENCE_PERMIT (check in Request)
then
manual verification is needed
Set
MPI.persons.verification_status
=VERIFICATION_NEEDED
andSet
MPI.persons.verification_reason
=RULES_TRIGGERED
andCreate StateChangeEvent in event manager with new verification status
else
person will be verified with Registers
Set
MPI.persons.verification_status
=VERIFICATION_NEEDED
andSet
MPI.persons.verification_reason
=RULES_PASSED
andSet
MPI.persons.verification_comment
=NULL
andCreate StateChangeEvent in event manager with new verification status
Response structure
Example:
Expand | ||
---|---|---|
| ||
|
Post-processing processes
API paragraph not found
HTTP status codes
Page Properties | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Backward compatibility
...