Authorisation added to population statistics API.

EH/population-statistics-authorisation
Eric Hoekstra 1 year ago
parent da007e70d3
commit e07a92116c

@ -2,7 +2,7 @@ get:
tags: tags:
- Population statistics - Population statistics
operationId: populationStatistics operationId: populationStatistics
summary: Population group-by summary: Common statistics
description: |- description: |-
Groups the patient population by any combination of age, preferred doctor, etc. and calculates the count of each category. Groups the patient population by any combination of age, preferred doctor, etc. and calculates the count of each category.
parameters: parameters:
@ -14,12 +14,7 @@ get:
type: array type: array
minItems: 1 minItems: 1
items: items:
type: string $ref: '../schemas/StatisticsGroupBy-enum.yaml'
enum:
- age
- preferredDoctor
- insurer
- gender
description: |- description: |-
Several items can be added to the group by using a comma separated list, e.g. `groupByItems=gender,age`. Several items can be added to the group by using a comma separated list, e.g. `groupByItems=gender,age`.
If an item is twice or more repeated the first occurrence is used. If an item is twice or more repeated the first occurrence is used.

@ -0,0 +1,56 @@
get:
tags:
- Population statistics
operationId: getStatisticsAuthorisation
summary: Authorisation
description: Reports the authorisations for group-by items for the specified practice(s). Care groups are allowed to query the authorisations of the underlying practices. Practices are allowed to query their own settings.
parameters:
- name: agbs
in: query
schema:
type: array
items:
$ref: ../schemas/agb.yaml
required: true
description: The agb of the practice(s) for which the authorisations should be reported.
responses:
200:
description: An array with for each practice an object describing the authorisation settings for the practice and for the care groups.
content:
application/json:
schema:
type: array
items:
type: object
properties:
practice:
$ref: '../schemas/agb.yaml'
groupBy:
type: array
items:
type: object
properties:
item:
$ref: ../schemas/StatisticsGroupBy-enum.yaml
enddate:
$ref: ../schemas/date.yaml
active:
type: boolean
description: False if the end date is today or in the past.
caregroups:
type: array
items:
type: object
properties:
tag:
$ref: ../schemas/tag.yaml
agb:
$ref: '../schemas/agb.yaml'
groupBy:
$ref: '#/get/responses/200/content/application~1json/schema/items/properties/groupBy'
400:
$ref: '../zoo-api.yaml#/components/responses/ReqFailure'
401:
$ref: '../zoo-api.yaml#/components/responses/JwtFailure'
404:
$ref: '../zoo-api.yaml#/components/responses/PatNotFound'

@ -0,0 +1,58 @@
post:
tags:
- Population statistics
operationId: setGroupByItemCareGroup
summary: Authorisation of care groups
description: |-
Set the authorisation for statistic group-by items for care groups. This enables or disables the statistic for use by the care group. Only when authorized as the practice the settings may be changed.
parameters:
- name: item
in: path
schema:
$ref: '../schemas/StatisticsGroupBy-enum.yaml'
required: true
- name: tag
in: path
schema:
$ref: '../schemas/tag.yaml'
- name: agb
in: query
schema:
$ref: '../schemas/agb.yaml'
description: AGB of the practice for which the authorisation should be set. This should match the JWT-authorisation.
required: true
- name: enddate
in: query
schema:
$ref: ../schemas/date.yaml
description: End date of the authorisation (exclusive). If omitted no end date is applied, or the end date is removed of an existing authorisation. Setting an end date to today or in past, effectively removes the authorisation.
- name: employee
in: query
schema:
type: string
description: The employee that is adding the authorisation. Any string is accepted, but it is recommended to use a employee code derived from this API.
required: true
responses:
'200':
description: The response parrots the request, except for the `employee` and `timestamp` properties. If the authorisation is changed the `employee` and `timestamp` from the request are responded, but if the request didn't change the authorisation, then the `employee` and `timestamp` from the last change are in the payload.
content:
application/json:
schema:
type: object
properties:
employee:
type: string
timestamp:
$ref: ../schemas/dateTime.yaml
agb:
$ref: ../schemas/agb.yaml
authorizedFor:
$ref: '../schemas/StatisticsGroupBy-enum.yaml'
tag:
$ref: '../schemas/tag.yaml'
enddate:
$ref: '../schemas/date.yaml'
'401':
$ref: '../zoo-api.yaml/#/components/responses/NoAuth'
'403':
$ref: '../zoo-api.yaml/#/components/responses/NoAccess'

