Info |
---|
REST API method / Метод REST API (настанова) (remove the link block before publishing the document) |
...
Page Properties | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
...
INNM_DOSAGE
Input parameters
Description of input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | patient_id |
| String | Unique patient identifier. Required |
|
2 | care_plan_id |
| String | Unique Care Plan identifier. Required |
|
Request structure
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API request structure, example
Expand | ||
---|---|---|
| ||
|
...
Key | Value | Mandatory | Description | Example | |
---|---|---|---|---|---|
1 | Content-Type | application/json | M | Тип контенту | Content-Type:application/json |
2 | Authorization | Bearer {{access_token}} | Authorization:Bearer {{access_token}} | ||
3 | API-key | {{mis_client_secret}} | API-key:{{mis_client_secret}} |
...
Extract user_id from token.
Check user has an active and approved employee from legal entity (token) that:
has an active Approval granted by the Patient on write the Care plan resource (care plan id from URL)
Return 403 ('Access denied') in case employee has no Approval on write
Check user's employee is from the same legal entity (token) as managing_organisation from the care_plan:
Return 422 ('User is not allowed to create care plan activity for this care plan') in case employee’s legal_entity do not match managing_organisation of related care_plan
Validate activity
Activity should be validated. User fills following fields in the activity:
...
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")
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 rulein case of error - return 422 (“Clinical impression with patient category does not correspond to rule engine rule“)
if false - skip rule validation
5. Goal
Validate value in the field $.detail.goal, if submitted
...
Validate value in the field $.detail.quantity, if submitted
Check $.detail.quantity.value is not empty, is fractional, greater than zero
Return 422 schema validation error
...
If $.detail.kind=medication_request:
Check (by schemata) the $.detail.quantity.system field’s value is MEDICATION_UNIT.
Return 422 ('value is not allowed in enum')
Check the $.detail.quantity.code field’s value equals to dosage.denumerator_unit of one of INNMs of a INNM_DOSAGE where innms with is_primary = true
Return 422 ('Code field of quantity object should be equal to denumerator_unit of one of medication’s innms')
If $.detail.kind is other than medication_request:Check the $.detail.quantity.system field is not present.Return 422 ('System field ofquantityobject is not allowed for kind other than medication_request')
Check the $.detail.quantity.code field is not present.Return 422 ('Code field ofquantityobject is not allowed for kind other than medication_request')
If $.detail.kind=service_request:
Check that $.detail.quantity.system field’s value is SERVICE_UNIT, if submitted.
Return 422 ('value is not allowed in enum')
If care plan category is class_23, class_24 or class_25:
Check $.detail.quantity.system and $.detail.quantity.code are set, $.detail.quantity.code = MINUTE
Return 422 ('Code field of quantity object should be in MINUTE for care plan’s category <category code>')
7. Scheduled
If submitted, validate there is one of the $.detail.scheduled_[x] field: scheduled_timing, scheduled_period or scheduled_string.
Return 422 ('Only one of the parameters must be present') in case more then one submitted
...
Check the value is valid reference o employee resource
Check employee is active and approved
Return 422 ('Invalid employee status')
10. Daily amount
If submitted, check $.detail.daily_amount has the same code and system as quantity field.
Return 422 ('Units of daily_amount field should be equal to units of quantity field')
Validate value in the field $.detail.daily_amount, if submitted.Check activity kind is medication_requestReturn 422 ('Field is allowed for medication request activities only') in case kind is not medication_request
Validate $.detail.daily_amount.system, $.detail.daily_amount.code fields and their values in the object $.detail.daily_amountIf $.detail.kind=medication_request:Check (by schemata) the $.detail.daily_amount.system field’s value is MEDICATION_UNIT.Return 422 ('value is not allowed in enum')
Check the $.detail.daily_amount.code field’s value equals to dosage.denumerator_unit of one of INNMs of a INNM_DOSAGE where innms with is_primary = trueReturn 422 ('Code field ofdaily_amountobject should be equal to denumerator_unit of one of medication’s innms')
If $.detail.kind is other than medication_request:Check the $.detail.daily_amount.system field is not present.Return 422 ('System field ofdaily_amountobject is not allowed for kind other than medication_request')
Check the $.detail.daily_amount.code field is not present.Return 422 ('Code field ofdaily_amountobject is not allowed for kind other than medication_request')
11. Do not perform flag
Validate value in the field $.do_not_perform
...
If program meets the requirements write status "VALID" according to apiary.
Processing
A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST API
Response structure examples
See on API-specification (посилання на сторінку з API-специфікацією)
Description of the REST API response structure, example
Expand | ||
---|---|---|
| ||
|
...
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 | |||||
3 | 200 | Author’s specialty doesn't allow to create activity with medical program from request | Programs validation error | ||
4 | 200 | Clinical impression with patient category should be present in request for this medical program | |||
5 | 200 | Care plan’s terms of service are not allowed for the medical program | |||
6 | 200 | Care plan diagnosis is not allowed for the medical program | |||
7 | 200 | Medication is not included in the program | |||
8 | 200 | Service is not included in the program | |||
9 | 200 | Service group is not included in the program | |||
10 | 401 | Invalid access token |
| ||
11 | 401 | Unauthorized | Помилка підтвердження | ||
12 | 403 | Access denied |
| ||
13 | 403 | Your scope does not allow to access this resource. Missing allowances: care_plan:write | |||
14 | 1000 | 404 | Composition not found | COMPOSITION_NOT_FOUND_404 | Не знайдено медичний висновок |
15 | 409 | client_id refers to legal entity that is not active | Validation error | ||
16 | 409 | client_id refers to legal entity with type that is not allowed to create medical events transactions | |||
17 | 409 | Care Plan from url does not match to Care Plan ID specified in body | |||
18 | 409 | Person is not active | |||
19 | 409 | Patient is not verified | |||
20 | 422 | Another activity with status ‘scheduled' or ‘in_progress' already exists in the current Care plan | |||
21 | 422 | Another activity with status ‘scheduled' or ‘in_progress' already exists in the current Care plan | |||
22 | 422 | Bounds duration must be within care plan period range | |||
23 | 422 | Code field of quantity object should be equal to denumerator_unit of one of medication’s innms | |||
24 | 422 | Code field of quantity object should be in MINUTE for care plan’s category <category code> | |||
25 | 422 | Care Plan end date is expired | |||
26 | 422 | Cannot refer to service for kind = medication_request | |||
27 | 422 | Cannot refer to medication for kind = service_request | |||
28 | 422 | Clinical impression with patient category exceeds validity period | |||
29 | 422 | Care plan with such id is not found | |||
30 | 422 | Division is not active | |||
31 | 422 | Event is not within care plan period range | |||
32 | 422 | Forbidden to create care plan activity for this medication! | |||
33 | |||||
34 | 422 | High must be within care plan period range | |||
35 | 422 | Invalid care plan status | |||
36 | 422 | Invalid employee status | |||
37 | 422 | Low must be within care plan period range, less than high, have the same code as high | |||
38 | 422 | <medical event type> with such ID is not found | |||
39 | 422 | Medication does not exist | |||
40 | 422 | Medication should be active | |||
41 | 422 | not allowed in enum | |||
42 | 422 | Only one of the parameters must be present | |||
4243 | 422 | Program not found | |||
4344 | 422 | Period end time must be within care plan period range, after period start date | |||
4445 | 422 | Period start time must be within care plan period range | |||
4546 | 422 | String does not match pattern | |||
4647 | 422 | <Service/Service group> should be active | |||
4748 | 422 | User is not allowed to create care plan activity for this care plan | |||
4849 | 422 | User is not allowed to create care plan activity for the employee | |||
4950 | 422 | Units of daily_amount field should be equal to units of quantity field | |||
5051 | 422 | Value is not allowed in enum | |||
5152 | Специфічні | ||||
5253 | 422 | Only for active MPI record can be created medication request! |
Post-processing processes
Description of actions performed on data after processing
Technical modules where the method is used
List of pages describing technical modules where the method is used
Page Properties Report | ||||
---|---|---|---|---|
|
...