ЕСОЗ - публічна документація
Get Person Emergency contact
Purpose
This WS allows to get person’s emergency contact using a medical event as the evidence for the request.
Specification
Authorization
Verify the validity of access token
in case of error return 401 'Invalid access token'
Verify that token is not expired
in case of error return 401 'Invalid access token'
Check user scopes in order to perform this action (scope = 'person_emergency_contact:read')
in case of error return 403 'Your scope does not allow to access this resource. Missing allowances: persons_emergency_contact:read'
Validate Patient
Get Patient identifier from the URL
Check it exists in DB
in case of error return 404 'Patient is not found'
Validate Medical event
Validate medical_event_type from the URL
Check it is one of 'conditions' or 'diagnostic_reports'
in case of error return 404 'no Route matched with those values'
Validate medical event identifier from the URL
Check it exists in DB
in case of error return 404 '<medical_event_type> is not found'
Check medical event belongs to patient
in case of error return 404 '<medical_event_type> is not found'
Validate medical event has valid status:
if ME is condition, check
$.conditions.verification_status
!= 'entered_in_error'if ME is diagnostic_report, check
$.diagnostic_reports.status
!= 'entered_in_error'
In case of error return 403 'Invalid medical event status'
Validate medical event creation period:
validate that
$.<medical_event_type>.inserted_at
<= (now -EMERGENCY_CONTACT_MEDICAL_EVENT_MAX_DAYS_PASSED
)
In case of error return 403 'Medical event was created later than allowed period for data receiving'
More information about EMERGENCY_CONTACT_MEDICAL_EVENT_MAX_DAYS_PASSED
configuration you can find here Medical Events Dictionaries and configurations
Service logic
Service returns emergency contact info for a specified person:
Get person’s data from
mpi.persons.emergency_contact
tableRender a response according to specification
Every request is logged to
medical_data.person_data_request_log
Record must be created regardless of the
result
valueSet
$.request_type='Person Emergency Contact'
Collection description
Collection name: person_data_request_log
This collection is used to store logs of person’s data requests.
Record schema
Name | Type | M/O | Description and constraints |
---|---|---|---|
_id | uuid | M | System identifier of request |
consumer | object | M | Information about who has been consumed patient’s personal data |
patient_id | string | M | Patient hashed identifier |
access_context | object | O | Information on the basis of which entity access was granted |
result | boolean | M | Result of obtaining data on request |
request_type | string | M | Type of received data |
inserted_at | timestamp | M | Datetime when request was created |
Consumer schema
Information about who has been consumed patient’s emergency contact
Name | Type | M/O | Description and constraints |
---|---|---|---|
client_id | uuid | M | Client identifier to which the user belongs |
mis_client_id | uuid | M | MIS client identifier |
user_id | uuid | M | User who monitor patient's data |
Access_context schema
Information on the basis of which entity access was granted
Name | Type | M/O | Description and constraints |
---|---|---|---|
id | uuid | M | Resource identifier |
type | string | M | Resource type |
Example
ЕСОЗ - публічна документація