diff --git a/Makefile b/Makefile index 163597d0..d21532da 100644 --- a/Makefile +++ b/Makefile @@ -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/oapi-codegen@v2.4.1 + GOBIN=$(shell pwd)/$(TOOLS_BIN) go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.5.0 + $(NPM_BIN)/%: $(MAKE) install_npm_pkgs diff --git a/reference/clinic.v1.yaml b/reference/clinic.v1.yaml index c387f5f6..07f3cc36 100644 --- a/reference/clinic.v1.yaml +++ b/reference/clinic.v1.yaml @@ -253,22 +253,46 @@ 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}$' + pattern: '^[a-f0-9]{24}$' + 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. If omitted or empty, the default TIDE categories will be returned. + schema: + type: array + x-go-type-skip-optional-pointer: true + x-omitempty: true + x-omitzero: true + items: + type: string + enum: ['timeInVeryLowPercent', 'timeInAnyLowPercent', 'timeInExtremeHighPercent', 'timeInVeryHighPercent', 'timeInHighPercent', 'dropInTimeInTargetPercent', 'timeInTargetPercent', 'timeCGMUsePercent', 'meetingTargets'] + in: query + style: form + explode: false + - name: excludeNoDataPatients + 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' diff --git a/reference/clinic/models/tide/tideConfig.v1.yaml b/reference/clinic/models/tide/tideConfig.v1.yaml index 322664de..0405f606 100644 --- a/reference/clinic/models/tide/tideConfig.v1.yaml +++ b/reference/clinic/models/tide/tideConfig.v1.yaml @@ -23,6 +23,10 @@ properties: description: Threshold used for determining if a value is very high type: number x-go-type: float64 + extremeHighGlucoseThreshold: + description: Threshold used for determining if a value is extremely high + type: number + x-go-type: float64 lowGlucoseThreshold: description: Threshold used for determining if a value is low type: number diff --git a/reference/clinic/models/tide/tideFilters.v1.yaml b/reference/clinic/models/tide/tideFilters.v1.yaml index a5bfd5a1..08e8774e 100644 --- a/reference/clinic/models/tide/tideFilters.v1.yaml +++ b/reference/clinic/models/tide/tideFilters.v1.yaml @@ -1,8 +1,12 @@ 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' @@ -10,7 +14,11 @@ properties: 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' @@ -18,14 +26,12 @@ properties: 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 \ No newline at end of file diff --git a/reference/clinic/models/tide/tideResultPatient.v1.yaml b/reference/clinic/models/tide/tideResultPatient.v1.yaml index 2b59be5d..7d972646 100644 --- a/reference/clinic/models/tide/tideResultPatient.v1.yaml +++ b/reference/clinic/models/tide/tideResultPatient.v1.yaml @@ -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 diff --git a/reference/clinic/models/tide/tideResults.v1.yaml b/reference/clinic/models/tide/tideResults.v1.yaml index 323ec70f..4af29cf1 100644 --- a/reference/clinic/models/tide/tideResults.v1.yaml +++ b/reference/clinic/models/tide/tideResults.v1.yaml @@ -1,14 +1,6 @@ type: object title: tideresults.v1 description: '' -required: - - timeInVeryLowPercent - - timeInLowPercent - - dropInTimeInTargetPercent - - timeInTargetPercent - - timeCGMUsePercent - - meetingTargets - - noData additionalProperties: type: array items: diff --git a/scripts/check_spec.sh b/scripts/check_spec.sh index 3234ca4b..37a3224c 100755 --- a/scripts/check_spec.sh +++ b/scripts/check_spec.sh @@ -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() { diff --git a/scripts/generate_clinic.sh b/scripts/generate_clinic.sh index 973ff4f1..543b8c95 100755 --- a/scripts/generate_clinic.sh +++ b/scripts/generate_clinic.sh @@ -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() {