Extract Clinical Information Using Saved Cohort List and Save Cohort List for Specific Patient Group

This use case describes how to extract clinical information using saved cohort lists and then save the cohort list for specific group of patients.

Use Case

I have an existing cohort list and I want to extract condition (diagnosis), observation and demographics. Finally, create a cohort list for patients having observation of certain type and on certain dates.

Step 1: Retrieve Saved Cohort Lists

This API retrieves a list of cohort lists existing in the system. For details, see the Retrieve Saved Cohort Lists endpoint.

Request URL

http://localhost:7001/HSDataService-web/api/3.2.0/cohortlists

Request Type

GET

JSON Response

{
  "resourceType": "CohortLists",
  "items": [
    {
      "cohortListId": 10000000002102,
      "cohortListName": "TestList_1",
      "cohortListDescription": "Changed List",
      "contextFlag": "PATIENT",
      "privacy": "PRIVATE",
      "createdDate": "12/05/2016",
      "ownedBy": "tester",
      "cohortListDetails": {
        "reference": "/HSDataService-web/api/3.2.0/cohortlists/10000000002102"
      }
    }
  ],
  "count": 1,
  "hasMore": true,
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:9010/HSDataService-web/api/3.2.0/cohortlists"
    }
  ]
}

Step 2: Retrieve Cohort List Members for Cohort List Identifier

This API fetches the Cohort List Members for Cohort List Identifier (10000000002102) retrieved in Step 1. For details, see the Retrieve Cohort List Members for a Cohort List Identifier endpoint.

Request URL

http://localhost:7001/HSDataService-web/api/3.2.0/cohortlists/10000000002102

Request Type

GET

JSON Response

{
  "resourceType" : "CohortListMembers",
  "items" : [ {
    "patientWid" : 808
  }, {
    "patientWid" : 810
  }
, {
    "patientWid" : 816
  }
 ],
  "count" : 3,
  "hasMore" : false,
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:7001/HSDataService-web/api/3.2.0/cohortlists/10000000002102"
  } ]
}

Step 3a: Retrieve Observations for Patient IDs

This API fetches the Observations for Patient IDs (808 and 816) retrieved in Step 2. For details, see the Retrieve Observations for Patient Identifiers endpoint.

Request URL

http://localhost:7001/HSDataService-web/api/3.2.0/patientapi/observations?id=808&id=816

Request Type

GET

JSON Response

