From 3bd1d574e03a2c07aa546f4770a8a273897e158a Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 3 Apr 2023 06:15:22 +0200 Subject: [PATCH] [api] [wip] API docs: Added IndicatorSet and Indicator schema --- api/ui_api.swagger.yaml | 187 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 171 insertions(+), 16 deletions(-) diff --git a/api/ui_api.swagger.yaml b/api/ui_api.swagger.yaml index 91dc940..e3c50dd 100644 --- a/api/ui_api.swagger.yaml +++ b/api/ui_api.swagger.yaml @@ -31,23 +31,17 @@ tags: description: |- API related to Quality of Care features - A care program (dutch: _ketenzorg_ or _zorgprogramma_) describes a specific disease (such as Diabetes or Astma) or a more abstract concern such as elderly care or -general concern about cardiovascular health. The same care program can show up multiple times, as there are different care programs and standards for the same disease or -concern. For example, there could be the InEen report 'take' on how one should provide Diabetes care, and there could be some regional group's slightly different take on it; -these would show up as different care programs. + A care program (dutch: _ketenzorg_ or _zorgprogramma_) describes a specific disease (such as Diabetes or Astma) or a more abstract concern such as elderly care or general concern about cardiovascular health. The same care program can show up multiple times, as there are different care programs and standards for the same disease or concern. For example, there could be the InEen report 'take' on how one should provide Diabetes care, and there could be some regional group's slightly different take on it; these would show up as different care programs. - Any given customer has a 'fave' status for any given care program; some care programs are enabled by default and some are disabled by default. However, a customer can -explicitly select a program they wouldn't ordinarily see ('favourite' it), or explicitly deselect a program they get by default ('unfavourite' it). Most care programs will -be neither favourited nor unfavourited: They should be shown based on their `default_show` property. + Any given customer has a 'fave' status for any given care program; some care programs are enabled by default and some are disabled by default. However, a customer can explicitly select a program they wouldn't ordinarily see ('favourite' it), or explicitly deselect a program they get by default ('unfavourite' it). Most care programs will be neither favourited nor unfavourited: They should be shown based on their `defaultShow` property. To allow favouriting/unfavouriting, the front end has 2 separate views for selecting care programs: The usual view, which shows _only_: - Care programs that customer has explicitly favourited. - Care programs that are shown by default to this customer which they did not explicitly unfavourite. - As well as a 'config' view where they see _all_ care programs that could possibly be relevant for that customer, where the customer can preview the report -(essentially, run the report as normal), favourite something they don't get by default, or unfavourite something they get by default. + As well as a 'config' view where they see _all_ care programs that could possibly be relevant for that customer, where the customer can preview the report (essentially, run the report as normal), favourite something they don't get by default, or unfavourite something they get by default. paths: - /qoc/careprogram/list: + /qoc/careprogram: get: tags: - QoC @@ -55,7 +49,7 @@ paths: description: Includes all care programs that the user is allowed to see, even ones that are unfavourited or not shown by default. responses: '200': - description: Success + description: Care programs are returned content: application/json: schema: @@ -66,10 +60,171 @@ paths: $ref: '#/components/responses/NoAuth' '403': $ref: '#/components/responses/NoAccess' + /qoc/careprogram/{careprogramKey}/fave: + put: + tags: + - QoC + summary: Favourite, unfavourite, or clear fav status for a given CareProgram + parameters: + - name: careprogramKey + in: path + description: key of care program for which the fav status needs to be changed + required: true + schema: + type: string + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: string + example: T + enum: + - T + - F + - X + responses: + '200': + description: Fav status is updated + content: + application/json: + schema: + type: object + properties: + key: + description: The care program key as provided + type: string + example: ZEL-dm2 + value: + description: The current fav status of this careprogram + type: string + example: T + enum: + - T + - F + - X + defaultShow: + description: Whether this care program should be default-shown or not. + type: boolean + '401': + $ref: '#/components/responses/NoAuth' + '403': + $ref: '#/components/responses/NoAccess' + components: schemas: + IndicatorSet: + description: |- + A report about a care program based on showing a number of ratios, such as 'how many people in your practice have diabetes', or 'for all diabetes patients in your care with a recent blood pressure measurement, how do these blood pressure measurements split into "problematic" / "concern" / "okay" categories + type: object + properties: + name: + description: Human readable dutch text; should fit in one line. + type: string + example: Diabetes Mellitus type 2 – per InEen 2023 accreditatie + refDate: + description: 'All calculations are done on this date (dutch: _peildatum_).' + type: string + format: date + example: 2023-04-01 + chapters: + description: Each chapter has a title and contains 1 or more indicators. + type: array + items: + type: object + properties: + title: + description: In dutch, *HTML* formatted; should fit on one line. + type: string + example: Populatie + indicators: + description: The indicators in this chapter + type: array + items: + $ref: '#/components/schemas/Indicator' + Indicator: + description: |- + A single ratio or flat number; should be shown as one box with a chart (generally, a single fixed-size bar with each ratio element rendered on this bar). The numbers in this object are on some axis, generally, percentage. + type: object + properties: + title: + description: Short, in dutch, *HTML* (but rarely includes formatting; at most, sup/superscript). + type: string + example: Prevalentie Diabetes + xMin: + description: Numeric value of the far left of the bar. + type: number + example: 10.0 + default: 0 + xMax: + description: Numeric value of the far right of the bar. + type: number + example: 80.0 + default: 100.0 + xLow: + description: '*OPTIONAL* If present, draw a bar at this position indicating that this indicator can fall below this lower bound, but if it does, that is noteworthy. For example, because that is beyond 3 standard deviations of the dutch average, or, its a goal set by the practice, the insurer, or the care group and thus falling below it means the goal is not met.' + type: number + example: 20.0 + xHigh: + description: '*OPTIONAL* If present, draw a bar at this position indicating that this indicator can fall above this upper bound, but if it does, that is noteworthy. For example, beyond 3 standard deviations of the dutch average, or, a goal for an indicator where lower is better.' + type: number + example: 80.0 + unitDesc: + description: '*OPTIONAL* describes the unit that the stated legend values are in, in dutch, and *HTML*. For example, if showing blood pressure, `mmHg`. If missing, treat as the empty string (do not show unit at all)' + type: string + example: mmHg + default: '' + legend: + description: |- + *OPTIONAL* describes the names of each ratio provided. + If not included, do not show a legend + type: array + items: + type: string + style: + description: |- + A key that describes the render style for this entire indicator. + For example, 'failed' indicates that the indicator should be rendered + with a red hue to focus the user's attention on the fact that this + indicator represents a goal or requirement that they do not currently + meet. + type: string + example: failed + default: normal + enum: + - failed + - normal + - met + - focus + bars: + description: |- + A series of numbers, each of which needs to be put on the bar in sequence. For some indicators, the sum of the values adds up to be equal to `xMax - xMin`, if it doesn't, the final part of the bar remains blank (white, for example). For example, given the usual xMin/xMax of 0/100, one could have 3 bars: 40-Good, 35-Concern, 25-Problematic. Which should be rendered as green/yellow/red sub-bars of the appropriate size across the indicator. + type: array + items: + type: object + properties: + style: + description: |- + Describes what kind of ratio this bar describes. + Individual bars represent some kind of ratio and this describes the nature of it. Each key should result in some style, generally, the color of the bar. For example, `serious` (indicating a group of patients whose lab result for this indicator is of serious concern, i.e. medically speaking quite bad news) should be rendered dark red. + type: string + example: concern + enum: + - good + - concern + - problem + - serious + - measured + - nonPrefMeasured + - 'TBD: There are many more.' + value: + description: |- + The 'size' of the described ratio. Relative to the range of the bar (as described by `xMax`-`xMin`). + type: number + example: 20.5 + + CareProgram: type: object properties: @@ -81,11 +236,11 @@ components: description: in dutch and in *HTML*, can consist of multiple paragraphs, but won't be more than ~5 lines or so. type: string example: Ketenzorg DM2 volgens de standaard werkwijze van zorgggroep ZEL. - default_show: + defaultShow: description: If `true`, show this unless explicitly unfavourited. If `false`, do not show unless explicitly favourited. type: boolean - fav_state: - description: If `T`, always show this. If `F`, never show it. If `X`, show if `default_show` is `true`. + favState: + description: If `T`, always show this. If `F`, never show it. If `X`, show if `defaultShow` is `true`. type: string example: X enum: @@ -119,7 +274,8 @@ components: example: '/indicators/casefinder?t=dm' key: description: >- - Only for `type: "indicatorset"`. Pass to `/qoc/indicatorset` API. + A unique string (always ASCII, no spaces) identifying this care program. + Pass to `/qoc/indicatorset` API, or can be used for fave/unfave. type: string example: ZEL-dm2 @@ -129,4 +285,3 @@ components: description: User is not logged in / session expired. NoAccess: description: User is not allowed to access this API endpoint. -