Skip to content

Commit 0dcc826

Browse files
Merge pull request #55 from tidepool-org/BACK-2290-dexcom-sharing
[BACK-2290] Dexcom patient connection
2 parents 8bda137 + e552f0a commit 0dcc826

File tree

5 files changed

+184
-20
lines changed

5 files changed

+184
-20
lines changed

reference/clinic.v1.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,26 @@ paths:
950950
highGlucoseThreshold: 0
951951
lowGlucoseThreshold: 0
952952
description: ''
953+
'/v1/patients/{userId}/data_sources':
954+
parameters:
955+
- $ref: '#/components/parameters/userId'
956+
put:
957+
summary: Create or update a data source for a patient
958+
operationId: UpdatePatientDataSources
959+
responses:
960+
'200':
961+
description: OK
962+
'404':
963+
description: Not Found
964+
description: Internal endpoint to upsert patient data source provider details in all their associated clinic records.
965+
x-internal: true
966+
tags:
967+
- clinic
968+
requestBody:
969+
content:
970+
application/json:
971+
schema:
972+
$ref: '#/components/schemas/DataSources'
953973
'/v1/clinics/{clinicId}/tier':
954974
parameters:
955975
- $ref: '#/components/parameters/clinicId'
@@ -981,6 +1001,23 @@ paths:
9811001
description: Sends upload reminder to the patient
9821002
tags:
9831003
- clinic
1004+
'/v1/clinics/{clinicId}/patients/{patientId}/send_dexcom_connect_request':
1005+
parameters:
1006+
- $ref: '#/components/parameters/clinicId'
1007+
- $ref: '#/components/parameters/patientId'
1008+
post:
1009+
summary: Resend dexcom connect request email
1010+
operationId: SendDexcomConnectRequest
1011+
responses:
1012+
'200':
1013+
description: OK
1014+
content:
1015+
application/json:
1016+
schema:
1017+
$ref: '#/components/schemas/Patient'
1018+
description: Resend dexcom connect request to the email address of the patient
1019+
tags:
1020+
- clinic
9841021
'/v1/clinics/{clinicId}/patients/delete_tag/{patientTagId}':
9851022
parameters:
9861023
- $ref: '#/components/parameters/clinicId'
@@ -1023,6 +1060,14 @@ components:
10231060
type: array
10241061
items:
10251062
$ref: '#/components/schemas/PatientTag'
1063+
DateTime:
1064+
$ref: ./common/models/datetime.v1.yaml
1065+
DataSource:
1066+
$ref: ./clinic/models/datasource.v1.yaml
1067+
DataSources:
1068+
type: array
1069+
items:
1070+
$ref: '#/components/schemas/DataSource'
10261071
InviteClinician:
10271072
$ref: ./clinic/models/inviteclinician.v1.yaml
10281073
TidepoolUserId:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
type: object
2+
title: Patient data source
3+
properties:
4+
state:
5+
type: string
6+
title: Data source connection state
7+
enum:
8+
- pending
9+
- pendingReconnect
10+
- connected
11+
- disconnected
12+
- error
13+
example: connected
14+
providerName:
15+
$ref: ../../auth/models/providers/name.v1.yaml
16+
dataSourceId:
17+
title: Data Source Object Id
18+
type: string
19+
description: String representation of a resource id
20+
minLength: 24
21+
maxLength: 24
22+
pattern: '^[a-f0-9]{24}$'
23+
readOnly: true
24+
modifiedTime:
25+
$ref: ../../common/models/datetime.v1.yaml
26+
expirationTime:
27+
$ref: ../../common/models/datetime.v1.yaml
28+
required:
29+
- state
30+
- providerName

reference/clinic/models/patient.v1.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,17 @@ properties:
4949
readOnly: true
5050
attestationSubmitted:
5151
type: boolean
52+
dataSources:
53+
type: array
54+
nullable: true
55+
items:
56+
$ref: ./datasource.v1.yaml
5257
summary:
5358
$ref: ./patientsummary.v1.yaml
59+
lastRequestedDexcomConnectTime:
60+
type: string
61+
format: date-time
62+
readOnly: true
5463
lastUploadReminderTime:
5564
type: string
5665
format: date-time

reference/confirm.v1.yaml

