Plans
NOTE
Replace <base_url>
from the examples below with one of the following:
Environment | Base URL |
---|---|
Production | https://api.cirrusmd.com |
Sandbox | https://api-sandbox.cirrusmd.com |
Get All Plans
This endpoint retrieves all of your plans
Request URL
GET <base_url>/v2/plans
Optional Query Parameters
Parameter | Description |
---|---|
external_id | Optional, The external_id of the plan |
Example Request for All Plans
curl "<base_url>/v2/plans"
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Example Request for a Single Plan By Plan ID
curl "<base_url>/v2/plans/:plan_id"
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Example Request for Single Plan By External ID
curl "<base_url>/v2/plans?external_id=abcdeg"
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Example Response
{
"links": {
"self": "<base_url>/v2/plans"
},
"data": [
{
"id":1,
"type": "plans",
"external_id": "abcefg",
"name":"Plan 1",
"description":"Urgent Care",
"active":true,
"created_at":"2016-09-28T23:33:32Z",
"provider_group": {
"id": 2,
"type": "provider_groups",
"name": "Family Practice",
"external_id": null,
"created_at":"2016-09-28T23:33:32Z"
},
"queue_info": {
"estimated_wait_time": 120,
"queue_length": 5,
"is_active": true
}
}...
]
}
Example Response Properties
Name | Type | Description | Required |
---|---|---|---|
id |
Integer | Primary ID of the Plan with CirrusMD |
✔️ |
type |
String | The polymorphic type of the resource. Is always “plans” for a Plan |
✔️ |
external_id |
String | Primary ID of the Plan outside of CirrusMD |
✔️ |
name |
String | Name of the Plan |
✔️ |
description |
String | Optional description of the Plan |
|
active |
Boolean | Whether or not this Plan is accepting patients. Not to be confused with queue_info.is_active , which is representative of the Plan ’s queue being actively serviced by assigned staff. |
✔️ |
created_at |
ISO8601 | Time at which the plan was created with CirrusMD | ✔️ |
provider_group |
Provider Group Object | Provider Group Object | ✔️ |
queue_info |
PlanQueueInfo |
||
queue_info.estimated_wait_time |
Integer | Estimated wait time, in seconds, for a new patient to reach a doctor if they join the queue. If there are no active doctors for the Plan , this value will be -1 |
✔️ |
queue_info.queue_length |
Integer | Number of waiting patients currently in the queue for this Plan |
✔️ |
queue_info.is_active |
Boolean | Whether or not any doctors are on duty right now for this Plan . |
✔️ |
queue_info.cache_info |
PlanQueueInfoCacheInfo |
||
queue_info.cache_info.ttl |
Integer | The time-to-live used when storing cached values, in seconds | ✔️ |
queue_info.cache_info.expires_at |
ISO8601 | The timestamp at which this cached value expires | ✔️ |
Update a Plan
This endpoint allows you to update some attributes for a plan
Request URL
PATCH <base_url>/v2/plans/:plan_id
URL Parameters
Parameter | Description |
---|---|
plan_id | Required, The CirrusMD plan id. |
Example Request
curl -X PATCH "<base_url>/v2/plans/:plan_id"
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"name": "St Vincents", description: "St Vs Urgent Care Diversion Program, "external_id": "abcdef12345" }'
Example Response
{
"links": {
"self": "<base_url>/v2/plans/1"
},
"data": [
{
"id":1,
"type": "plans",
"external_id": "abcefg",
"name":"Plan 1",
"description":"Urgent Care",
"active":true,
"created_at":"2016-09-28T23:33:32Z",
"provider_group": {
"id": 2,
"type": "provider_groups",
"name": "Family Practice",
"external_id": null,
"created_at":"2016-09-28T23:33:32Z"
}
}...
]
}