Skip to content

Commit bff2ba2

Browse files
committed
[BACK-3970] Add spec for selectable TIDE report categories.
1 parent c5a8c74 commit bff2ba2

File tree

7 files changed

+64
-25
lines changed

7 files changed

+64
-25
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ GO_TOOLS = \
5656
$(TOOLS_BIN)/oapi-codegen
5757

5858
$(TOOLS_BIN)/oapi-codegen: $(TOOLS_BIN)
59-
GOBIN=$(shell pwd)/$(TOOLS_BIN) go install github.com/deepmap/oapi-codegen/cmd/[email protected]
59+
GOBIN=$(shell pwd)/$(TOOLS_BIN) go install github.com/oapi-codegen/oapi-codegen/v2/cmd/[email protected]
60+
6061

6162
$(NPM_BIN)/%:
6263
$(MAKE) install_npm_pkgs

reference/clinic.v1.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,22 +253,48 @@ paths:
253253
in: query
254254
name: period
255255
description: Time Period to display
256+
required: true
256257
- schema:
257258
type: array
258259
items:
259260
type: string
260-
format: '^[a-f0-9]{24}$'
261+
pattern: '^[a-f0-9]{24}$'
262+
minItems: 1
261263
in: query
262264
name: tags
263265
description: Comma-separated list of patient tag IDs
264266
style: form
265267
explode: false
268+
required: true
266269
- schema:
267270
type: string
268271
format: date-time
269272
in: query
270273
name: lastDataCutoff
271-
description: Inclusive
274+
description: Inclusive minimum of date of last data from a patient.
275+
required: true
276+
- schema:
277+
type: array
278+
x-go-type-skip-optional-pointer: true
279+
x-omitempty: true
280+
x-omitzero: true
281+
items:
282+
type: string
283+
enum: ['timeInVeryLowPercent', 'timeInAnyLowPercent', 'timeInExtremeHighPercent', 'timeInVeryHighPercent', 'timeInHighPercent', 'dropInTimeInTargetPercent', 'timeInTargetPercent', 'timeCGMUsePercent', 'meetingTargets', 'noData']
284+
in: query
285+
name: categories
286+
description: Comma-separated list of TIDE report categories. If omitted or empty, the default TIDE categories will be returned.
287+
style: form
288+
explode: false
289+
- schema:
290+
type: boolean
291+
x-go-type-skip-optional-pointer: true
292+
x-omitempty: true
293+
x-omitzero: true
294+
in: query
295+
name: excludeNoDataPatients
296+
description: If true, then exclude / omit patients with no data in the TIDE report.
297+
style: form
272298
'/v1/clinics/{clinicId}/patients':
273299
parameters:
274300
- $ref: '#/components/parameters/clinicId'

reference/clinic/models/tide/tideConfig.v1.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ properties:
2323
description: Threshold used for determining if a value is very high
2424
type: number
2525
x-go-type: float64
26+
extremeHighGlucoseThreshold:
27+
description: Threshold used for determining if a value is extremely high
28+
type: number
29+
x-go-type: float64
2630
lowGlucoseThreshold:
2731
description: Threshold used for determining if a value is low
2832
type: number

reference/clinic/models/tide/tideFilters.v1.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
type: object
22
title: tidefilters.v1
3-
description: ''
3+
description: 'Visual representation of filtered categories selected'
44
properties:
5-
timeInVeryLowPercent:
5+
dropInTimeInTargetPercent:
6+
type: string
7+
pattern: ^(>=|>|<=|<)\d\.\d\d?$
8+
example: '>0.5'
9+
timeCGMUsePercent:
610
type: string
711
pattern: ^(>=|>|<=|<)\d\.\d\d?$
812
example: '>0.5'
913
timeInAnyLowPercent:
1014
type: string
1115
pattern: ^(>=|>|<=|<)\d\.\d\d?$
1216
example: '>0.5'
13-
dropInTimeInTargetPercent:
17+
timeInExtremeHighPercent:
18+
type: string
19+
pattern: ^(>=|>|<=|<)\d\.\d\d?$
20+
example: '>0.5'
21+
timeInHighPercent:
1422
type: string
1523
pattern: ^(>=|>|<=|<)\d\.\d\d?$
1624
example: '>0.5'
1725
timeInTargetPercent:
1826
type: string
1927
pattern: ^(>=|>|<=|<)\d\.\d\d?$
2028
example: '>0.5'
21-
timeCGMUsePercent:
29+
timeInVeryHighPercent:
30+
type: string
31+
pattern: ^(>=|>|<=|<)\d\.\d\d?$
32+
example: '>0.5'
33+
timeInVeryLowPercent:
2234
type: string
2335
pattern: ^(>=|>|<=|<)\d\.\d\d?$
2436
example: '>0.5'
2537

26-
required:
27-
- timeInVeryLowPercent
28-
- timeInAnyLowPercent
29-
- dropInTimeInTargetPercent
30-
- timeInTargetPercent
31-
- timeCGMUsePercent

reference/clinic/models/tide/tideResults.v1.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
type: object
22
title: tideresults.v1
33
description: ''
4-
required:
5-
- timeInVeryLowPercent
6-
- timeInLowPercent
7-
- dropInTimeInTargetPercent
8-
- timeInTargetPercent
9-
- timeCGMUsePercent
10-
- meetingTargets
11-
- noData
124
additionalProperties:
135
type: array
146
items:

scripts/check_spec.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
set -euo pipefail
44

55
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6-
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
7-
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
6+
if [[ $OSTYPE =~ darwin ]] && command -v grealpath &> /dev/null; then
7+
TOOLS_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
8+
NPM_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
9+
else
10+
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
11+
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
12+
fi
813
PATH=$TOOLS_BIN:$NPM_BIN:$PATH
914

1015
trace() {

scripts/generate_clinic.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
set -eou pipefail
44

55
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6-
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
7-
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
6+
if [[ $OSTYPE =~ darwin ]] && command -v grealpath &> /dev/null; then
7+
TOOLS_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
8+
NPM_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
9+
else
10+
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
11+
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
12+
fi
813
PATH=$TOOLS_BIN:$NPM_BIN:$PATH
914

1015
trace() {

0 commit comments

Comments
 (0)