@ -0,0 +1,56 @@
post:
tags:
- Population statistics
operationId: setGroupByItemPractice
summary: Authorisation of practice
description: |-
Set the authorisation for statistic group-by items for the practice. This enables or disables the statistic for all the employees of the practice at once. Only when authorized as the practice the settings may be changed.
parameters:
- name: 'item'
in: path
schema:
$ref: '../schemas/StatisticsGroupBy-enum.yaml'
required: true
- name: agb
in: query
schema:
$ref: '../schemas/agb.yaml'
description: AGB of the practice for which the authorisation should be set. This should match the JWT-authorisation.
required: true
- name: enddate
in: query
schema:
$ref: ../schemas/date.yaml
description: End date of the authorisation (exclusive). If omitted no end date is applied, or the end date is removed of an existing authorisation. Setting an end date to today or in past, effectively removes the authorisation.
- name: employee
in: query
schema:
type: string
description: The employee that is adding the authorisation. Any string is accepted, but it is recommended to use a employee code derived from this API.
required: true
responses:
'200':
description: The response parrots the request, except for the `employee` and `timestamp` properties. If the authorisation is changed the `employee` and `timestamp` from the request are responded, but if the request didn't change the authorisation, then the `employee` and `timestamp` from the last change are in the payload.
content:
application/json:
schema:
type: object
properties:
employee:
type: string
timestamp:
$ref: ../schemas/dateTime.yaml
agb:
$ref: ../schemas/agb.yaml
authorizedFor:
$ref: '../schemas/StatisticsGroupBy-enum.yaml'
tag:
$ref: '../schemas/tag.yaml'
example: ""
description: Always the empty tag.
enddate:
$ref: '../schemas/date.yaml'
'401':
$ref: '../zoo-api.yaml/#/components/responses/NoAuth'
'403':
$ref: '../zoo-api.yaml/#/components/responses/NoAccess'

@ -3,22 +3,21 @@ get:
- Population statistics - Population statistics
operationId: groupByItems operationId: groupByItems
summary: Group-by items summary: Group-by items
parameters:
- name: agb
in: query
schema:
$ref: ../schemas/agb.yaml
responses: responses:
200: 200:
description: |- description: |-
Returns a list of all available group-by items for the _population group-by end point_, but only if the items are available for the selected customer. A customer is selected by a JWT-claim or the AGB header. The output of this end point should be the same as the documentation for the groupByItems-parameter of the mentioned end point. Returns a list of all available group-by items for the _common statistics_ end point, but only if the items are available for the customer with `agb`. The output of this end point should be the same as the documentation below.
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
type: string $ref: ../schemas/StatisticsGroupBy-enum.yaml
example:
- age
- preferredDoctor
- insurer
- gender
- deprivedNeighborhood
400: 400:
$ref: '../zoo-api.yaml#/components/responses/ReqFailure' $ref: '../zoo-api.yaml#/components/responses/ReqFailure'
401: 401:

@ -0,0 +1,9 @@
description: Represents an object on which population statistics can be generated.
type: string
enum:
- age
- preferredDoctor
- insurer
- gender
- deprivedNeighborhood
example: age

@ -0,0 +1,3 @@
type: string
example: HZK
description: A tags represents some entity in which the practice can be classified, e.g. care group or district. The empty tag represents the practice itself.

@ -55,8 +55,6 @@ paths:
$ref: 'paths/patient_fundusByPractice.yaml' $ref: 'paths/patient_fundusByPractice.yaml'
/population/statistics: /population/statistics:
$ref: 'paths/population_statistics.yaml' $ref: 'paths/population_statistics.yaml'
/population/statistics/groupByItems:
$ref: 'paths/population_statistics_groupByItems.yaml'
/population/statistics/deprivedNeighborhood: /population/statistics/deprivedNeighborhood:
$ref: 'paths/population_statistics_deprived.yaml' $ref: 'paths/population_statistics_deprived.yaml'
/population/statistics/deprivedNeighborhood/{neighborhood}: /population/statistics/deprivedNeighborhood/{neighborhood}:
@ -69,6 +67,14 @@ paths:
$ref: 'paths/population_frequentUser_patients.yaml' $ref: 'paths/population_frequentUser_patients.yaml'
/population/frequentUser/patient: /population/frequentUser/patient:
$ref: 'paths/population_frequentUser_patient.yaml' $ref: 'paths/population_frequentUser_patient.yaml'
/population/statistics/authorisation:
$ref: 'paths/population_statistics_authorisation.yaml'
/population/statistics/authorisation/{item}/practice:
$ref: 'paths/population_statistics_authorisation_{item}_practice.yaml'
/population/statistics/authorisation/{item}/caregroup/{tag}:
$ref: 'paths/population_statistics_authorisation_{item}_caregroup_{tag}.yaml'
/population/statistics/groupByItems:
$ref: 'paths/population_statistics_groupByItems.yaml'
/qoc/careprogram: /qoc/careprogram:
$ref: 'paths/qoc_careprogram.yaml' $ref: 'paths/qoc_careprogram.yaml'
/qoc/checkupList/{setKey}: /qoc/checkupList/{setKey}:
@ -245,5 +251,3 @@ components:
<tr><td>exp</td><td>Expires at</td><td><i>OPTIONAL</i> If included, the request must not be received after this time. May be up to 10 minutes in the future. The difference between the exp claim and the iat must be 20 minutes or less and iat &lt; exp. </td></tr> <tr><td>exp</td><td>Expires at</td><td><i>OPTIONAL</i> If included, the request must not be received after this time. May be up to 10 minutes in the future. The difference between the exp claim and the iat must be 20 minutes or less and iat &lt; exp. </td></tr>
<tr><td>nbf</td><td>Not before</td><td><i>OPTIONAL</i> If included, the request must not be received before this time. Should not be set in the future.</td></tr> <tr><td>nbf</td><td>Not before</td><td><i>OPTIONAL</i> If included, the request must not be received before this time. Should not be set in the future.</td></tr>
</table> </table>

Loading…
Cancel
Save