Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MD013: false

# MD033/no-inline-html - Inline HTML
MD033:
allowed_elements: [table, colgroup, col, thead, tbody, tr, th, td]
allowed_elements: [table, colgroup, col, thead, tbody, tr, th, td, math, mi, mn, mo, mtable, mrow, mtd, mtr, mspace, mtext, msup, mfrac, msqrt]

# MD059/Link text should be descriptive
MD059: false
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ 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
43 changes: 21 additions & 22 deletions docs/summary-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,37 +176,37 @@ Unit
</th>
<th colspan="2" style="background-image: linear-gradient(to right, #E9695E, #F19181)">

_AnyLow_
AnyLow
</th>
<th rowspan="2">

_Target_
Target
</th>
<th colspan="3" style="background-image: linear-gradient(to right, #B69CE2, #856ACF, #5438A3)">

_AnyHigh_
AnyHigh
</th>
</tr>
<tr>
<th>

_VeryLow_
VeryLow
</th>
<th>

_Low_
Low
</th>
<th>

_High_
High
</th>
<th>

_VeryHigh_
VeryHigh
</th>
<th>

_ExtremeHigh_
ExtremeHigh
</th>
</tr>
</thead>
Expand All @@ -218,27 +218,27 @@ mmol/L
</td>
<td>

_v < 3.0_
v < 3.0
</td>
<td>

_3.0 ≤ v < 3.9_
3.0 ≤ v < 3.9
</td>
<td>

_3.9 ≤ v ≤ 10.0_
3.9 ≤ v ≤ 10.0
</td>
<td>

_10.0 < v ≤ 13.9_
10.0 < v ≤ 13.9
</td>
<td>

_v > 13.9_
v > 13.9
</td>
<td>

_v ≥ 19.4_
v ≥ 19.4
</td>
</tr>
<tr>
Expand All @@ -248,27 +248,27 @@ mg/dL
</td>
<td>

_v < 54_
v < 54
</td>
<td>

_54 ≤ v < 70_
54 ≤ v < 70
</td>
<td>

_70 ≤ v ≤ 180_
70 ≤ v ≤ 180
</td>
<td>

_180 < v ≤ 250_
180 < v ≤ 250
</td>
<td>

_v > 250_
v > 250
</td>
<td>

_v350_
v350
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -379,8 +379,7 @@ Each bucket has a set of common fields, as well as a set of fields repeated for
| ✅ | | _Minutes_ | _int_ | _min_ | Sum of minutes covered by each sample in the period |
| ✅ | ✅ | _Records_ | _int_ | | Count of samples in the period |
| ✅ | ✅ | _Percent_ | _float_ | % | if <math><mrow><mi>Total</mi><mo>.</mo><mi>Minutes</mi><mo>≠</mo><mn>0</mn></mrow></math>: <math><mfrac><mrow><mi mathvariant="bold">Xxx</mi><mo>.</mo><mi>Minutes</mi></mrow><mrow><mi>Total</mi><mo>.</mo><mi>Minutes</mi></mrow></mfrac></math> or if <math><mrow><mi>Total</mi><mo>.</mo><mi>Records</mi><mo>≠</mo><mn>0</mn></mrow></math>: <math><mfrac><mrow><mi mathvariant="bold">Xxx</mi><mo>.</mo><mi>Records</mi></mrow><mrow><mi>Total</mi><mo>.</mo><mi>Records</mi></mrow></mfrac></math> |
| ✅ | | _Variance_ | _float_ | <math><msup><mrow><mo>(</mo><mfrac><mi>mmol</mi><mi>L</mi></mfrac><mo>)</mo></mrow><mn>2</mn></msup></math>
| Calculated using [weighted incremental algorithm][variance].
| ✅ | | _Variance_ | _float_ | <math><msup><mrow><mo>(</mo><mfrac><mi>mmol</mi><mi>L</mi></mfrac><mo>)</mo></mrow><mn>2</mn></msup></math> | Calculated using [weighted incremental algorithm][variance]. |

## Handling Multiple Data Sources

