Table of Contents | ||||
---|---|---|---|---|
|
Purpose
...
API paragraph not found
Specification
...
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
...
API paragraph not found
Request structure
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
...
Verify the validity of access token
in case of error return 401 ('Access denied')
Check user scope diagnostic diagnostic_report:write write in order to perform this action
in case of error generate 403 response ('Invalid scopes')
Request to process the request using a token in the headers
Headers
...
Наприклад:
Content-Type:application/json
Authorization:Bearer mF_9.B5f-4.1JqM
Request data validation
...
Request validation
DS validation
...
Validate observations ids as primary keys (Primarykeyvalidation)
Validate that diagnostic_report of ALL observation is a current DR
$.observations[*].diagnostic_report.identifier.value==$.diagnostic_report.id
in case of error return "Submitted diagnostic report is not allowed for the observation"
$.observations[*].effective_period validate as Period PeriodValidation
Validate that the date is within acceptable limits
$.observations[*].issued <= current_time
in case of error return "Issued date must be in past"
$.observations[*].issued>=current_date-observation_max_days_passed
in case of error "Issued must be greater than {{current_date-observation_max_days_passed}}"
Validate performer as Employeevalidation
Validate $.observations[*].value_period as a Period
Validate component
$.observations[*].components[*].value_period as a Period
Related care plan validation
in case service request has reference on care plan and diagnostic report has reference on service request check possibility to create diagnostic report depending on service_request[].activity remaining quantity
calculate the quantity of artifacts that are contained in the request and have a link to the service request. Compare remaining_quantity from activity with the quantity of artifacts. Check that difference is greater then or equal to zero
in case of error return 409 "The total amount of the prescribed service quantity exceeds quantity in care plan activity"
Validate $.observations.code
if observations.code.coding[*].code value is included in chart variables 'OBSERVATION_CODES_WITH_<VALUE_TYPE>_REQUIRED', <value_type> field is mandatory
in case of error return 422 “This field is required for code = <code>“
Processing
...
API paragraph not found
Response structure
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Post-processing processes
...
Set managing_organization for submitted observations
ME.conditions{cond_id}.managing_organization=token.client_id.
in case service request has reference on care plan and diagnostic report.based_on was filled set $.diagnostic_report.id to related to $.service_request $.activity[].outcome_reference
Update $ .activity.status to in_progress if previous activity status was scheduled
Update the $ .activity.remaining_quantity parameter by subtracting the quantity of artifacts that have a reference on service request that contains an $.based_on.[]activity
HTTP status codes
...
Page Properties | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
...