Table of Contents | ||||
---|---|---|---|---|
|
...
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
...
Preconditions
Sign message (pkcs7) that consists of signed content, digital signature, and signer public key
Logic
This method allows to create Care Plan for a person in eHealth. Method receives signed message (pkcs7) that consists of signed content, digital signature and signer public key. All signature fields will be validated (including signer certificate authority). Service will store signed copy of Care Plan in Media Content Storage if all checks is passed.
Key points
Only authenticated and authorized user with employee_type from the list of CARE_PLAN_AUTHOR_EMPLOYEE_TYPES_ALLOWED
config with appropriate speciality pointed in CARE_PLAN_<category>_SPECIALITIES_ALLOWED config can create a Care plan.Care plan can be created from MSP, PRIMARY_CARE or OUTPATIENT legal entity.
Care plan can be created for persons and prepersons.
Care plan should be signed with DS.
Care plan creates in async way as all MEs.
Activities are added to a Care plan using Create Care Plan activity method. Thus, Care plan is being initially created without activities.
Input parameters
...
Input parameter
...
Values
...
Type
...
Description
...
Example
...
patient_id
...
String
...
MPI identifier of the person
...
7075e0e2-6b57-47fd-aff7-324806efa7e5
Request structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Dummy Care plan
Example:
Global and configurable parameters
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
patient_id | String | MPI identifier of the person |
|
Filters
No
Dictionaries
eHealth/care_plan_categories
eHealth/care_plan_cancel_reasons
eHealth/care_plan_complete_reasons
eHealth/ICD10_AM/condition_codes
PROVIDING_CONDITION
Request structure
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Dummy Care plan
Example:
Expand | ||
---|---|---|
| ||
|
...
Request to process the request using a token in the headers
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer mF_9.B5f-4.1JqM
api-key:aFBLVTZ6Z2dON1V
...
Validate encoded and decoded request using schema.
Return 422 with the list of validation errors in case validation fails.
...
Extract user_id from token. Check that author belongs to one of the user’s employee.
in case of error - return 422 ('User is not allowed to create care plan for the employee')
Check that author is an active and approved employee and related to the legal entity (client_id from token).
in case of error - return 403 ('Access denied')
for employees with employee_type from CARE_PLAN_AUTHOR_ROLE_CHECK_EMPLOYEE_TYPES config:
Сheck it has at least one employee role that:
is active and has active status
refers to healthcare service with providing_conditions=$.terms_of_service value
in case of error - return 422 ('Employee does not have active role that correspond to the submitted terms of service')
If DOCTOR, then no additional validations needed
Check author’s speciality (speciality_officio == true) pointed in config for a corresponding care plan category.
in case of error - return 409 (“Invalid employee speciality”)
...
Check the value is valid reference on encounter resource
Check encounter is active (status is not entered_in_error)
in case of error - return 422 ('Encounter in "entered_in_error" status can not be referenced')
Check encounter belongs to patient ($.subject)
in case of error - return 422 ('Encounter with such id is not found')
Check that encounter diagnosis is not empty in $.encounter.diagnosis
in case of error - return 422 ('Encounter without diagnosis can not be referenced')
Validate primary diagnosis Condition in the Encounter:
Check condition codes is in allowed condition code list for the care plan’s category (chart variables in config: for employee types: SPECIALIST, DOCTOR and MED_COORDINATOR)
in case of error - return 422 ('Primary diagnosis condition code and care plan category mismatch')
Check the condition system/codes has strict match with the value in the Addresses field
in case of error - return 422 ('Primary diagnosis condition codes do not match with codes in addresses') in case condition code in addresses is not the same as in the encounter diagnosis.
Validate Episode related to the Encounter:
exists
in case of error - return 422 ('Encounter refers to episode that does not exist')
is active
in case of error - return 422 ('Encounter refers to episode that is not active')
it’s managing organization matches with author’s legal entity (client_id)
in case of error - return 422 ('Encounter is from another legal entity')
...
Check that there is values from a dictionary
PROVIDING_CONDITION
.in case of error - return 422 ('value is not allowed in enum')
Check submitted value:
define allowed terms_of_service for employee_type using a set of chart variables CARE_PLAN_<employee_type>_TERMS_OF_SERVICE_ALLOWED
in case terms_of_service not allowed for the employee_type - return 422 ('Not allowed for <employee type>')
7. Period
Validate value in the field $.period, required.
...
Expand | ||
---|---|---|
| ||
|
Post-processing processes
API paragraph not found
HTTP status codes
...
HTTP status code
...
Message
...
What caused the error
...
201
...
Response
...
...
202
...
Response
...
...
401
...
Invalid access token
...
403
...
Your scope does not allow to access this resource. Missing allowances: care_plan:write
Access denied
...
409
...
Validation failed
...
|
Post-processing processes
API paragraph not found
HTTP status codes
Page Properties | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|