Lines changed: 93 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ tags:
4343
paths:
4444
'/confirm/send/signup/{userId}':
4545
parameters:
46-
- $ref: './common/parameters/tidepooluserid.yaml'
46+
- $ref: '#/components/parameters/userId'
4747
post:
4848
operationId: SendAccountSignupConfirmation
4949
summary: Send Account Signup Confirmation
5050
description: >-
5151
Sends account signup confirmation email.
52+
requestBody:
53+
$ref: '#/components/requestBodies/ConfirmationUpsert'
5254
responses:
5355
'200':
5456
$ref: '#/components/responses/ConfirmationSuccess'
@@ -67,7 +69,7 @@ paths:
6769

6870
'/confirm/resend/signup/{email}':
6971
parameters:
70-
- $ref: './confirm/parameters/email.v1.yaml'
72+
- $ref: '#/components/parameters/email'
7173
post:
7274
operationId: ResendAccountSignup
7375
summary: Resend account signup confirmation email
@@ -87,7 +89,7 @@ paths:
8789

8890
'/confirm/accept/signup/{key}':
8991
parameters:
90-
- $ref: './confirm/parameters/key.v1.yaml'
92+
- $ref: '#/components/parameters/key'
9193
put:
9294
operationId: ConfirmAccountSignup
9395
summary: Accept Account Signup
@@ -98,7 +100,7 @@ paths:
98100
content:
99101
'application/json':
100102
schema:
101-
$ref: './confirm/models/acceptance.v1.yaml'
103+
$ref: '#/components/schemas/Acceptance'
102104
responses:
103105
'200':
104106
$ref: '#/components/responses/ConfirmationSuccess'
@@ -113,7 +115,7 @@ paths:
113115

114116
'/confirm/dismiss/signup/{userId}':
115117
parameters:
116-
- $ref: './common/parameters/tidepooluserid.yaml'
118+
- $ref: '#/components/parameters/userId'
117119
put:
118120
operationId: DismissAccountSignup
119121
summary: Dismiss Account Signup
@@ -134,16 +136,15 @@ paths:
134136

135137
'/confirm/signup/{userId}':
136138
parameters:
137-
- $ref: './common/parameters/tidepooluserid.yaml'
139+
- $ref: '#/components/parameters/userId'
138140
get:
139141
operationId: GetAccountSignupConfirmation
140142
summary: Get Account Signup Confirmation
141143
description: >-
142-
This endpoint is provided for completeness.
143-
We don't expect to need it in the actual user flow.
144+
Fetch latest account signup confirmation for the provided userId
144145
responses:
145146
'200':
146-
$ref: '#/components/responses/ConfirmationList'
147+
$ref: '#/components/responses/Confirmation'
147148
'400':
148149
$ref: '#/components/responses/ConfirmationError'
149150
'401':
@@ -156,6 +157,28 @@ paths:
156157
- Confirm
157158
security:
158159
- sessionToken: []
160+
post:
161+
operationId: UpsertAccountSignupConfirmation
162+
summary: Upsert Account Signup Confirmation
163+
description: >-
164+
Add or refresh an account signup confirmation for the provided userId
165+
requestBody:
166+
$ref: '#/components/requestBodies/ConfirmationUpsert'
167+
responses:
168+
'200':
169+
$ref: '#/components/responses/Confirmation'
170+
'400':
171+
$ref: '#/components/responses/ConfirmationError'
172+
'403':
173+
$ref: '#/components/responses/ConfirmationError'
174+
'404':
175+
$ref: '#/components/responses/ConfirmationError'
176+
'500':
177+
$ref: '#/components/responses/ConfirmationError'
178+
tags:
179+
- Confirm
180+
security:
181+
- sessionToken: []
159182

160183
put:
161184
operationId: CancelAccountSignupConfirmation
@@ -180,7 +203,7 @@ paths:
180203

181204
'/confirm/forgot/{email}':
182205
parameters:
183-
- $ref: './confirm/parameters/email.v1.yaml'
206+
- $ref: '#/components/parameters/email'
184207
post:
185208
operationId: SendPasswordReset
186209
summary: Send Password Reset Email
@@ -212,7 +235,7 @@ paths:
212235
content:
213236
application/json:
214237
schema:
215-
$ref: './confirm/models/acceptpassword.v1.yaml'
238+
$ref: '#/components/schemas/Password'
216239
responses:
217240
'200':
218241
$ref: '#/components/responses/ConfirmationError'
@@ -227,7 +250,7 @@ paths:
227250

228251
'/confirm/send/invite/{userId}':
229252
parameters:
230-
- $ref: './common/parameters/tidepooluserid.yaml'
253+
- $ref: '#/components/parameters/userId'
231254
post:
232255
operationId: SendCareTeamInvite
233256
summary: Send Invitation to Join Care Team
@@ -254,8 +277,8 @@ paths:
254277

