AlayaCare Care plan API
The Care plan API from AlayaCare — 10 operation(s) for care plan.
The Care plan API from AlayaCare — 10 operation(s) for care plan.
openapi: 3.0.0
info:
version: 1.0.19-oas3
title: AlayaCare Accounting Accounts Care plan API
description: '**AlayaCare IDs:**
The following terms are used to reference IDs that identify resources in AlayaCare:
- id
- visit_id
- premium_id
- visit_premium_id
- employee_id
- cost_centre_id
- client_id
**External IDs**
The following terms are used to reference IDs that identify resources systems external to AlayaCare:
- employee_external_id
- client_external_id
External IDs are required to be unique.
No other assumptions are made regarding their format they are treated as strings.
'
servers:
- url: https://example.alayacare.com/ext/api/v2/accounting
security:
- basic_auth: []
tags:
- name: Care plan
paths:
/client/{client_id}/careplans:
parameters:
- description: Send request using the client Alayacare ID
name: client_id
type: integer
in: path
required: true
get:
tags:
- Care plan
summary: Get a list of care plan base information using the client Alayacare ID
parameters:
- $ref: '#/parameters/page'
- $ref: '#/parameters/count'
- description: Filter by careplan status
name: status
type: string
enum:
- active
- completed
- archived
in: query
- name: start_date_from
in: query
required: false
type: string
format: date-time
default: utcnow()
description: 'Filter by care plan start date time greater or equal than specified value.
If not specified will default to now.
Expected format is ISO 8601 converted to UTC timezone.
`start_date_from` can be used as this filter name.
Ex: `2018-02-03T08:00:00-05:00`
'
- name: start_date_to
in: query
required: false
type: string
format: date-time
default: utcnow() + 7 days
description: 'Filter by care plan start date time less than or equal than specified value.
If not specified will default to 7 days from now.
Expected format is ISO 8601 converted to UTC timezone.
`start_date_to` can be used as this filter name
Ex: `2019-02-18T08:00:00-05:00`
'
- name: end_date_from
in: query
required: false
type: string
format: date-time
description: "Filter by care plan end date time greater or equal than specified value. \nExpected format is ISO 8601 converted to UTC timezone.\nEx: `2019-02-03T08:00:00-05:00`\n"
- name: end_date_to
in: query
required: false
type: string
format: date-time
description: "Filter by care plan date time less than or equal than specified value. \nExpected format is ISO 8601 converted to UTC timezone.\nEx: `2018-02-18T08:00:00-05:00` \n"
- description: Filter by careplan name
name: name
type: string
in: query
- description: Define the field for sorting
name: sort_by
type: string
in: query
- description: Define the type of sorting (asc/desc)
name: order
type: string
in: query
responses:
'200':
description: A list of care plans
schema:
$ref: '#/definitions/CarePlanList'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseClientNotFound'
post:
tags:
- Care plan
summary: Create a care plan using the client Alayacare ID
parameters:
- description: Care plan
name: body
in: body
required: true
schema:
$ref: '#/definitions/CarePlanCreate'
responses:
'201':
description: Success response
schema:
$ref: '#/definitions/CarePlanSummary'
'400':
$ref: '#/responses/ErrorResponseInvalidRequest'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseClientNotFound'
/client/by_id/{external_client_id}/careplans:
parameters:
- description: Send request using the client external ID
name: external_client_id
type: integer
in: path
required: true
get:
tags:
- Care plan
summary: Get a list of care plan base information using the client external ID
parameters:
- $ref: '#/parameters/page'
- $ref: '#/parameters/count'
- description: Filter by careplan status
name: status
type: string
enum:
- active
- completed
- archived
in: query
- name: start_date_from
in: query
required: false
type: string
format: date-time
default: utcnow()
description: 'Filter by careplan start date time greater or equal than specified value.
If not specified will default to now.
Expected format is ISO 8601 converted to UTC timezone.
`start_at` can be used as this filter name.
Ex: `2018-02-03T08:00:00-05:00`
'
- name: start_date_to
in: query
required: false
type: string
format: date-time
default: utcnow() + 7 days
description: 'Filter by careplan start date time less than or equal than specified value.
If not specified will default to 7 days from now.
Expected format is ISO 8601 converted to UTC timezone.
`end_at` can be used as this filter name
Ex: `2019-02-18T08:00:00-05:00`
'
- name: end_date_from
in: query
required: false
type: string
format: date-time
description: "Filter by visit end date time greater or equal than specified value. \nExpected format is ISO 8601 converted to UTC timezone.\nEx: `2019-02-03T08:00:00-05:00`\n"
- name: end_date_to
in: query
required: false
type: string
format: date-time
description: "Filter by visit end date time less than or equal than specified value. \nExpected format is ISO 8601 converted to UTC timezone.\nEx: `2018-02-18T08:00:00-05:00` \n"
- description: Filter by careplan name
name: name
type: string
in: query
- description: Define the field for sorting
name: sort_by
type: string
in: query
- description: Define the type of sorting (asc/desc)
name: order
type: string
in: query
responses:
'200':
description: A list of care plans
schema:
$ref: '#/definitions/CarePlanList'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseClientNotFound'
post:
tags:
- Care plan
summary: Create a care plan using the client external ID
parameters:
- description: Care plan
name: body
in: body
required: true
schema:
$ref: '#/definitions/CarePlanCreate'
responses:
'201':
description: Success response
schema:
$ref: '#/definitions/CarePlanSummary'
'400':
$ref: '#/responses/ErrorResponseInvalidRequest'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseClientNotFound'
/client/{client_id}/careplans/active:
parameters:
- description: Send request using Alayacare client DB ID
name: client_id
type: integer
in: path
required: true
get:
deprecated: true
tags:
- Care plan
summary: Get the detailed information of the active care plan using Alayacare client ID
description: "Deprecated. Use /careplans/currently-active instead.\nReturns the detailed information of the active careplan, including all sub entities referenced as `root_item` (`diagnosis`, `goal` and `intervention`)\n\n- Specifying `root_item_id` and `root_item_type` filters will return the `root_item` and any item linked to it. Both filters must be valid and specified together or an error will be returned.\n- For example, if a specific `diagnosis_id` is linked to 2 goals then the 3 entities will be returned when filtering on the type `diagnosis` and the specific `diagnosis_id` \n"
parameters:
- description: 'Only return the details for the specified root item ID (`diagnosis`, `goal` and `intervention` IDs)
'
name: root_item_id
in: query
type: integer
- description: Only return the details for the specified root items type (`diagnosis`, `goal` or `intervention`)
name: root_item_type
in: query
type: string
enum:
- diagnosis
- goal
- intervention
- description: Set the start date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: from
in: query
type: string
- description: Set the end date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: to
in: query
type: string
- description: Filter root items by tags
name: tags
in: query
type: array
items:
type: integer
- description: Filter root items by services
name: services
in: query
type: array
items:
type: integer
- description: Filter root items by departments
name: departments
in: query
type: array
items:
type: integer
- description: Filter root items by status
name: statuses
in: query
type: array
items:
type: string
enum:
- active
- completed
- archived
responses:
'200':
description: The care plan
schema:
$ref: '#/definitions/CarePlanDetails'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseClientNotFound'
/client/{client_id}/careplans/currently-active:
parameters:
- description: Send request using Alayacare client DB ID
name: client_id
type: integer
in: path
required: true
get:
tags:
- Care plan
summary: Get the detailed information of the active care plan using Alayacare client ID
description: "Returns the detailed information of the active careplan, including all sub entities referenced as `root_item` (`diagnosis`, `goal` and `intervention`)\n\n- Specifying `root_item_id` and `root_item_type` filters will return the `root_item` and any item linked to it. Both filters must be valid and specified together or an error will be returned.\n- For example, if a specific `diagnosis_id` is linked to 2 goals then the 3 entities will be returned when filtering on the type `diagnosis` and the specific `diagnosis_id` \n"
parameters:
- description: 'Only return the details for the specified root item ID (`diagnosis`, `goal` and `intervention` IDs)
'
name: root_item_id
in: query
type: integer
- description: Only return the details for the specified root items type (`diagnosis`, `goal` or `intervention`)
name: root_item_type
in: query
type: string
enum:
- diagnosis
- goal
- intervention
- description: Set the start date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: from
in: query
type: string
- description: Set the end date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: to
in: query
type: string
- description: Filter root items by tags
name: tags
in: query
type: array
items:
type: integer
- description: Filter root items by services
name: services
in: query
type: array
items:
type: integer
- description: Filter root items by departments
name: departments
in: query
type: array
items:
type: integer
- description: Filter root items by status
name: statuses
in: query
type: array
items:
type: string
enum:
- active
- completed
- archived
responses:
'200':
description: The care plan
schema:
$ref: '#/definitions/CarePlanDetails'
'204':
description: No active care plan
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
/client/by_id/{external_client_id}/careplans/active:
parameters:
- description: Send request using Alayacare client external ID
name: external_client_id
type: integer
in: path
required: true
get:
deprecated: true
tags:
- Care plan
summary: Get the detailed information of the active care plan using client external ID
description: "Deprecated. Use /careplans/currently-active instead.\nReturns the detailed information of the active careplan, including all sub entities referenced as `root_item` (`diagnosis`, `goal` and `intervention`)\n\n- Specifying `root_item_id` and `root_item_type` filters will return the `root_item` and any item linked to it. Both filters must be valid and specified together or an error will be returned.\n- For example, if a specific `diagnosis_id` is linked to 2 goals then the 3 entities will be returned when filtering on the type `diagnosis` and the specific `diagnosis_id` \n"
parameters:
- description: 'Only return the details for the specified root item ID (`diagnosis`, `goal` and `intervention` IDs)
'
name: root_item_id
in: query
type: integer
- description: Only return the details for the specified root items type (`diagnosis`, `goal` or `intervention`)
name: root_item_type
in: query
type: string
enum:
- diagnosis
- goal
- intervention
- description: Set the start date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: from
in: query
type: string
- description: Set the end date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: to
in: query
type: string
- description: Filter root items by tags
name: tags
in: query
type: array
items:
type: integer
- description: Filter root items by services
name: services
in: query
type: array
items:
type: integer
- description: Filter root items by departments
name: departments
in: query
type: array
items:
type: integer
- description: Filter root items by status
name: statuses
in: query
type: array
items:
type: string
enum:
- active
- completed
- archived
responses:
'200':
description: The care plan
schema:
$ref: '#/definitions/CarePlanDetails'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseClientNotFound'
/client/by_id/{external_client_id}/careplans/currently-active:
parameters:
- description: Send request using Alayacare client external ID
name: external_client_id
type: integer
in: path
required: true
get:
tags:
- Care plan
summary: Get the detailed information of the active care plan using client external ID
description: "Returns the detailed information of the active careplan, including all sub entities referenced as `root_item` (`diagnosis`, `goal` and `intervention`)\n\n- Specifying `root_item_id` and `root_item_type` filters will return the `root_item` and any item linked to it. Both filters must be valid and specified together or an error will be returned.\n- For example, if a specific `diagnosis_id` is linked to 2 goals then the 3 entities will be returned when filtering on the type `diagnosis` and the specific `diagnosis_id` \n"
parameters:
- description: 'Only return the details for the specified root item ID (`diagnosis`, `goal` and `intervention` IDs)
'
name: root_item_id
in: query
type: integer
- description: Only return the details for the specified root items type (`diagnosis`, `goal` or `intervention`)
name: root_item_type
in: query
type: string
enum:
- diagnosis
- goal
- intervention
- description: Set the start date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: from
in: query
type: string
- description: Set the end date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: to
in: query
type: string
- description: Filter root items by tags
name: tags
in: query
type: array
items:
type: integer
- description: Filter root items by services
name: services
in: query
type: array
items:
type: integer
- description: Filter root items by departments
name: departments
in: query
type: array
items:
type: integer
- description: Filter root items by status
name: statuses
in: query
type: array
items:
type: string
enum:
- active
- completed
- archived
responses:
'200':
description: The care plan
schema:
$ref: '#/definitions/CarePlanDetails'
'204':
description: No active care plan
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
/careplans/{plan_id}:
parameters:
- description: ID of care plan
name: plan_id
in: path
required: true
type: integer
get:
tags:
- Care plan
summary: Get detailed information about a care plan using the care plan ID
description: 'Returns the detailed information of the careplan, including all sub entities referenced as `root_item` (`diagnosis`, `goal` and `intervention`)
'
parameters:
- description: 'Only return the details for the specified root item ID (`diagnosis`, `goal` and `intervention` IDs)
'
name: root_item_id
in: query
type: integer
- description: Only return the details for the specified root items type (`diagnosis`, `goal` or `intervention`)
name: root_item_type
in: query
type: string
enum:
- diagnosis
- goal
- intervention
- description: Set the start date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: from
in: query
type: string
- description: Set the end date of the search period for the root items (`diagnosis`, `goal` and `intervention`) (YYYY-MM-DD)
name: to
in: query
type: string
- description: Filter root items by tags
name: tags
in: query
type: array
items:
type: integer
- description: Filter root items by services
name: services
in: query
type: array
items:
type: integer
- description: Filter root items by departments
name: departments
in: query
type: array
items:
type: integer
- description: Filter root items by status
name: statuses
in: query
type: array
items:
type: string
enum:
- active
- completed
- archived
responses:
'200':
description: The care plan
schema:
$ref: '#/definitions/CarePlanDetails'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseCarePlanNotFound'
put:
tags:
- Care plan
summary: Update care plan base information using the care plan ID
parameters:
- description: Updated care plan
name: plan
in: body
required: true
schema:
$ref: '#/definitions/CarePlanUpdate'
responses:
'204':
description: Careplan updated
'400':
$ref: '#/responses/ErrorResponseInvalidRequest'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseCarePlanNotFound'
/careplans/{plan_id}/status/active:
parameters:
- description: ID of care plan
name: plan_id
in: path
required: true
type: integer
put:
tags:
- Care plan
summary: Change status of care plan to active using the care plan ID
description: '- If a care plan is in `completed` or `archived` status, then the care plan cannot be re-activated again.
- Only `one` care plan can be active at a time.
- If an existing care plan is currently active, and you wish to create and activate a new care plan, then the `start_date` of the new care plan must be `after` the `start _date` of the currently active care plan.
'
responses:
'204':
description: Status of Careplan was updated to active
'400':
$ref: '#/responses/ErrorResponseInvalidStatusUpdate'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseCarePlanNotFound'
/careplans/{plan_id}/status/archived:
parameters:
- description: ID of care plan
name: plan_id
in: path
required: true
type: integer
put:
tags:
- Care plan
summary: Change status of care plan to archived using the care plan ID
description: '- Care plans in active status must be completed before they can be archived.
'
responses:
'204':
description: Status of Careplan was updated to archived
'400':
$ref: '#/responses/ErrorResponseInvalidStatusUpdate'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseCarePlanNotFound'
/careplans/{plan_id}/status/completed:
parameters:
- description: ID of care plan
name: plan_id
in: path
required: true
type: integer
- description: Related information
name: related_info
in: body
schema:
type: object
properties:
end_date:
type: string
example: '2020-02-01'
put:
tags:
- Care plan
summary: Change status of care plan to completed using the care plan ID
responses:
'204':
description: Status of Careplan was updated to completed
'400':
$ref: '#/responses/ErrorResponseInvalidStatusUpdate'
'401':
$ref: '#/responses/AuthChallenge'
'403':
$ref: '#/responses/ErrorInsufficientAccess'
'404':
$ref: '#/responses/ErrorResponseCarePlanNotFound'
components:
securitySchemes:
basic_auth:
type: http
description: Basic HTTP auth over https
scheme: basic
definitions:
CareplanItemStatus:
type: string
enum:
- active
- completed
- archived
GoalProgress:
description: Goal progress information
properties:
comment:
type: string
percentage:
type: integer
completed:
type: boolean
example:
comment: That was hard
completed: false
Intervention:
description: Careplan intervention
type: object
required:
- updated_at
- updated_by
- created_at
- created_by
- id
- name
- status
- recurrence_type
- start_date
- intervention_type
- is_required
- has_duration
- include_485
- rank
- completed_at
- completed_by
- completion_note
properties:
careplan_id:
description: Identifier for the careplan
type: integer
example: 52
client_id:
description: Identifier for the client
type: integer
example: 1043
id:
description: Identifier for the intervention
type: integer
example: 1
name:
description: Name of the intervention
type: string
example: Walking Exercizes
status:
$ref: '#/definitions/CareplanItemStatus'
recurrence:
$ref: '#/definitions/DeconstructedFrequency'
start_date:
type: string
end_date:
type: string
external_client_id:
type: string
description: external identifier of the client associated to this intervention
example: NS001
intervention_type:
type: string
description: Intervention type
example: Nursing
updated_at:
description: Datetime for the last update for this intervention
type: string
example: '2018-01-23T23:56:13+00:00'
updated_by:
$ref: '#/definitions/User'
created_at:
description: Datetime for the creation of this intervention
type: string
example: '2017-12-20T23:56:13+00:00'
created_by:
$ref: '#/definitions/User'
department:
$ref: '#/definitions/EntitySummary'
goals:
type: array
items:
$ref: '#/definitions/EntitySummary'
services:
$ref: '#/definitions/ServiceList'
tags:
$ref: '#/definitions/EntitySummaryList'
external_link:
$ref: '#/definitions/ExternalLink'
module:
$ref: '#/definitions/InterventionModule'
description:
description: Description of the care plan intervention
type: string
example: Try walk short distances. Increase the distance each time.
is_required:
description: Defines if the intervention is required to be completed or commented on to be able to clock out from a visit. If not set will be defaulted to false.
type: boolean
example: true
has_duration:
description: Captures time spent on the visit intervention. If not set will be defaulted to false.
type: boolean
example: true
include_485:
description: Include the intervention in 485 report. Is not set will be defaulted to false.
type: boolean
example: true
rank:
type: integer
example: 0
completed_at:
description: Datetime when the intervention was completed
type: string
example: '2017-12-20T23:56:13+00:00'
x-nullable: true
completed_by:
$ref: '#/definitions/User'
x-nullable: true
completion_note:
description: Completion note of the intervention
type: string
x-nullable: true
DeconstructedFrequency:
description: "Definition of the intervention frequency. \n- Is only required if `recurrence_type` is set to `custom`\n- `available_from` and `available_to` allow to define the Time of day when the intervention is available. Only present for `daily`, `weekly` and `monthly` frequencies. if not set will be defaulted to `any time of the day`.\n"
type: object
required:
- frequency
- interval
properties:
frequency:
description: The frequency type of the intervention. Additionnal information are required for `daily`, `weekly` and `monthly` frequencies.
type: string
enum:
- daily
- weekly
- monthly
count:
description: The number of time the intervention must be executed. Only required for `daily`, `weekly` and `monthly` frequencies.
type: integer
example: 3
interval:
description: Only required for `daily`, `weekly` and `monthly` frequencies
type: integer
example: 2
weekdays:
description: Only present when the 'frequency' field is set to 'weekly'
type: array
items:
type: string
enum:
- monday
- tuesday
- wednesday
- thursday
- friday
- saturday
- sunday
monthday:
description: Only present when the 'frequency' field is set to 'monthly'
type: integer
example: 25
available_from:
type: string
example: '13:00:00'
available_to:
type: string
example: '15:00:00'
ExternalLink:
type: object
required:
- label
- url
properties:
label:
type: string
example: How to use a catheter
url:
type: string
example: www.youtube.com/catheter
ServiceList:
type: array
items:
$ref: '#/definitions/ServiceDetails'
CarePlanCreate:
description: Create a Care Plan
type: object
required:
- name
- start_date
properties:
name:
description: The title of the care plan
type: string
example: Test care plan
start_date:
description: The start date of the care plan
type: string
example: '2018-01-10'
end_date:
description: The end date of the care plan
type: string
example: '2018-01-10'
CarePlanList:
allOf:
- $ref: '#/definitions/PaginatedList'
description: A list of Care Plans
type: object
properties:
total_pages:
description: Totalnumber of pages available
type: integer
example: 10
items:
type: array
items:
$ref: '#/definitions/CarePlanSummary'
CarePlanDiagnosis:
description: Care plan diagnosis
type: object
properties:
id:
description: Care Plan Diagnosis ID
type: integer
example: 100
plan_id:
description: Care Plan ID
type: integer
example: 345
plan_name:
description: Care plan name
type: string
example: 'Episode #4'
name:
description: A title of care plan diagnosis
type: string
example: Title example
start_date:
description: A start date of diagnosis
type: string
example: '2018-01-10'
end_date:
description: A end date of diagnosis
type: string
example: '2018-01-10'
description:
description: A description of care plan diagnosis
type: string
example: Description of diagnosis
is_primary:
description: Define that this diagnosis is primary
type: boolean
example: true
rank:
description: Used for ordering of diagnoses in list. The smaller, the higher ranked will the diagnosis be returned
type: integer
example: 0
status:
$ref: '#/definitions/CareplanItemStatus'
department:
$ref: '#/definitions/EntitySummary'
updated_at:
description: Datetime for the last update of the diagnosis
type: string
example: '2018-01-23T23:56:13+00:00'
updated_by:
$ref: '
# --- truncated at 32 KB (44 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/api-evangelist-alayacare/refs/heads/main/openapi/alayacare-care-plan-api-openapi.yml