From ed564d9e19a22f47dbdb86881f9df010f6995f4c Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Tue, 16 Jul 2024 00:52:36 +0000 Subject: [PATCH 1/6] add lastreviewed api --- reference/clinic.v1.yaml | 40 ++++++++++++++++++- reference/clinic/models/patient.v1.yaml | 4 ++ .../clinic/models/patientlastreviewed.v1.yaml | 9 +++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 reference/clinic/models/patientlastreviewed.v1.yaml diff --git a/reference/clinic.v1.yaml b/reference/clinic.v1.yaml index 3610dd55..2fa3b306 100644 --- a/reference/clinic.v1.yaml +++ b/reference/clinic.v1.yaml @@ -1176,6 +1176,42 @@ paths: application/json: schema: $ref: '#/components/schemas/AcceptPatientInvitation' + '/v1/clinics/{clinicId}/patients/{patientId}/last_reviewed': + parameters: + - $ref: '#/components/parameters/clinicId' + - $ref: '#/components/parameters/patientId' + put: + summary: Update Patient LastReviewed + operationId: UpdatePatientLastReviewed + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PatientLastReviewed' + description: |- + Update the patient's last reviewed date and clinician ID + tags: + - Clinics + delete: + summary: Revert Patient LastReviewed + operationId: RevertPatientLastReviewed + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PatientLastReviewed' + '409': + description: Cannot revert a different clinician's review + '424': + description: No previous review to revert to + description: |- + Revert the patient's last reviewed date to the previous set + tags: + - Clinics '/v1/clinics/{clinicId}/patients/{patientId}/permissions': parameters: - $ref: '#/components/parameters/clinicId' @@ -1189,7 +1225,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PatientPermissions' + $ref: '#/components/schemas/PatientLastReviewed' description: |- Update permissions that a clinic has over a patient account. If all permissions are revoked as a result of the update, the patient profile will be removed from the clinic. @@ -2253,6 +2289,8 @@ components: $ref: ./summary/models/dates.v1.yaml PatientSummary: $ref: ./clinic/models/summaries/patientsummary.v1.yaml + PatientLastReviewed: + $ref: "./clinic/models/patientlastreviewed.v1.yaml" FloatFilter: type: string pattern: ^(>=|>|<=|<)[+-]?((\d+(\.\d*)?)|(\.\d+))$ diff --git a/reference/clinic/models/patient.v1.yaml b/reference/clinic/models/patient.v1.yaml index 319f2549..bd641699 100644 --- a/reference/clinic/models/patient.v1.yaml +++ b/reference/clinic/models/patient.v1.yaml @@ -53,6 +53,10 @@ properties: readOnly: true summary: $ref: ./summaries/patientsummary.v1.yaml + lastReviewed: + $ref: "./patientlastreviewed.v1.yaml" + previousLastReviewed: + $ref: "./patientlastreviewed.v1.yaml" required: - id - fullName diff --git a/reference/clinic/models/patientlastreviewed.v1.yaml b/reference/clinic/models/patientlastreviewed.v1.yaml new file mode 100644 index 00000000..11ccb154 --- /dev/null +++ b/reference/clinic/models/patientlastreviewed.v1.yaml @@ -0,0 +1,9 @@ +type: object +title: lastreviewed.v1 +description: A summary of a patients recent data +properties: + clinicianId: + $ref: ../../common/models/tidepooluserid.yaml + time: + type: string + format: date-time \ No newline at end of file From e95b07d973ef3e374721fbf663ef3dafe79067fa Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Wed, 17 Jul 2024 00:05:28 +0000 Subject: [PATCH 2/6] add lastReviewed --- reference/clinic.v1.yaml | 12 ++++++++++-- reference/clinic/models/patientlastreviewed.v1.yaml | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/reference/clinic.v1.yaml b/reference/clinic.v1.yaml index 2fa3b306..29064e67 100644 --- a/reference/clinic.v1.yaml +++ b/reference/clinic.v1.yaml @@ -1189,7 +1189,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PatientLastReviewed' + $ref: '#/components/schemas/PatientLastReviewedDetails' description: |- Update the patient's last reviewed date and clinician ID tags: @@ -1203,7 +1203,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PatientLastReviewed' + $ref: '#/components/schemas/PatientLastReviewedDetails' '409': description: Cannot revert a different clinician's review '424': @@ -2291,6 +2291,14 @@ components: $ref: ./clinic/models/summaries/patientsummary.v1.yaml PatientLastReviewed: $ref: "./clinic/models/patientlastreviewed.v1.yaml" + PatientLastReviewedDetails: + title: PatientLastReviewedDetails + type: object + properties: + lastReviewed: + $ref: "#/components/schemas/PatientLastReviewed" + previousLastReviewed: + $ref: "#/components/schemas/PatientLastReviewed" FloatFilter: type: string pattern: ^(>=|>|<=|<)[+-]?((\d+(\.\d*)?)|(\.\d+))$ diff --git a/reference/clinic/models/patientlastreviewed.v1.yaml b/reference/clinic/models/patientlastreviewed.v1.yaml index 11ccb154..e41d289a 100644 --- a/reference/clinic/models/patientlastreviewed.v1.yaml +++ b/reference/clinic/models/patientlastreviewed.v1.yaml @@ -3,7 +3,10 @@ title: lastreviewed.v1 description: A summary of a patients recent data properties: clinicianId: - $ref: ../../common/models/tidepooluserid.yaml + type: string time: type: string - format: date-time \ No newline at end of file + format: date-time +required: + - clinicianId + - time \ No newline at end of file From 5a692fecbd775445b7b7ce9c41d51ff530c445f7 Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Fri, 19 Jul 2024 04:14:30 +0000 Subject: [PATCH 3/6] adjust patient reviews to array --- reference/clinic.v1.yaml | 36 +++++++++---------- reference/clinic/models/patient.v1.yaml | 10 +++--- ...reviewed.v1.yaml => patientreview.v1.yaml} | 2 +- 3 files changed, 23 insertions(+), 25 deletions(-) rename reference/clinic/models/{patientlastreviewed.v1.yaml => patientreview.v1.yaml} (88%) diff --git a/reference/clinic.v1.yaml b/reference/clinic.v1.yaml index 29064e67..3eaad558 100644 --- a/reference/clinic.v1.yaml +++ b/reference/clinic.v1.yaml @@ -1176,38 +1176,38 @@ paths: application/json: schema: $ref: '#/components/schemas/AcceptPatientInvitation' - '/v1/clinics/{clinicId}/patients/{patientId}/last_reviewed': + '/v1/clinics/{clinicId}/patients/{patientId}/reviews': parameters: - $ref: '#/components/parameters/clinicId' - $ref: '#/components/parameters/patientId' put: - summary: Update Patient LastReviewed - operationId: UpdatePatientLastReviewed + summary: Update Patient Reviews + operationId: UpdatePatientReviews responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PatientLastReviewedDetails' + $ref: '#/components/schemas/PatientReviews' description: |- Update the patient's last reviewed date and clinician ID tags: - Clinics delete: - summary: Revert Patient LastReviewed - operationId: RevertPatientLastReviewed + summary: Delete Patient Reviews + operationId: DeletePatientReviews responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PatientLastReviewedDetails' + $ref: '#/components/schemas/PatientReviews' '409': description: Cannot revert a different clinician's review - '424': - description: No previous review to revert to + '404': + description: No review to delete description: |- Revert the patient's last reviewed date to the previous set tags: @@ -1225,7 +1225,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PatientLastReviewed' + $ref: '#/components/schemas/PatientReviews' description: |- Update permissions that a clinic has over a patient account. If all permissions are revoked as a result of the update, the patient profile will be removed from the clinic. @@ -2289,16 +2289,12 @@ components: $ref: ./summary/models/dates.v1.yaml PatientSummary: $ref: ./clinic/models/summaries/patientsummary.v1.yaml - PatientLastReviewed: - $ref: "./clinic/models/patientlastreviewed.v1.yaml" - PatientLastReviewedDetails: - title: PatientLastReviewedDetails - type: object - properties: - lastReviewed: - $ref: "#/components/schemas/PatientLastReviewed" - previousLastReviewed: - $ref: "#/components/schemas/PatientLastReviewed" + PatientReview: + $ref: "./clinic/models/patientreview.v1.yaml" + PatientReviews: + type: array + items: + $ref: "#/components/schemas/PatientReview" FloatFilter: type: string pattern: ^(>=|>|<=|<)[+-]?((\d+(\.\d*)?)|(\.\d+))$ diff --git a/reference/clinic/models/patient.v1.yaml b/reference/clinic/models/patient.v1.yaml index bd641699..9838f52f 100644 --- a/reference/clinic/models/patient.v1.yaml +++ b/reference/clinic/models/patient.v1.yaml @@ -53,10 +53,12 @@ properties: readOnly: true summary: $ref: ./summaries/patientsummary.v1.yaml - lastReviewed: - $ref: "./patientlastreviewed.v1.yaml" - previousLastReviewed: - $ref: "./patientlastreviewed.v1.yaml" + reviews: + type: array + nullable: true + x-go-type-skip-optional-pointer: true + items: + $ref: "./patientreview.v1.yaml" required: - id - fullName diff --git a/reference/clinic/models/patientlastreviewed.v1.yaml b/reference/clinic/models/patientreview.v1.yaml similarity index 88% rename from reference/clinic/models/patientlastreviewed.v1.yaml rename to reference/clinic/models/patientreview.v1.yaml index e41d289a..ce062688 100644 --- a/reference/clinic/models/patientlastreviewed.v1.yaml +++ b/reference/clinic/models/patientreview.v1.yaml @@ -1,5 +1,5 @@ type: object -title: lastreviewed.v1 +title: patientreview.v1 description: A summary of a patients recent data properties: clinicianId: From 41af9687409ffb5e9dd2a421df84e44a915a30e7 Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Fri, 19 Jul 2024 15:11:51 +0000 Subject: [PATCH 4/6] add reviews to tide --- reference/clinic/models/tide/patient.v1.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/clinic/models/tide/patient.v1.yaml b/reference/clinic/models/tide/patient.v1.yaml index 53d2355b..eef5c2df 100644 --- a/reference/clinic/models/tide/patient.v1.yaml +++ b/reference/clinic/models/tide/patient.v1.yaml @@ -14,6 +14,12 @@ properties: minLength: 1 tags: $ref: ../patienttagids.v1.yaml + reviews: + type: array + nullable: true + x-go-type-skip-optional-pointer: true + items: + $ref: "../patientreview.v1.yaml" required: - id From 5c510aa44a4a27b712cbb579a129f09689047dc3 Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Fri, 19 Jul 2024 17:16:05 +0000 Subject: [PATCH 5/6] add lastReviewed filtering --- reference/clinic.v1.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/clinic.v1.yaml b/reference/clinic.v1.yaml index 3eaad558..3d4efad3 100644 --- a/reference/clinic.v1.yaml +++ b/reference/clinic.v1.yaml @@ -315,6 +315,12 @@ paths: name: offsetPeriods required: false description: 'If we should display, filter, and sort based on the offset periods or default periods' + - schema: + type: string + format: date-time + in: query + name: lastReviewed + description: Inclusive - schema: $ref: '#/components/schemas/FloatFilter' in: query From b0f7ef92d694694c21b7a11377e43c8c43c36c6b Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Tue, 23 Jul 2024 18:30:47 +0000 Subject: [PATCH 6/6] modify patient list and TIDE to support lastData instead of lastUploadDate --- reference/clinic.v1.yaml | 12 ++++++------ reference/clinic/models/tide/config.v1.yaml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/clinic.v1.yaml b/reference/clinic.v1.yaml index 3d4efad3..0c4bb766 100644 --- a/reference/clinic.v1.yaml +++ b/reference/clinic.v1.yaml @@ -267,13 +267,13 @@ paths: type: string format: date-time in: query - name: cgm.lastUploadDateFrom + name: cgm.lastDataFrom description: Inclusive - schema: type: string format: date-time in: query - name: cgm.lastUploadDateTo + name: cgm.lastDataTo description: Exclusive '/v1/clinics/{clinicId}/patients': parameters: @@ -756,13 +756,13 @@ paths: type: string format: date-time in: query - name: cgm.lastUploadDateFrom + name: cgm.lastDataFrom description: Inclusive - schema: type: string format: date-time in: query - name: cgm.lastUploadDateTo + name: cgm.lastDataTo description: Exclusive - schema: @@ -860,13 +860,13 @@ paths: type: string format: date-time in: query - name: bgm.lastUploadDateFrom + name: bgm.lastDataFrom description: Inclusive - schema: type: string format: date-time in: query - name: bgm.lastUploadDateTo + name: bgm.lastDataTo description: Exclusive - schema: type: array diff --git a/reference/clinic/models/tide/config.v1.yaml b/reference/clinic/models/tide/config.v1.yaml index 0c3aeb36..7f7e6e63 100644 --- a/reference/clinic/models/tide/config.v1.yaml +++ b/reference/clinic/models/tide/config.v1.yaml @@ -12,10 +12,10 @@ properties: type: string pattern: ^(1d|7d|14d|30d)$ example: 7d - lastUploadDateFrom: + lastDataFrom: type: string format: date-time - lastUploadDateTo: + lastDataTo: type: string format: date-time highGlucoseThreshold: @@ -43,8 +43,8 @@ required: - schemaVersion - clinicId - period - - lastUploadDateFrom - - lastUploadDateTo + - lastDataDateFrom + - lastDataDateTo - highGlucoseThreshold - veryHighGlucoseThreshold - lowGlucoseThreshold