Table of Contents |
---|
Purpose
To allow NHS Admin/Data Stuart (NHS employee with assigned appropriate scopes) to SAVE updates to personal data of a Person, based on Person’s official request to NHS, which is actually a legal authorisation for changes in his personal data.
Scheme
...
Design
Expand | ||
---|---|---|
| ||
Start of editing by pressing 'Редагування' Entered changes Comparison of changes before signature |
Specification
Expand | ||
---|---|---|
| ||
|
...
Expand | ||
---|---|---|
| ||
|
Key points
The process is initiated by any NHS employee (only within NHS Admin Panel) with necessary scopes and involves the transfer (by graphQL mutation) of a signed_content
. It includes JSON with Person data, where are id of an existing person and no keys and parameters of the authentication methods.
...
Process is synchronous. If all validations are successfully completed, the synchronous process of update a person starts by processing the message.
Scope and roles
Scope name | Roles | Description |
---|---|---|
New
|
| Scope for creation of |
Related articles
# | Path | Link and Article |
---|---|---|
1 | E-Health > Persons > Ідентифіковані персони > Person Requests Technical Requirements | IL.Create/Update person request (w/o declaration) |
2 | Public. Medical Service Provider Integration Layer > Person Requests |
Authorize
Verify the validity of access token
Return 401 in case validation fails
Check user scopes
person_request:write_nhs
Return 403 in case invalid scope(s)
Digital signature
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
...
|
Validation of Signed Content
Get global parameters
For futher validation, Invoke Global parameters to get following parameter:
no_self_auth_age
cURL example
Code Block |
---|
curl -X GET \ {:host}/api/global_parameters |
Validation | |
---|---|
1 | Validate parallel editings (new)Whether Person data were not changed by other users (MSP, NHS) of NHS system. By preliminary keeping value
|
2 | Validate Person’s status id in DB and deduplication controls
|
3 | Check “patient_signed” flag.This field should not be transferred. And therefore BE should not overwrite this field in DB |
4 | Check “process_disclosure_data_consent” flag.This field should not be transferred. And therefore BE should not overwrite this field in DB |
5 | Validate confidant person
Validate confidant person age >= prm.global_parameters.no_self_auth_age:
validate presence of a secret word:
|
6 | Validate "tax_id"
|
7 | Check "no_tax_id" flag
|
8 | Validate person documents
|
9 | Validate NHS request fields
|
JSON validation schema
What should be other for NHS Admin Panel
As a basis this JSON Schema validator (https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/589266986#Update-person-request ) is used. Except:
...
Expand | ||||
---|---|---|---|---|
| ||||
|
Execution
Search pending person_requests in IL.person_requests
Search persons request in IL.person_requests to prevent inconsistent parallel updates:
Code Block |
---|
WHERE IL.person_requests.person_id = :($.person.id) AND IL.person_requests.status IN ('NEW', 'APPROVED') |
Cancel person_requests records in IL.person_requests
Change status of all found person requests:
Code Block |
---|
SET IL.person_requests.status = 'CANCELED' WHERE IL.person_requests.id IN (:LIST of Search results) |
Create new record in IL.person_requests
Insert
[new record]
toIL.person_requests
:Set
status = 'SIGNED
'.Set Person’s id,
person_id = $.person.id
Set
inserted_at= now()
(Get current date-time)Set
inserted_by
- user_id (Extract user from token)Set
channel
,IL.person_request.(newrecord).channel = 'NHS'
Set
printout_form
= null
Store signed_content
in appropriate Person_request Bucket.
Update Person in MPI.persons
Update Person’s data in
MPI.persons.(id = $.person.id)
with submitted new data$
(including two$.nhs_request_number
and$.nhs_request_comment
).Set
updated_at
- now() (Get current date-time)Set
updated_by
- user_id (Extract user from token)Create appropriate records based on submitted new data
$
(including two$.nhs_request_number
and$.nhs_request_comment
) in:MPI.person_documents
MPI.person_phones
MPI.person_addresses
Submit person on verification
Create or update existing record in person_verifications table for a person according to logic in sections below. Also, set:
updated_at = now()
updated_by = user uuid
inserted_at = now() (for new records)
inserted_by = user uuid (for new records)
Manual NHS verification
Set person verification according to logic https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/589430849/Sign+person+request#Manual-NHS-verification
DRFO registry verification
Set person verification according to logic https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/589430849/Sign+person+request#DRFO-registry-verification
DRACS death acts registry verification
Set person verification according to logic https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/589430849/Sign+person+request#DRACS-death-acts-registry-verification
Calculate cumulative verification status
Calculate persons cumulative verification status according to logic https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/589430849/Sign+person+request#Calculate-cumulative-verification-status