NAV Navbar
Logo cerner
Ruby Shell

Cohort API v1

A cohort is a subgroup of patients within a population who are grouped together based on a shared clinical or demographic characteristic or set of characteristics. A cohort can be created using an algorithm that processes information on patients’ longitudinal records or by running set operations on other cohorts. For example, one cohort could be defined as all patients with a Medicaid benefit plan, a second could be defined as all patients with a diabetes diagnosis, and a third that consists of only diabetic Medicaid patients could be defined by intersecting the first two cohorts.

URL: https://cernerdemo.api.us.healtheintent.com/cohort/v1

Algorithms

Algorithms are the sets of characteristics used to form cohorts. Algorithms are created and managed internally by Cerner.

Retrieve a List of Algorithms

Example Request:


require 'httparty' # Using HTTParty 0.16.2
require 'json'

headers = {
  'Authorization' => '<auth_header>',
  'Accept' => 'application/json'
}

result = HTTParty.get('https://cernerdemo.api.us.healtheintent.com/cohort/v1/algorithms', headers: headers)

print JSON.pretty_generate(result)


# You can also use wget
curl -X GET https://cernerdemo.api.us.healtheintent.com/cohort/v1/algorithms \
-H 'Authorization: {auth_header}' \
-H 'Accept: application/json'

Example response

{
  "items": [
    {
      "id": "ecb8026a-64f9-11e8-adc0-fa7ae01bbebc",
      "name": "Cerner Standard 2017 Emergency Visit in Prior Two Measurement Periods Cohort",
      "description": "This cohort includes all the people in the population who have an emergency visit during the current or prior two measurement periods.",
      "version": "1.0.0"
    }
  ],
  "totalResults": 1,
  "firstLink": "https://cernerdemo.api.us.healtheintent.com/cohort/v1/algorithms?offset=0&limit=20",
  "lastLink": "https://cernerdemo.api.us.healtheintent.com/cohort/v1/algorithms?offset=0&limit=20"
}

GET /algorithms

Retrieves a paginated list of algorithms that are sorted by version.

Parameters

Parameter In Type Required Default Description Accepted Values
name query string false N/A The name of the algorithm. The full name must be specified, but the parameter is case-insensitive. -
offset query integer(int32) false 0 The number of results to skip from the beginning of the list of results (typically for the purpose of paging). The minimum offset is 0. There is no maximum offset. -
limit query integer(int32) false 20 The maximum number of results to display per page. The minimum limit is 1. The maximum limit is 100. -

Response Statuses

Status Meaning Description Schema
200 OK OK Algorithm
400 Bad Request Bad Request Error
401 Unauthorized Unauthorized Error
403 Forbidden Forbidden Error

Algorithm Version

Each algorithm is immutable, and new versions are published when updates are made.

Retrieve a Single Algorithm Version

Example Request:


require 'httparty' # Using HTTParty 0.16.2
require 'json'

headers = {
  'Authorization' => '<auth_header>',
  'Accept' => 'application/json'
}

result = HTTParty.get('https://cernerdemo.api.us.healtheintent.com/cohort/v1/algorithms/227ee4f0-6508-11e8-adc0-fa7ae01bbebc/versions/1.1.0-SNAPSHOT', headers: headers)

print JSON.pretty_generate(result)


# You can also use wget
curl -X GET https://cernerdemo.api.us.healtheintent.com/cohort/v1/algorithms/227ee4f0-6508-11e8-adc0-fa7ae01bbebc/versions/1.1.0-SNAPSHOT \
-H 'Authorization: {auth_header}' \
-H 'Accept: application/json'

Example response

{
  "name": "Cerner Standard 2017 Outpatient Visit in Current Measurement Period Cohort",
  "description": "This cohort includes all the people in the population who have an outpatient visit during the current measurement period.",
  "parameters": [
    {
      "key": "cs2017-outpatient-visit-current-measurement-period-cohort/cohort-end-date",
      "valueType": "ISO_8601_STRING",
      "name": "cohort-end-date",
      "description": "The end date of the measurement period.",
      "required": false
    }
  ]
}

GET /algorithms/{algorithmId}/versions/{id}

Retrieves a single version of the algorithm.

Parameters

Parameter In Type Required Default Description Accepted Values
algorithmId path string true N/A The unique ID of the algorithm. -
id path string true N/A The version of the algorithm. -

Response Statuses

Status Meaning Description Schema
200 OK OK AlgorithmVersion
401 Unauthorized Unauthorized Error
403 Forbidden Forbidden Error
404 Not Found Not Found Error

Schema Definitions

Algorithm

Name Type Required Description Accepted Values
id string true The unique ID of the algorithm. -
name string true The name of the algorithm. -
description string false The description of the algorithm. -
version string true The version of the algorithm. Algorithms are created and managed internally by Cerner. Each algorithm is immutable, and new versions are published when updates are made. -

Error

Name Type Required Description Accepted Values
code integer(int32) true Http response status code representing the error. -
message string true Human readable description of the error. -
errorDetails [ErrorDetail] false List of additional error details. -

ErrorDetail

Name Type Required Description Accepted Values
domain string false A subsystem or context where an error occurred. -
reason string false Codified value representing the specific error resulting in the current error status. -
message string false Human readable description of an error. -
locationType string false Location or type of the field that caused an error. query, header, path, formData, body
location string false Name of the field that caused an error. -

AlgorithmVersion

Name Type Required Description Accepted Values
name string true The name of the algorithm. -
description string false The description of the algorithm. -
parameters AlgorithmParameter false The parameters used to change the default behavior of the algorithm. -

AlgorithmParameter

Name Type Required Description Accepted Values
key string true The unique key that identifies the parameter. -
valueType string true The type of the parameter value. -
name string true The name of the parameter. -
description string false The description of the parameter. -
required boolean true Denotes whether the parameter is required. -