Skip to content
Merged
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ GO_TOOLS = \
$(TOOLS_BIN)/oapi-codegen

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


$(NPM_BIN)/%:
$(MAKE) install_npm_pkgs
Expand Down
57 changes: 49 additions & 8 deletions reference/clinic.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,63 @@ paths:
in: query
name: period
description: Time Period to display
- schema:
required: true
- name: tags
description: Comma-separated list of patient tag IDs
schema:
type: array
items:
type: string
format: '^[a-f0-9]{24}$'
$ref: ./common/parameters/objectId.v1.yaml
minItems: 1
in: query
name: tags
description: Comma-separated list of patient tag IDs
style: form
explode: false
- schema:
required: true
- name: lastDataCutoff
description: Inclusive minimum of date of last data from a patient.
schema:
type: string
format: date-time
in: query
name: lastDataCutoff
description: Inclusive
required: true
- name: categories
description: |
Comma-separated list of TIDE report categories to return in queried order. If omitted or empty, the default TIDE categories will be returned - see example.
schema:
type: array
x-go-type-skip-optional-pointer: true
x-omitempty: true
x-omitzero: true
items:
type: string
enum:
- timeInVeryLowPercent
- timeInAnyLowPercent
- timeInExtremeHighPercent
- timeInVeryHighPercent
- timeInAnyHighPercent
- dropInTimeInTargetPercent
- timeInTargetPercent
- timeCGMUsePercent
- meetingTargets
in: query
style: form
explode: false
example:
- timeInVeryLowPercent
- timeInAnyLowPercent
- timeInVeryHighPercent
- timeInAnyHighPercent
- dropInTimeInTargetPercent
- timeCGMUsePercent
- meetingTargets
- name: excludeNoData
description: If true, then exclude / omit patients with no data in the TIDE report.
schema:
type: boolean
x-go-type-skip-optional-pointer: true
x-omitempty: true
in: query
'/v1/clinics/{clinicId}/patients':
parameters:
- $ref: '#/components/parameters/clinicId'
Expand Down
12 changes: 8 additions & 4 deletions reference/clinic/models/tide/tideConfig.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@ properties:
type: string
format: date-time
highGlucoseThreshold:
description: Threshold used for determining if a value is high
description: Minimum exclusive threshold in mmol/L for categorizing if a glucose value is high as established by the AACE.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just pointing out that this goes against the intent of the custom ranges that have been designed and are themselves in code review.

#170 (comment)

They don't necessarily need to align, but it seems like it'd be less confusing if they did.

type: number
x-go-type: float64
veryHighGlucoseThreshold:
description: Threshold used for determining if a value is very high
description: Minimum exclusive threshold in mmol/L for categorizing if a glucose value is very high as established by the AACE.
type: number
x-go-type: float64
extremeHighGlucoseThreshold:
description: Minimum inclusive threshold in mmol/L for categorizing if a glucose value is extremely high. Not defined by the AACE.
type: number
x-go-type: float64
lowGlucoseThreshold:
description: Threshold used for determining if a value is low
description: Maximum exclusive threshold in mmol/L for categorizing if a glucose value is low as established by the AACE.
type: number
x-go-type: float64
veryLowGlucoseThreshold:
description: Threshold used for determining if a value is very low
description: Maximum exclusive threshold in mmol/L for categorizing if a glucose value is very low as established by the AACE.
type: number
x-go-type: float64
tags:
Expand Down
26 changes: 16 additions & 10 deletions reference/clinic/models/tide/tideFilters.v1.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
type: object
title: tidefilters.v1
description: ''
description: 'Visual representation of filtered categories selected'
properties:
timeInVeryLowPercent:
dropInTimeInTargetPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
timeCGMUsePercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
timeInAnyLowPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
dropInTimeInTargetPercent:
timeInExtremeHighPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
timeInHighPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
timeInTargetPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
timeCGMUsePercent:
timeInVeryHighPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'
timeInVeryLowPercent:
type: string
pattern: ^(>=|>|<=|<)\d\.\d\d?$
example: '>0.5'

required:
- timeInVeryLowPercent
- timeInAnyLowPercent
- dropInTimeInTargetPercent
- timeInTargetPercent
- timeCGMUsePercent
5 changes: 5 additions & 0 deletions reference/clinic/models/tide/tideResultPatient.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ properties:
type: number
example: 0.35
x-go-type: float64
timeInExtremeHighPercent:
description: Percentage of time spent in extreme high glucose range
type: number
example: 0.35
x-go-type: float64
timeInAnyHighPercent:
description: Percentage of time spent in any high glucose range
type: number
Expand Down
8 changes: 0 additions & 8 deletions reference/clinic/models/tide/tideResults.v1.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
type: object
title: tideresults.v1
description: ''
required:
- timeInVeryLowPercent
- timeInLowPercent
- dropInTimeInTargetPercent
- timeInTargetPercent
- timeCGMUsePercent
- meetingTargets
- noData
additionalProperties:
type: array
items:
Expand Down
9 changes: 7 additions & 2 deletions scripts/check_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
set -euo pipefail

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
if [[ $OSTYPE =~ darwin ]] && command -v grealpath &> /dev/null; then
TOOLS_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
NPM_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
else
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
fi
PATH=$TOOLS_BIN:$NPM_BIN:$PATH

trace() {
Expand Down
9 changes: 7 additions & 2 deletions scripts/generate_clinic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
set -eou pipefail

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
if [[ $OSTYPE =~ darwin ]] && command -v grealpath &> /dev/null; then
TOOLS_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
NPM_BIN=$(grealpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
else
TOOLS_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../tools/bin")
NPM_BIN=$(realpath --canonicalize-existing "$SCRIPT_DIR/../node_modules/.bin")
fi
PATH=$TOOLS_BIN:$NPM_BIN:$PATH

trace() {
Expand Down