Skip to main content
POST
/
medical
/
v1
/
patient
/
{id}
/
cohort
Add Patient to Cohorts
curl --request POST \
  --url https://api.sandbox.metriport.com/medical/v1/patient/{id}/cohort \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "cohortIds": [
    "<string>"
  ]
}
'
import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriport = new MetriportMedicalApi("YOUR_API_KEY");

const patientId = "00000000-0000-0000-0000-000000000000";
const result = await metriport.addPatientToCohorts(patientId, {
  cohortIds: [
    "00000000-0000-0000-0000-000000000000", 
    "11111111-1111-1111-1111-111111111111"
  ]
});

Documentation Index

Fetch the complete documentation index at: https://docs.metriport.com/llms.txt

Use this file to discover all available pages before exploring further.

For more information, see the guide about Cohorts

Path Params

id
string
required
The ID of the patient to add to cohorts.

Body

cohortIds
string[]
required
Array of cohort IDs to add the patient to.

Response

cohorts
Cohort[]
required
Array of cohorts the patient is currently associated with.
import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriport = new MetriportMedicalApi("YOUR_API_KEY");

const patientId = "00000000-0000-0000-0000-000000000000";
const result = await metriport.addPatientToCohorts(patientId, {
  cohortIds: [
    "00000000-0000-0000-0000-000000000000", 
    "11111111-1111-1111-1111-111111111111"
  ]
});
{
  "cohorts": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "eTag": "1",
      "name": "High Risk",
      "description": "Patients that need frequent and robust monitoring.",
      "color": "red",
      "settings": {
        "monitoring": {
          "hie": {
            "enabled": true,
            "frequency": "weekly"
          },
          "adt": {
            "enabled": true
          },
          "pharmacy": {
            "notifications": true,
            "schedule": {
              "enabled": false,
              "frequency": "monthly"
            }
          },
          "laboratory": {
            "notifications": true
          }
        }
      },
      "size": 150
    },
    {
      "id": "11111111-1111-1111-1111-111111111111",
      "eTag": "1",
      "name": "Cardiac Care Cohort",
      "description": "Patients receiving cardiac care and monitoring",
      "color": "blue",
      "settings": {
        "monitoring": {
          "hie": {
            "enabled": true,
            "frequency": "weekly"
          },
          "adt": {
            "enabled": true
          },
          "pharmacy": {
            "notifications": true,
            "schedule": {
              "enabled": false,
              "frequency": "monthly"
            }
          },
          "laboratory": {
            "notifications": false
          }
        }
      },
      "size": 75
    }
  ]
}

Notes

  • If the patient is already in some of the specified cohorts, those will be skipped (no error thrown)