Table of Contents |
---|
...
Decode content that is encrypted in an electronic digital signature.
Use Digital signature WS. Method checks digital signature and returns result.
See service specification
Validate DRFO
- Check that DRFO in Certificate details exists and not empty
- Check that DRFO in Certificate details is equal to DRFO in Party
- Get party.tax_id using employee_id in person payload
- Compare DRFO in Certificate with party.tax_id
- Convert DRFO and TAX_ID to uppercase
- Compare DRFO and TAX_ID as Cyrillic letters
- Convert DRFO to Cyrillic and compare as Cyrillic letters
- In case validation fails - generate 422 error
...
Patient request can be signed by any employee with necessary scopes in equal legal_entity_id.
- Check that ID in URL exists in the system
- Return 401 in case validation fails
- Check that patient request belongs to the same legal entity as the user
- In case of error - return 403
...
- 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.
In table person
in filed conf_person
don't write information.
If person has confidant auth_method = third_person
, add in table person_auth_methods
row with type = third_person
, value = id (confidant_person_id), alias (from payload).
Add person to Person_connection
If person request has information of confidant person - add row to table person_connection
in db.mpi after signed patient requestAlso to table person_auth_methods add
is_primary
(after Create patient request = TRUE), is_active
.
Start date: start_date = Current_date()
End date:
if (person.age < 18) { end_date = min(birth_date + 18y - 1d, start_date + third_person_term); } else { end_date = start_date + third_person_term; } |
Person_auth_methods
Name | Type | M/O | Comment |
---|---|---|---|
id | uuid | M | |
person_id | uuid | M |
related_person_id
type | varchar | M |
OFFLINE, OTP or THIRD_PERSON | |
value | varchar |
O | if THIRD_PERSON would be third_person_id | ||
started_at | timestamp | M | |
end_at | timestamp | M |
documents_relationship
alias | varchar | M | |
is_primary | boolean | M | |
is_active | boolean | M | |
inserted_at | timestamp | M | |
inserted_by | uuid | M | |
updated_at | timestamp | M | |
updated_by | uuid | M |