...
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/1741514363017525605723/PIS.+Patient+sign-up+registration#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/1741514363017525605723/PIS.+Patient+sign-up+registration#Generate-authorization-token
...
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/1741514363017525605723/PIS.+Patient+sign-up+registration#Search-or-create-person
Calculate score of comparison between found active persons and person registration request using existing deduplication process, described here /wiki/spaces/PCAB/pages/17427464424 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/1741514363017525605723/PIS.+Patient+sign-up+registration#Generate-authorization-token
If user is not found - proceed to https://e-health-ua.atlassian.net/wiki/spaces/PCABEH/pages/1741514363017525605723/PIS.+Patient+sign-up+registration#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 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/DRACSEH/pages/17249206422589430849/IL.Sign+person+request+modified+EN#Manualrequest#Manual-NHS-verification
DRFO registry verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACSEH/pages/17249206422589430849/IL.Sign+person+request+modified+EN#DRFOrequest#DRFO-registry-verification
DRACS death acts registry verification - according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACSEH/pages/17249206422589430849/IL.Sign+person+request+modified+EN#DRACSrequest#DRACS-death-acts-registry-verification
Calculate cumulative person verifiation status according to logic, described here: https://e-health-ua.atlassian.net/wiki/spaces/DRACSEH/pages/17249206422589430849/IL.Sign+person+request+modified+EN#Calculaterequest#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()
password_set_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()
...