Skip to content
143 changes: 139 additions & 4 deletions reference/clinic.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,16 @@ paths:
description: Comma-separated list of patient tag IDs
style: form
explode: false
- name: sites
schema:
type: array
items:
type: string
format: '^[a-f0-9]{24}$'
in: query
description: Comma-separated list of clinic site IDs
style: form
explode: false
description: Retrieve a list of patients of a clinic
post:
summary: Create Patient Account
Expand Down Expand Up @@ -935,7 +945,11 @@ paths:
operationId: CreatePatientTag
responses:
'200':
description: OK
description: The newly-created patient tag
content:
application/json:
schema:
$ref: ./clinic/models/patientTag.v1.yaml
description: Create a new patient tag
requestBody:
content:
Expand All @@ -944,6 +958,80 @@ paths:
$ref: '#/components/schemas/patientTag.v1'
tags:
- Clinics
'/v1/clinics/{clinicId}/sites':
parameters:
- $ref: '#/components/parameters/clinicId'
post:
summary: Create a Site
operationId: CreateSite
responses:
'200':
description: The newly-created clinic site
content:
application/json:
schema:
$ref: ./clinic/models/site.v1.yaml
description: Create a Site
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/siteCreation.v1'
tags:
- Clinics
'/v1/clinics/{clinicId}/sites/{siteId}':
parameters:
- $ref: '#/components/parameters/clinicId'
- $ref: '#/components/parameters/siteId'
put:
summary: Update a Site
operationId: UpdateSite
responses:
'200':
description: The updated clinic site
content:
application/json:
schema:
$ref: ./clinic/models/site.v1.yaml
description: Update a Site
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/site.v1'
tags:
- Clinics
delete:
summary: Delete a Site
operationId: DeleteSite
responses:
'204':
description: No content
description: 'Delete a Site'
tags:
- Clinics
'/v1/clinics/{clinicId}/sites/{siteId}/merge':
parameters:
- $ref: '#/components/parameters/clinicId'
- $ref: '#/components/parameters/siteId'
post:
summary: Merge two sites
operationId: MergeSite
responses:
'200':
description: The merged clinic site
content:
application/json:
schema:
$ref: ./clinic/models/site.v1.yaml
description: Merge a site, identified in the request body, into the site identified in the URL.
requestBody:
content:
application/json:
schema:
$ref: ./clinic/models/siteById.v1.yaml
tags:
- Clinics
'/v1/clinics/{clinicId}/clinicians/{clinicianId}':
parameters:
- $ref: '#/components/parameters/clinicId'
Expand Down Expand Up @@ -1055,7 +1143,11 @@ paths:
operationId: UpdatePatientTag
responses:
'200':
description: OK
description: The updated patient tag
content:
application/json:
schema:
$ref: ./clinic/models/patientTag.v1.yaml
description: Update existing patient tag
tags:
- Clinics
Expand All @@ -1068,11 +1160,30 @@ paths:
summary: Delete Patient Tag
operationId: DeletePatientTag
responses:
'200':
description: OK
'204':
description: No content
description: Removes a patient tag from a clinic and tagged patients
tags:
- Clinics
'/v1/clinics/{clinicId}/patient_tags/{patientTagId}/site':
parameters:
- $ref: '#/components/parameters/clinicId'
- $ref: '#/components/parameters/patientTagId'
post:
summary: Convert Patient Tag to Site
operationId: ConvertPatientTagToSite
responses:
'200':
description: The newly converted site.
content:
application/json:
schema:
$ref: ./clinic/models/site.v1.yaml
'409':
description: Cannot convert the tag to a site. This could occur for example when the maximum number of sites has already been reached.
description: Convert a patient tag to a site.
tags:
- Clinics
'/v1/clinics/{clinicId}/invites/clinicians':
parameters:
- $ref: '#/components/parameters/clinicId'
Expand Down Expand Up @@ -2167,6 +2278,10 @@ components:
type: array
items:
$ref: ./clinic/models/dataSource.v1.yaml
site.v1:
$ref: ./clinic/models/site.v1.yaml
siteCreation.v1:
$ref: ./clinic/models/siteCreation.v1.yaml
tidepoolUserIds.v1:
type: array
nullable: true
Expand Down Expand Up @@ -2218,6 +2333,13 @@ components:
minLength: 1
tags:
$ref: ./clinic/models/patientTagIds.v1.yaml
sites:
type: array
x-go-type-skip-optional-pointer: true
x-omitempty: false
x-omitzero: true
items:
$ref: ./clinic/models/site.v1.yaml
associateClinicianToUser.v1:
title: Associate Clinician
type: object
Expand Down Expand Up @@ -2409,6 +2531,13 @@ components:
minLength: 1
tags:
$ref: ./clinic/models/patientTagIds.v1.yaml
sites:
type: array
x-go-type-skip-optional-pointer: true
x-omitempty: false
x-omitzero: true
items:
$ref: ./clinic/models/site.v1.yaml
addServiceAccount.v1:
title: AddServiceAccount
x-stoplight:
Expand Down Expand Up @@ -2530,6 +2659,12 @@ components:
schema:
type: string
pattern: '^[a-f0-9]{24}$'
siteId:
name: siteId
in: path
required: true
schema:
$ref: ./clinic/models/siteId.v1.yaml
userId:
name: userId
in: path
Expand Down
5 changes: 5 additions & 0 deletions reference/clinic/models/clinic.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ properties:
type: array
items:
$ref: ./patientTag.v1.yaml
sites:
type: array
x-go-type-skip-optional-pointer: true
items:
$ref: ./site.v1.yaml
lastDeletedPatientTag:
$ref: ./patientTag.v1.yaml
phoneNumbers:
Expand Down
7 changes: 7 additions & 0 deletions reference/clinic/models/patient.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ properties:
id: 502rliv0l2tyy
description: Requests for each provider are listed in reverse chronological order
readOnly: true
sites:
type: array
x-go-type-skip-optional-pointer: true
x-omitempty: false
x-omitzero: true
items:
$ref: ./site.v1.yaml
required:
- id
- fullName
Expand Down
11 changes: 11 additions & 0 deletions reference/clinic/models/site.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
title: Site
description: "A clinic's physical or logical location."
properties:
id:
$ref: ./siteId.v1.yaml
name:
$ref: ./siteName.v1.yaml
required:
- id
- name
8 changes: 8 additions & 0 deletions reference/clinic/models/siteById.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
title: SiteById
description: "A clinic's physical or logical location—id only."
properties:
id:
$ref: ../../../reference/common/models/objectid.v1.yaml
required:
- id
8 changes: 8 additions & 0 deletions reference/clinic/models/siteCreation.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
title: Site
description: "A clinic's physical or logical location."
properties:
name:
$ref: ./siteName.v1.yaml
required:
- name
6 changes: 6 additions & 0 deletions reference/clinic/models/siteId.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Site id is a mongodb objectid, but not a pointer (like objectid.v1.yaml).
allOf:
- $ref: ../../common/models/objectid.v1.yaml
- x-go-type-skip-optional-pointer: true
x-go-type: string # otherwise oapi-codegen will generate interface{}
readOnly: true # can't merge with objectid without this matching
6 changes: 6 additions & 0 deletions reference/clinic/models/siteIds.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: array
title: Site ID List
uniqueItems: true
nullable: true
items:
$ref: ./siteId.v1.yaml
6 changes: 6 additions & 0 deletions reference/clinic/models/siteName.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: string
x-go-type-skip-optional-pointer: true
description: The site's name.
minLength: 1
maxLength: 200
pattern: '^[[:graph:]\p{L}\p{N}][[:graph:]\p{L}\p{N} ]*$'