{
  "resourceType" : "Observation",
  "items" : [ {
    "identifier" : {
      "system" : "CDM",
      "value" : "5012"
    },
    "category" : {
      "coding" : [ {
        "code" : "OBSV_CD_SET_3",
        "display" : "OBSERVATION CD SET3",
        "description" : "OBSERVATION CD SET3"
      } ]
    },
    "code" : {
      "coding" : [ {
        "code" : "OBSV_CD_NRSNG_DLY_ASSMT1",
        "display" : "OBSV_CD_NRSNG_DLY_ASSMT1 ",
        "description" : "Nursing Daily Assessment",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "1"
      } ]
    },
    "patient" : {
      "reference" : "/HSDataService-web/api/3.2.0/patientapi/patients/808"
    },
    "encounter" : {
      "identifier" : {
        "system" : "CDM",
        "value" : "ENC101"
      },
      "type" : {
        "coding" : [ {
          "code" : "ENC_SUBTYP_ER_VST",
          "display" : "Er Visit",
          "description" : "A visit to the emergency department of a hospital ",
          "sysId" : "EHA_CUSTOM_CD_SYS",
          "sysName" : "EHA Custom Code System",
          "sysVersion" : "1"
        } ]
      },
      "location" : {
        "identifier" : {
          "system" : "CDM",
          "value" : "FAC101"
        },
        "name" : "FAC_ROOM1",
        "type" : {
          "coding" : [ {
            "code" : "FAC_SUBTYP_RM",
            "display" : "Room",
            "description" : "A space allocated for a function within a building or a floor",
            "sysId" : "EHA_CUSTOM_CD_SYS",
            "sysName" : "EHA Custom Code System",
            "sysVersion" : "1"
          } ]
        }
      },
      "sequence" : 12
    },
    "performer" : {
      "identifier" : {
        "system" : "CDM",
        "value" : "SVCPRV 12 02"
      },
      "type" : {
        "coding" : [ {
          "code" : "SVCPRV_TYP_CD_VALUE1",
          "display" : "SVCPRV_TYP_CD_VALUE1",
          "description" : "SVCPRV_TYP_CD_VALUE1",
          "sysId" : "SVCPRV_TYP_CD_SYS1",
          "sysName" : "Service Provider System1",
          "sysVersion" : "2"
        } ]
      },
      "specimenAliasIssuerFlag" : "N"
    },
    "valueQuantity" : {
      "value" : "12",
      "code" : "UOM_TYP_CODE_5",
      "sysId" : "EHA_CUSTOM_CD_SYS",
      "sysName" : "EHA Custom Code System"
    },
    "valueCodeableConcept" : {
      "coding" : [ {
        "code" : "F",
        "sysId" : "F",
        "sysName" : "F",
        "sysVersion" : "F"
      } ]
    },
    "valueString" : "NOTE for OBSV CD ID 5565",
    "specimen" : {
      "reference" : "/HSDataService-web/api/3.2.0/patientapi/clinicalspecimens/-1"
    },
    "referenceRange" : {
      "low" : {
        "value" : "10.2",
        "units" : "REFERENCE_LOW_UOM_CODE",
        "code" : "REFERENCE_LOW_UOM_CODE",
        "description" : "REFERENCE_LOW_UOM_CODE for high reference of UOM code",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "1"
      },
      "high" : {
        "value" : "80.7",
        "units" : "REFERENCE_HIGH_UOM_CODE",
        "code" : "REFERENCE_HIGH_UOM_CODE",
        "description" : "REFERENCE_HIGH_UOM_CODE for high reference of UOM code",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "1"
      }
    },
    "effectiveDateTime" : "01/01/1920"
    } ],
  "count" : 1,
  "hasMore" : true,
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:7001/HSDataService-web/api/3.2.0/patientapi/observations?id=808&id=816&limit=2"
  } ]
}

Step 3b: Retrieve Conditions for Patient IDs

This API fetches the Conditions for Patient IDs (808 and 816) retrieved in Step 2. For details, see the Retrieve Conditions for Patient Identifiers endpoint.

API URL

http://localhost:7001/HSDataService-web/api/3.2.0/patientapi/conditions?id=808=816=2

Request Type

GET

JSON Response

{
  "resourceType" : "Condition",
  "items" : [ {
    "identifier" : {
      "system" : "CDM",
      "value" : "5033"
    },
    "code" : {
      "coding" : [ {
        "code" : "CNRN_CD_MED_CARC",
        "display" : "Mediastinal Carcinoma",
        "description" : "Mediastinal carcinoma  description",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "1"
      } ]
    },
    "bodySite" : {
      "coding" : [ {
        "code" : "SPCMN_ANA_SITE_CD_CODE_2",
        "display" : "Female",
        "description" : "SPCMN_ANA_SITE_CD Code Description",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "2"
      } ]
    },
    "clinicalStatus" : {
      "coding" : [ {
        "code" : "CNRN_STCD_NOT_ACTV",
        "display" : "Not Active",
        "description" : "Not active description",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "2"
      } ]
    },
    "onsetDate" : "01/01/1920",
    "onsetAge" : "50",
    "reportedDate" : "01/01/1920",
    "endDate" : "01/31/1920",
    "asserter" : {
      "identifier" : {
        "system" : "CDM",
        "value" : "maf"
      },
      "type" : {
        "coding" : [ {
          "code" : "SVCPRV_TYP_CD_VALUE1",
          "display" : "SVCPRV_TYP_CD_VALUE1",
          "description" : "TESTCODEDESCRIPTION1 ",
          "sysId" : "SVCPRV_TYP_CD_SYS1",
          "sysName" : "Service Provider System1",
          "sysVersion" : "1"
        } ]
      },
      "speciality" : {
        "coding" : [ {
          "code" : "SVCPRV_SPEC_CD_1",
          "display" : "SVCPRV_SPEC_CD_1",
          "description" : "TESTCODEDESCRIPTION ",
          "sysId" : "SVCPRV_TYP_CD_SYS1",
          "sysName" : "Service Provider System1",
          "sysVersion" : "2"
        } ]
      },
      "specimenAliasIssuerFlag" : "N"
    },
    "patient" : {
      "reference" : "/HSDataService-web/api/3.2.0/patientapi/patients/808"
    }
  }
 ],
  "count" : 1,
  "hasMore" : false,
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:7001/HSDataService-web/api/3.2.0/patientapi/conditions?id=808&id=816&limit=2"
  } ]
}

