Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel3

Required parameters are marked with "*"

Якщо інформації по відповідному параметру немає, потрібно зазначити: “APIparagraph not found”.

Purpose*

This API allows to cancel Care plan in cases it has been rejected or entered in error.

...

Specification*

Page Properties

Link

https://ehealthmedicaleventsapimedicaleventsmisapi.docs.apiary.io/#reference/care-plan/cancel-care-plan/cancel-care-plan

Resource

/api/patients/{{patient_id}}/care_plans/{{id}}/actions/cancel

Scope

care_plan:write

Components

Care plan

Microservices

API paragraph not found

Protocol type

REST

Request type

PATCH

Sync/Async

Async

Public/Private/Internal

Public

...

This method must be used to cancel of existing patient's Care plan. 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)

Important

  1. Signed content of care plan must be equal to care plan stored in DB. See Get Care plan by ID

  2. Activities should not be presented in signed content.

  3. $.status_reason must be added to signed content

Key points

  1. It can be cancelled by author of the Care plan who has an Approval granted by the patient on write Care plan resource

  2. Cancel should be signed with DS. So, all the Care plan data (without activities data) should be submitted.

  3. Status of the Care plan changed in async way. The result of the job should be a link on the Care plan details.

Input parameters

Input parameter

Values

Type

Description

Example

patient_id

String

MPI identifier of the patient

7c3da506-804d-4550-8993-bf17f9ee0402

id

String

Care Plan identifier

7c3da506-804d-4550-8993-bf17f9ee0403

...

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

...

Signed content must match with Care plan in DB in order to be changed

  1. Render Care plan from DB

  2. Exclude $.status_reason from signed content

  3. Compare rendered Care plan and signed content

    1. In case both object doesn't match - return 422 ('Signed content doesn't match with previously created care plan')

Processing*

Service logic

  1. Save signed content to media storage

  2. Update Care plan status (update also updated_at, updated_by)

  3. Set $.status_reason and $.status_history

Response structure*

See on Apiary

...