255278
'/confirm/accept/invite/{userId}/{invitedBy}':
256279
parameters:
257-
- $ref: './common/parameters/tidepooluserid.yaml'
258-
- $ref: './confirm/parameters/invitedbyuser.v1.yaml'
280+
- $ref: '#/components/parameters/userId'
281+
- $ref: '#/components/parameters/invitedByUser'
259282
put:
260283
operationId: AcceptCareTeamInvite
261284
summary: Accept Invitation to Join Care Team
@@ -279,7 +302,7 @@ paths:
279302

280303
'/confirm/invite/{userId}':
281304
parameters:
282-
- $ref: './common/parameters/tidepooluserid.yaml'
305+
- $ref: '#/components/parameters/userId'
283306
get:
284307
operationId: GetSentInvitations
285308
summary: Get Pending Care Team Invitations
@@ -304,7 +327,7 @@ paths:
304327

305328
'/confirm/invitations/{userId}':
306329
parameters:
307-
- $ref: './common/parameters/tidepooluserid.yaml'
330+
- $ref: '#/components/parameters/userId'
308331
get:
309332
operationId: GetReceivedInvitations
310333
summary: Get Received Care Team Invitations
@@ -325,8 +348,8 @@ paths:
325348

326349
'/confirm/dismiss/invite/{userId}/{invitedBy}':
327350
parameters:
328-
- $ref: './common/parameters/tidepooluserid.yaml'
329-
- $ref: './confirm/parameters/invitedbyuser.v1.yaml'
351+
- $ref: '#/components/parameters/userId'
352+
- $ref: '#/components/parameters/invitedByUser'
330353
put:
331354
operationId: DismissInvite
332355
summary: Dismiss Care Team Invitation
@@ -352,8 +375,8 @@ paths:
352375

353376
'/confirm/{userId}/invited/{invitedBy}':
354377
parameters:
355-
- $ref: './common/parameters/tidepooluserid.yaml'
356-
- $ref: './confirm/parameters/invitedbyemail.v1.yaml'
378+
- $ref: '#/components/parameters/userId'
379+
- $ref: '#/components/parameters/invitedByEmail'
357380
put:
358381
operationId: CancelInvite
359382
summary: Cancel Care Team Invitation
@@ -374,6 +397,50 @@ paths:
374397
- sessionToken: []
375398

376399
components:
400+
schemas:
401+
Acceptance:
402+
$ref: './confirm/models/acceptance.v1.yaml'
403+
404+
TidepoolUserId:
405+
$ref: './common/models/tidepooluserid.yaml'
406+
407+
ClinicId:
408+
$ref: './clinic/models/clinicid.v1.yaml'
409+
410+
EmailAddress:
411+
$ref: ./common/models/emailaddress.v1.yaml
412+
413+
DateTime:
414+
$ref: ./common/models/datetime.v1.yaml
415+
416+
Key:
417+
$ref: ./confirm/models/key.v1.yaml
418+
419+
Password:
420+
$ref: ./common/models/password.v1.yaml
421+
422+
Birthday:
423+
$ref: './common/models/birthday.v1.yaml'
424+
425+
Confirmation:
426+
$ref: ./confirm/models/confirmation.v1.yaml
427+
428+
parameters:
429+
userId:
430+
$ref: './common/parameters/tidepooluserid.yaml'
431+
432+
email:
433+
$ref: './confirm/parameters/email.v1.yaml'
434+
435+
key:
436+
$ref: './confirm/parameters/key.v1.yaml'
437+
438+
invitedByUser:
439+
$ref: './confirm/parameters/invitedbyuser.v1.yaml'
440+
441+
invitedByEmail:
442+
$ref: './confirm/parameters/invitedbyemail.v1.yaml'
443+
377444
securitySchemes:
378445
sessionToken:
379446
$ref: './common/security/tidepoolsessiontoken.v1.yaml'
@@ -385,6 +452,12 @@ components:
385452
schema:
386453
$ref: './confirm/models/lookup.v1.yaml'
387454

455+
ConfirmationUpsert:
456+
content:
457+
'application/json':
458+
schema:
459+
$ref: './confirm/models/upsert.v1.yaml'
460+
388461
responses:
389462
Confirmation:
390463
description: 'Single confirmation'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Confirmation Lookup
2+
type: object
3+
properties:
4+
clinicId:
5+
$ref: '../../clinic/models/clinicid.v1.yaml'
6+
invitedBy:
7+
$ref: '../../common/models/tidepooluserid.yaml'

0 commit comments

Comments
 (0)