Step 3c: Retrieve Demographics for Patient IDs

This API fetches the Demographics for Patient IDs (808) retrieved in Step 2. For details, see the Retrieve Demographics for Cohort List Name or Patient Identifiers endpoint.

API URL

http://localhost:7001/HSDataService-web/api/3.2.0/patientapi/patients?id=808&limit=2

Request Type

GET

JSON Response

{
  "items" : [ {
    "identifiers" : [ {
      "system" : "CDM",
      "value" : "808"
    }, {
      "system" : "Customer Defined",
      "value" : "1002"
    } ],
    "name" : {
      "text" : "Obfuscated  Obfuscated  Obfuscated ",
      "family" : "Obfuscated ",
      "given" : [ "Obfuscated ", "Obfuscated " ]
    },
    "gender" : {
      "coding" : [ {
        "code" : "GNDR_CD_MALE",
        "display" : "Male",
        "description" : "Male",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "2"
      } ]
    },
    "birthDate" : "01/01/1900",
    "deceasedBoolean" : true,
    "deceasedDate" : "01/01/2000",
    "maritalStatus" : {
      "coding" : [ {
        "code" : "MRTL_STCD_WDWED",
        "display" : "Widowed",
        "description" : "Widowed",
        "sysId" : "EHA_CUSTOM_CD_SYS",
        "sysName" : "EHA Custom Code System",
        "sysVersion" : "2"
      } ]
    },
    "address" : {
      "line" : [ "Obfuscated ", "Obfuscated ", "Obfuscated " ],
      "city" : "ANCHORAGE",
      "district" : "Not Active",
      "state" : {
        "coding" : [ {
          "code" : "SRC_OF_ADMSN_CD_PHYS_RFRL",
          "display" : "Physician Referral",
          "description" : "Physician referral",
          "sysId" : "EHA_CUSTOM_CD_SYS",
          "sysName" : "EHA Custom Code System",
          "sysVersion" : "2"
        } ]
      },
      "country" : {
        "coding" : [ {
          "code" : "INTVN_CD_NEULASTA",
          "display" : "Neulasta",
          "description" : "Neulasta  description",
          "sysId" : "EHA_CUSTOM_CD_SYS",
          "sysName" : "EHA Custom Code System",
          "sysVersion" : "2"
        } ]
      }
    },
    "race" : {
      "reference" : "/HSDataService-web/api/3.2.0/patientapi/patients/808/race"
    },
    "ethnicity" : {
      "reference" : "/HSDataService-web/api/3.2.0/patientapi/patients/808/ethnicity"
    },
    "subject" : {
      "reference" : "/HSDataService-web/api/3.2.0/patientapi/patients/808/subjects"
    }
  }
 ],
  "count" : 1,
  "hasMore" : false,
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:7001/HSDataService-web/api/3.2.0/patientapi/patients?id=80&limit=2"
  } ]
}

Step 3d: Create Cohort List

This API creates Cohort List for Patient IDs (808 and 810) retrieved in Step 2 along with other input. For details, see the Create Cohort List endpoint.

API URL

http://localhost:7001/HSDataService-web/api/3.2.0/cohortlists/create

Request Type

POST

Request Body

{
  "cohortListName":"Usecase",
  "cohortListDesc":"This cohort is for testing E2E scenario 2",
  "context":"patient",
  "patientWidList":[808,810],
  "privacy":"public"
}

JSON Response

{
  "cohortListId" : 10000000637009,
  "cohortListName" : "Usecase",
  "cohortListDescription" : "This cohort is for testing E2E scenario 2",
  "contextFlag" : "PATIENT",
  "privacy" : "PUBLIC",
  "createdDate" : "02/23/2017",
  "cohortListDetails" : {
    "reference" : "/HSDataService-web/api/3.2.0/cohortlists/10000000637009"
  }
}