Table of Contents | ||||
---|---|---|---|---|
|
...
PROVIDING_CONDITIONS_ALLOWED
INNM_DOSAGE
eHealth/activity_kinds
Request structure
See on Apiary
...
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 {{access_token}}
API-key:{{mis_client_secret}}
...
Validate value in the field $.detail.kind, required
Check value in
enum: medication_request, service_request, device_requestthe dictionaryeHealth/activity_kinds
Return 422 ('value is not allowed in enum')
...
If $detail.kind=medication_request:
Check $.detail.product_reference field is submitted and has Reference type
in case it isn’t submitted - return 422 ('can't be blank')
in case of wrong type - return 422 ('type mismatch')
Check the value is valid reference on medication resource.
Return 422 ('Cannot refer to <resource> for kind = medication_request')
Check medication:
is active
in case of error - return 422 ('Medication should be active')
type is INNM_DOSAGE
in case of error - return 422 ('Medication does not exist')
If $.detail.kind=service_request:
Check $.detail.product_reference field is submitted and has Reference type
in case it isn’t submitted - return 422 ('can't be blank')
in case of wrong type - return 422 ('type mismatch')
Check that value is a reference on service or service_group
Return 422 ('Cannot refer to <resource> for kind = service_request')
Check service or service_group is active
Return 422 ('<Service/Service group> should be active')
If $.detail.kind=device_request:
Validate product_reference:
Check there value is valid Reference on device_definition resource
Return 422 ('Cannot refer to <resource> for kind = device_request')
Check the device_definition is active
Return 422 ('Device definition is not active')
Check at least one classification type of the device definition is allowed by dictionary configuration “prescribable_device_codes”
in case of error - return 422 ('Value is not allowed by {{dictionary_configuration_name}} dictionary configuration”')
Validate product_codeable_concept:
Check that value matches with active values indevice_definition_classification_type
dictionary.Return 422 ('value is not allowed in enum')
Check that product_codeable_concept.coding[] array contains only 1 element
in case of error - return 422 ('expected a maximum of 1 items but got <actual number of elements>')
Check that product_codeable_concept.coding[].code is an active value from the dictionary specified in product_codeable_concept.coding[].system
in case of error - return 422 ('value is not allowed in enum')
Check that value is allowed by dictionary configuration “prescribable_device_codes”
in case of error - return 422 ('Value is not allowed by {{dictionary_configuration_name}} dictionary configuration”')
Check there is no another activities (status=scheduled, in_progress) in the Care plan with the same product_reference or product_codeable_concept, and program = $.detail.program
Return 422 (“Another activity with status ‘scheduled' or ‘in_progress' already exists in the current Care plan within current program value“)
...
Check that value is an array with references of condition, observation, diagnostic report, 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.VALUE>_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")
...
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|