Expand Down
26 changes: 26 additions & 0 deletions reference/auth.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,32 @@ paths:
- sessionToken: []
tags:
- Internal
'/v1/users/{userId}/oauth/{providerName}/authorize':
parameters:
- $ref: ./common/parameters/tidepooluserid.yaml
- name: providerName
in: path
required: true
schema:
$ref: './auth/models/providers/providerName.v1.yaml'
delete:
operationId: DeleteUserOauthAuthorization
summary: Delete User OAuth Authorization
description: Deletes the authorization for the OAuth provider `provider` for the user `userId`.
responses:
'200':
description: Success
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
components:
securitySchemes:
basicAuth:
Expand Down
17 changes: 17 additions & 0 deletions reference/clinic.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,23 @@ paths:
application/json:
schema:
$ref: ./clinic/models/patientCount.v1.yaml
'/v1/clinics/{clinicId}/patient_count/refresh':
parameters:
- $ref: '#/components/parameters/clinicId'
post:
operationId: RefreshPatientCount
summary: Refresh Patient Count
responses:
'202':
description: Accepted
description: |-
An internal endpoint to refresh the patient count for this clinic. This request may or may not be processed asynchronously.
A successful response means the patient count will be refreshed shortly.
tags:
- Clinics
- Internal
x-internal: true
parameters: []
'/v1/clinics/{clinicId}/ehr/sync':
parameters:
- $ref: '#/components/parameters/clinicId'
Expand Down
31 changes: 28 additions & 3 deletions reference/clinic/models/patientCount.v1.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
title: Patient Count
type: object
properties:
patientCount:
description: The patient count for a clinic
total:
description: |-
The count of all patients associated with the clinic, regardless of classification.
type: integer
minimum: 0
demo:
description: |-
The count of patients associated with the clinic that are classified as demo and do not
apply towards the plan-based patient count limit. Currently this is limited to 0 or 1,
but allows for future expansion with multiple demo patients if needed.
type: integer
minimum: 0
plan:
description: |-
The count of patients associated with the clinic classified as applying towards the
plan-based patient count limit. This excludes patients classified as demo as well as any
other classifications that do not apply towards the plan-based patient count limit
for various business reasons.
type: integer
minimum: 0
providers:
type: object
description: |-
The count of patients associated with the clinic by provider. As each patient may be associated
with multiple providers, the sum of all provider counts may exceed the total patient count.
additionalProperties:
$ref: './patientProviderCount.v1.yaml'
required:
- patientCount
- total
- demo
- plan
6 changes: 3 additions & 3 deletions reference/clinic/models/patientCountLimit.v1.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
title: Patient Count Limit
type: object
properties:
patientCount:
description: The patient count limit
plan:
description: The plan-based patient count limit
type: integer
minimum: 0
startDate:
Expand All @@ -12,4 +12,4 @@ properties:
description: The end date when the patient count limit should no longer be applied
$ref: '../../common/models/datetime.v1.yaml'
required:
- patientCount
- plan
22 changes: 22 additions & 0 deletions reference/clinic/models/patientProviderCount.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
title: Patient Provider Count
description: |-
The count of patients associated with the clinic for a specific provider. As each patient may be
associated with multiple providers, the sum of all provider counts may exceed the total patient count.
type: object
properties:
total:
description: |-
The count of patients that have a specific provider as a data source.
type: integer
minimum: 0
states:
description: |-
The count of patients for the provider segmented by data source state. The possible
states are connected, disconnected, error, pending, and pendingReconnect.
type: object
additionalProperties:
type: integer
minimum: 0
required:
- total
- states
26 changes: 26 additions & 0 deletions reference/data.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,32 @@ paths:
security:
- sessionToken: []

'/v1/partners/twiist/data/{dataSetId}':
parameters:
- $ref: './data/parameters/datasetid.v1.yaml'
post:
operationId: UploadTwiistData
summary: Upload twiist Data
description: >-
Uploads data to a user's data set for twiist.
requestBody:
$ref: '#/components/requestBodies/UploadDataList'
responses:
'200':
$ref: '#/components/responses/DataList'
'400':
$ref: './common/responses/badrequest.v1.yaml'
'401':
$ref: './common/responses/unauthorized.v1.yaml'
'403':
$ref: './common/responses/forbidden.v1.yaml'
'404':
$ref: './common/responses/notfound.v1.yaml'
tags:
- Data
security:
- sessionToken: []

'/data/{userId}':
parameters:
- $ref: './common/parameters/tidepooluserid.yaml'
Expand Down