You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zoo-api/paths/customer_careprogram.yaml

163 lines
7.4 KiB
YAML

get:
operationId: getCustomerCareProgram
tags:
- Customer management
summary: Practices and care programs
description: |-
Gets all practices of a care group and their participation in a care program.
Enumerates all practices for which the current customer (user) is responsible in the care group. The customer identified with the JWT must be the group manager. The care group must be responsible for the underlying practices. Some care groups are organized in a way that they are not allowed to process data of the member practices. For these care groups no practices are shown.
Only care programs to which the practice was added by the authorised care group are shown. That means if a practice moves to another care group, then the registered care programs are gone.
If the JWT identifies a single practice, then API runs in bare mode. The response in this mode has the same structure, but the list of care programs of the care group is always empty and the list of practices holds exactly one practice.
parameters:
- name: refDate
in: query
description: If omitted, today is taken.
schema:
$ref: ../schemas/date.yaml
- name: agbs
in: query
description: |-
If the requesting entity is a care group, all GP practices in the group will be returned; this parameter can be used to filter the list, so
that only those GP practices with one of the AGBs listed here are returned. If the requesting entity is a single GP practice, this parameter
is ignored.
example: 12345678,23456789
schema:
type: array
items:
$ref: ../schemas/agb.yaml
responses:
'200':
description: care program inclusions status of all relevant GP practices.
content:
application/json:
schema:
type: object
properties:
caregroup:
type: object
description: Information about the care group itself; will not be included if the authorizing entity is a GP practice.
properties:
name:
type: string
description: |-
Identifying tag name of the care group.
example: demo_fabel
careprograms:
description: |-
All care programs contracted by the care group. Subtract from this set the active care programs from any practice reported in `practices` to know which care programs they may want to activate.
example:
- OuderenZorg
- DM
- COPD
- HVZ
- VVR
type: array
items:
$ref: '../schemas/CareProgram-enum.yaml'
practices:
type: array
items:
type: object
properties:
agb:
$ref: ../schemas/agb.yaml
name:
type: string
gpis:
$ref: ../schemas/GPIS.yaml
careprograms:
type: array
items:
type: object
properties:
careprogram:
$ref: '../schemas/CareProgram-enum.yaml'
periodStart:
$ref: ../schemas/date.yaml
periodEnd:
$ref: ../schemas/date.yaml
active:
type: boolean
description: True if today is on or after `periodStart` and before `periodEnd`.
required:
- careprogram
- periodStart
- active
'401':
$ref: '../zoo-api.yaml/#/components/responses/NoAuth'
'403':
$ref: '../zoo-api.yaml/#/components/responses/NoAccess'
post:
tags:
- Customer management
operationId: setCustomerCareProgram
summary: Add a practice to a care program.
description: |-
Allows a care group manager to configure which care programs are actively participated in by a GP practice.
The caller must authorize itself as a care group (manager).
The care group must be allowed to take responsibility for the practices it holds. If not, the request is ignored and an empty Json-object is sent back to the caller, indicating that processing was not successful.
The practice must be one of the care group practices. If not, the request is ignored and an empty Json-object is sent back to the caller.
In all other cases a Json-object containing the same data as in the request with a timestamp added is sent back in the response.
The operation is idempotent for the combination of: `careprogram`, `agb`, `periodStart` and `periodEnd`. If these are the same in any _subsequent call_ the request is processed as being fully accepted, showing the request data in the response,
but the `employee` and `timestamp` aren't updated in the database. The timestamp and employee of the original submit to this API is included in the response instead of the provided values.
requestBody:
content:
'application/x-www-form-urlencoded':
schema:
type: object
properties:
careprogram:
description: The kind of care program that the practice participates in.
$ref: '../schemas/CareProgram-enum.yaml'
agb:
description: The AGB of the practice (not the doctor).
$ref: '../schemas/agb.yaml'
periodStart:
description: |-
If `periodEnd` is supplied, then the `periodStart` must meet the condition that `periodStart` < `periodEnd`. The period starts on `periodStart` and ends on the day before `periodEnd`, so the start date is inclusive and end date exclusive.
$ref: ../schemas/date.yaml
periodEnd:
description: See `periodStart`.
$ref: ../schemas/date.yaml
employee:
type: string
description: The employee that is adding the practice. Any string is accepted, but it is recommended to use a employee code derived from this API.
required:
- careprogram
- agb
- periodStart
- employee
responses:
'200':
description: |-
If and only if, the request was successful processed down to the database, a Json-object with the following properties is sent back to the caller, otherwise a non 200 HTTP response.
content:
'application/json':
schema:
type: object
properties:
employee:
type: string
timestamp:
$ref: ../schemas/dateTime.yaml
careprogram:
$ref: '../schemas/CareProgram-enum.yaml'
agb:
$ref: '../schemas/agb.yaml'
periodStart:
$ref: ../schemas/date.yaml
periodEnd:
$ref: ../schemas/date.yaml
'401':
$ref: '../zoo-api.yaml/#/components/responses/NoAuth'
'403':
$ref: '../zoo-api.yaml/#/components/responses/NoAccess'