Table of Contents |
---|
...
Get drfo value from digital signature.
Search for existing user in mithril database,
users
table, with tax_id = drfo from digital signature and is_active = trueIf user is found - check it is not blocked (is_blocked <> true)
in case blocked - return 401 ('User is blocked.').
in case not blocked - save
user_id
and proceed to p.3.
If user is not found - proceed to https://e-health-ua.atlassian.net/wiki/spaces/PCABEH/pages/1759939923518201706777/warrantyRC_PIS.+Patient+sign-up+registration#Search+registration+DRACS+2.0#Search-or-create-person
Search for existing person in mpi database,
persons
table, with id = person_id from found user, status = active and is_active = truein case person not found - return 401 ('Person not found.')
in case person found - check its age is greater then no_self_auth_age global parameter
in case of error - return 401 ('Incorrect person age for such an action.')
in case persons age is correct - save
user_id
and proceed to https://e-health-ua.atlassian.net/wiki/spaces/PCABEH/pages/1759939923518201706777/warrantyRC_PIS.+Patient+sign-up+registration#Generate+registration+DRACS+2.0#Generate-authorization-token
Search or create person
Search for existing active person in mpi database with data from person registration request according to existing process, described here https://e-health-ua.atlassian.net/wiki/spaces/PCABEH/pages/1759939923518201706777/warrantyRC_PIS.+Patient+sign-up+registration#Searchregistration+DRACS+2.0#Search-or-create-person
Calculate score of comparison between found active persons and person registration request using existing deduplication process, described here https://e-health-ua.atlassian.net/wiki/spaces/PCAB/pages/17599401059 Deduplication process NEW
Compare found score with PIS_ONLINE_DEDUPLICATION_MATCH_SCORE config parameter, set to ‘0.95’:If one active person with match score > PIS_ONLINE_DEDUPLICATION_MATCH_SCORE was found - check its age is greater then no_self_auth_age global parameter
in case of error - return 401 ('Incorrect person age for such an action.')
in case persons age is correct - save
person_id
and proceed to p.2.
If more than one active person with match score > PIS_ONLINE_DEDUPLICATION_MATCH_SCORE was found - return 401 ('It is impossible to uniquely identify the person.')
If no active person with match score > PIS_ONLINE_DEDUPLICATION_MATCH_SCORE was found - proceed to p.3.
Search for existing user in mithril database,
users
table, with person_id = person_id from found person and is_active = trueIf user is found - check it is not blocked (is_blocked <> true)
in case blocked - return 401 ('User is blocked.').
in case not blocked - update user, set tax_id = drfo from digital signature, set settings.trusted_source = true, save
user_id
and proceed to https://e-health-ua.atlassian.net/wiki/spaces/PCABEH/pages/1759939923518201706777/warrantyRC_PIS.+Patient+sign-up+registration#Generateregistration+DRACS+2.0#Generate-authorization-token
If user is not found - proceed to https://e-health-ua.atlassian.net/wiki/spaces/PCABEH/pages/1759939923518201706777/warrantyRC_PIS.+Patient+sign-up+registration#Create+registration+DRACS+2.0#Create-user
Create new patient in mpi database, set values in following tables based on person registration request:
persons
tableperson_phones
tableperson_addresses
tableperson_documents table
person_authentication_methods
table
Save signed content to media storage
Submit person on verification - create record in
person_verifications
table forperson_id
, set values for each verification stream:Manual NHS verifiation
IF
$.person.documents
contains document with type = 'PERMANENT_RESIDENCE_PERMIT' or$.person.unzr
is not empty and first 8 digits of$.person.unzr
!=$.person.birth_date
or$.person.documents
contains document with type from PIS_PERSON_LEGAL_CAPACITY_DOCUMENT_TYPES config parameter
- scan copies of persons documents must be uploaded to media storage after persons registration using https://e-health-ua.atlassian.net/wiki/spaces/PCAB/pages/17599400482 PIS. Initialize Person documents uploadset nhs_verification_status = NOT_VERIFIED
set nhs_verification_reason = DOCUMENTS_TRIGGERED
else - scan copies of persons documents are not needed, set verification status according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2#Manual+v2+DRACS+2.0#Manual-NHS-verification
DRFO registry verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2#DRFO+v2+DRACS+2.0#DRFO-registry-verification
DRACS death acts registry verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2#DRACS+v2+DRACS+2.0#DRACS-death-acts-registry-verification
DRACS birth acts registry verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2#DRACS+v2+DRACS+2.0#DRACS-birth-acts-registry-verification
DRACS name change acts registry verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2#DRACS+v2+DRACS+2.0#DRACS-name-change-acts-registry-verification
Legal capacity verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2_EN#Legal+DRACS+2.0#Legal-capacity-verification
Calculate cumulative person verifiation status according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACS2EH/pages/1785810131718201706567/UPD+RC_Sign+person+request+v2#Calculatev2+DRACS+2.0#Calculate-cumulative-verification-status
Create user
Create user for active patient in mithril database,
users
table, set:id = autogenerate uuid
settings = ‘{“trusted_source”: true}’
priv_settings = ‘{"login_hstr": [], "otp_error_counter": 0}’
inserted_at = now()
updated_at = now()
tax_id =
drfo
value from digital signatureperson_id =
person_id
of person that was found or created on ‘Search or create patient’ step.
Create global role for created user in mithril database,
global_user_roles
table, set:id = autogenerate uuid
user_id = user_id of user created on p.4
role_id = id of role with name ‘PATIENT’
inserted_at = now()
updated_at = now()
...