Table of Contents |
---|
...
Link | |
Resource | /api/person_requests |
Scope | person_request:write |
Components | Patient registry |
Microservices | API paragraph not foundil/api fe/admin-web |
Protocol type | REST |
Request type | POST |
Sync/Async | Sync |
Public/Private/Internal | Public |
...
Patient creation request statuses
Preconditions
API paragraph not found
Global and configuration parameters
...
Code Block |
---|
curl -X GET \ {:host}/prm/api/global_parameters |
Input parameters
No
Filters
No
Request structure
...
Expand | ||
---|---|---|
| ||
|
Authorize
Verify the validity of access token
Check user scope person_request:write in order to perform this action
validate client_id belongs to legal_entity with type in ('MSP', 'OUTPATIENT', 'EMERGENCY', 'PRIMARY_CARE')
in case error return 409, "Invalid legal entity type"
validate user belongs to employee with type in "Doctor, Specialist, Receptionist, Assistant"in case error return 409
Headers
Example:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9{{access_token}}
api-key:uXhEczJ56adsfh3Ri9SUkc4en{{secret}}
Request data validation
Validate request
Validate request using JSON schema
Expand | ||
---|---|---|
| ||
|
Validation data request
Validate confidant person
...
in case error return 422 - msg "Confidant person is mandatory for children"
Validate confidant person age >= prm.global_parameters.no_self_auth_age:
in case error return 422 - msg "Incorrect person age for such an action"
Validate "tax_id"
tax_id has validation pattern - `^[0-9]{10}$`
if doesn't match, return error 422 "string does not match pattern ..."
...
If person <prm.global_parameters.no_self_auth_age years, then person.auth_methods.type =
third_person
. Validate that third_person has auth method.type = OTPif third_person.auth_method.type = OFFLINE - error `THIRD PERSON can't have OFFLINE self auth method type`
if third_person.auth_method.type doesn't have active auth method - error `THIRD PERSON doesn't have active valid authentication methods`
If third person >= prm.global_parameters.no_self_auth_age years
in case error return 422, msg "Incorrect person age for such an action"
Person.auth_methods.type = third_persont.id. But on get Person request
or Person
display third_person.auth_method.phone_number.
...
Each link is generated for one one-page document in .pdf, .jpg, .png, .bmp format. Document should be no more than 20 MB. For each type of documents, if couple of rules worked - only one single link is generated.
...
Expand | ||
---|---|---|
| ||
|
Post-processing processes
API paragraph not found
HTTP status codes
...
HTTP status code
...
Message
...
What caused the error
...
201
...
Response
...
...
409
...
Validation failed
...
422
...
Validation failed
Update person request
Update person request
To update the data of an existing person use an endpoint `Create/Update person request`.
...
validate person.id is UUID
in case error return 422
search person by person.id in MPI
in case error return 422, "such person doesn't exist"
search persons in mpi (Пошук персон. Версія 3)
validate person be deduplication model (if score > PERSON_ONLINE_DEDUPLICATION_UPDATE_SCORE, then add mpi_id to person request)
else return error 409, "such person can't be updated. Deduplication update score is lower than system value (less changes should be made)"
Authorize
Verify the validity of access token
Check user scope person_request:write in order to perform this action
Request data validation
Validate request
Validate request using JSON schema
...
Validate that auth_method_current !=NA
Processing
Generate upload URL
Depending on the payload system generates list of signed urls for document scan-copies upload.
...
Code Block |
---|
curl -X POST \ http://localhost:4000/verifications \ -H 'content-type: application/json' \ -d '{ "phone_number": "+380958697084" }' |
Backward compatibility
...
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
201 | Response |
|
409 | Invalid legal entity type Such person exists. Update this person Such person can't be updated. Deduplication update score is lower than system value (less changes should be made) | Validation failed |
422 | Unverified phone number Such a phone already exists more N times Confidant person is mandatory for children Incorrect person age for such an action String does not match pattern ... Required property patient_signed was not present Value is not allowed in enum Document issued date should be in the past Document issued date should greater than person.birth_date Document expiration_date should be in future Expiration_date is mandatory for document_type $.documents.type Unzr or birthdate are not correct Unzr is mandatory for document type NATIONAL_ID This phone number is present more then $.global_parameters.phone_number_auth_limit times in the system Such person doesn't exist Such authentication method doesn't exist Cannot be confirmed by a method with type= NA. Use a different method. | Validation failed |