Table of Contents | ||||
---|---|---|---|---|
|
...
This WS allows to add activity to the specified Care plan.
Key points
One request can add only one activity to the Care plan
Activity can be added by the employee who has Approval granted by the patient on write Care plan resource
Activity adds in async way. The result of the activity addition job should be link on the created activity (look at Get Care plan activity by ID).
Activity should be signed with DS. Signed content stores in the media storage.
Specification
...
Link
...
Specification
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Save signed content to media storage
Save data to care_plan_activities collection in DB according to Care plan data model
for kind = medication_request
add
unit
(and its value) field intoquantity
,daily_amount
, objects based onsystem
,code
out of MEDICATION_UNIT dictionary.add
system
,code
,unit
fields intoremaining_quantity
based onquantity
object
Save link from media storage to the $.signed_content_links field in care plan activities collection
If Care plan has status = new:
Set care plan status = active
Check if patient has another active or/and new Care plans with such condition code in the addresses field and the same terms of service:
If such Care plans found - set these Care plans statuses to TERMINATED (related activities doesn`t change their status)
Create job and return it’s id.
Input parameters
...
Input parameter
...
Values
...
Type
...
Description
...
Example
...
patient_id
...
String
...
MPI identifier of the person.
Required
...
7c3da506-804d-4550-8993-bf17f9ee0402
...
care_plan_id
...
String
...
Unique Care Plan identifier.
Required
...
7c3da506-804d-4550-8993-bf17f9ee0403
Request structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
Verify the validity of access token
Return (401, 'Invalid access token') in case of validation fails
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 = 'care_plan:write')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: care_plan:write') in case of invalid scope(s)
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer F3GF124Df565FDS234SDF34
api-key:aDGFDFGT46S5gFGD
Request data validation
Validate legal entity
...
Extract client_id from token
...
Check legal entity status is ACTIVE
In case of error - return 409 ('client_id refers to legal entity that is not active')
...
Key points
One request can add only one activity to the Care plan
Activity can be added by the employee who has Approval granted by the patient on write Care plan resource
Activity adds in async way. The result of the activity addition job should be link on the created activity (look at Get Care plan activity by ID).
Activity should be signed with DS. Signed content stores in the media storage.
Global and configurable parameters
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
patient_id | String | MPI identifier of the person. Required |
| |
care_plan_id | String | Unique Care Plan identifier. Required |
|
Filters
No
Dictionaries
eHealth/care_plan_activity_outcomes
eHealth/ICPC2/condition_codes
eHealth/ICD10_AM/condition_codes
eHealth/care_plan_activity_goals
eHealth/care_plan_activity_cancel_reasons
eHealth/care_plan_activity_complete_reasons
eHealth/ucum/units
MEDICATION_UNIT
DAYS_OF_WEEK
EVENT_TIMING
SPECIALITY_TYPES_ALLOWED
PROVIDING_CONDITIONS_ALLOWED
INNM_DOSAGE
Request structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
Verify the validity of access token
Return (401, 'Invalid access token') in case of validation fails
Verify that token is not expired
in case of error - return 409 ('client_id refers to legal entity with type that is not allowed to create medical events transactions')
Validate Care plan
Get Care plan identifier from the URL
Check Care plan:
belongs to patient (from url)
in case of error - return 422 ('Care plan with such id is not found')
is not in final status
in case of error - return 422 ('Invalid care plan status')
Care plan’s period.end >= current date.401, 'Invalid access token')
Check user scopes in order to perform this action (scope = 'care_plan:write')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: care_plan:write') in case of invalid scope(s)
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer F3GF124Df565FDS234SDF34
api-key:aDGFDFGT46S5gFGD
Request data validation
Validate legal entity
Extract client_id from token
Check legal entity status is ACTIVE
In case of error - return 409 ('client_id refers to legal entity that is not active')
Check legal entity type in ME_ALLOWED_TRANSACTIONS_LE_TYPES config parameter
in case of error - return
422409 ('
Care Plan end date is expiredclient_id refers to legal entity with type that is not allowed to create medical events transactions')
Validate
...
Care plan
Get person_id from URLValidate patient status is activeCare plan identifier from the URL
Check Care plan:
belongs to patient (from url)
in case of error - return
422 ('
Care plan with such id is not found')
is not in final status
in case of error - return 422 ('Invalid care plan status')
Care plan’s period.end >= current date.
in case of error - return 422 ('Care Plan end date is expired')
Validate Patient
Get person_id from URL
Validate patient status is active
in case of error - return 409 ('Person is not active')
If patient is a person - validate patient'sverification_status is not equal to NOT_VERIFIED.
in case NOT_VERIFIED - return error 409, "Patient is not verified"
...
Check that value is an array with references of condition, observation, diagnostic report or clinical impression types.
in case of error - return 422 ('value is not allowed in enum')
Check that each reference:
is valid ME
belongs to the patient ($.subject)
in case of error - return 422 ('<medical event type> with such ID is not found')
If $.detail.reason_reference=clinical_impression:
Check that clinical impression is valid based on clinical_impression.code.coding.code and CLINICAL_IMPRESSION_PATIENT_CATEGORIES_<CODE.CODING.CODE>_VALIDITY_PERIOD chart parameter: difference between now() and $.clinical_impression.effective_date_time OR $.clinical_impression.effective_period.end date must be less than a value in chart parameter (pointed in config for a corresponding care plan category) for clinical impression code
in case of error - return 422 ("Clinical impression with patient category exceeds validity period")
Check that clinical impression is based on active rule engine rule (exists record in rule_engine_rules collection with is_active=true, code.code=clinical_impression.code.coding.code, code.system=clinical_impression.code.coding.system)
if true - check that clinical impression still corresponds to configured rule
in case of error - return 422 (“Clinical impression with patient category does not correspond to rule engine rule“)
if false - skip rule validation
...
Expand | ||
---|---|---|
| ||
|
Post-processing processes
API paragraph not found
HTTP status codes
...
HTTP status code
...
Message
...
What caused the error
...
201
...
Response
...
Sync. Use payload from response
...
202
...
Response
...
Async: default method. use Get job details to get processing result. Response payload will be returned in the job details
...
401
...
Invalid access token
...
403
...
Your scope does not allow to access this resource. Missing allowances: care_plan:write
...
409
...
client_id refers to legal entity that is not active
client_id refers to legal entity with type that is not allowed to create medical events transactions
Person is not active
Patient is not verified
Signer DRFO doesn't match with requester tax_id
Care Plan from url does not match to Care Plan ID specified in body
...
|
Post-processing processes
API paragraph not found
HTTP status codes
Page Properties | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|