{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a0e66342-662c-4ecc-ac84-c0194a07e5a7",
   "metadata": {
    "id": "a0e66342-662c-4ecc-ac84-c0194a07e5a7"
   },
   "source": [
    "# ImmPort Data - CDE Data Discovery and Interoperability"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ufoXwSMhjROK",
   "metadata": {
    "id": "ufoXwSMhjROK"
   },
   "source": [
    "This tutorial demonstrates data discovery and extract, transform, and load (ETL) of ImmPort data using Common Data Elements (CDEs).  We also show their interoperability with CDEs in the external [NIH CDE repository](https://cde.nlm.nih.gov/home).  To learn more about the mapping of ImmPort data elements to CDEs, see [here](https://docs.immport.org/home/commondataelements/)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fspmvzAqsj6d",
   "metadata": {
    "id": "fspmvzAqsj6d"
   },
   "source": [
    "# Import required packages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4ysQLb80sklW",
   "metadata": {
    "id": "4ysQLb80sklW"
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "import os\n",
    "import requests\n",
    "import json\n",
    "import pandas as pd\n",
    "\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "wfKSNfcjsrFt",
   "metadata": {
    "id": "wfKSNfcjsrFt"
   },
   "source": [
    "# Helper function to handle ImmPort API endpoint requests, with and without authentication"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e8ea280c-5643-43d8-8ae9-41765b43786a",
   "metadata": {
    "id": "e8ea280c-5643-43d8-8ae9-41765b43786a"
   },
   "outputs": [],
   "source": [
    "# Setup base URLs common to all API endpoints\n",
    "\n",
    "API_ENDPOINT_BASE_URL = \"https://www.immport.org\"\n",
    "DATA_QUERY_URL = API_ENDPOINT_BASE_URL + \"/data/query\"\n",
    "\n",
    "# Authentication: Use a scoped API key.\n",
    "# Create an API key at: https://www.immport.org/auth/api/keys\n",
    "\n",
    "# best practice is to set the API key as an environment variable outside the notebook and then use the environment variable directly\n",
    "# export IMMPORT_API_KEY=\"<your_api_key>\"\n",
    "# IMMPORT_API_KEY = os.getenv('IMMPORT_API_KEY')\n",
    "\n",
    "# for simplicity, we will enter it here in the notebook\n",
    "IMMPORT_API_KEY = \"INSERT_API_KEY_HERE\"\n",
    "\n",
    "\n",
    "def api_data_query(endpoint, authorization=True, format=\"json\"):\n",
    "    '''Use the Data Query API by first checking for authorization if needed, then call the API endpoint to retrieve the results.\n",
    "\n",
    "       param endpoint: Data Query endpoint\n",
    "       param authorization: Indicates if endpoint requires authorization\n",
    "       param format: String (json, tsv)\n",
    "\n",
    "       return: results or None\n",
    "    '''\n",
    "    headers = {}\n",
    "    results = None\n",
    "\n",
    "    if authorization:\n",
    "        # Use API key\n",
    "        api_key = IMMPORT_API_KEY\n",
    "        if not api_key:\n",
    "            print(\"ERROR: IMMPORT_API_KEY not set\", file=sys.stderr)\n",
    "            return None\n",
    "        bearer = \"Bearer \" + api_key\n",
    "        if format == \"json\":\n",
    "            headers = {\n",
    "                'Authorization': bearer,\n",
    "                'Content-Type': \"application/json\"\n",
    "            }\n",
    "        else:\n",
    "            headers = {\n",
    "                'Authorization': bearer,\n",
    "                'Content-Type': \"text/plain\"\n",
    "            }\n",
    "\n",
    "    else:\n",
    "        if format == \"json\":\n",
    "            headers = {\n",
    "                'Content-Type': \"application/json\"\n",
    "            }\n",
    "        else:\n",
    "            headers = {\n",
    "                'Content-Type': \"text/plain\"\n",
    "            }\n",
    "\n",
    "    results = requests.get(endpoint, headers=headers)\n",
    "    if results.status_code == 200:\n",
    "        if results is None:\n",
    "             print(\"ERROR: API Endpoint failed to return results\", file = sys.stderr)\n",
    "             return None\n",
    "        if format == \"json\":\n",
    "            return results.json()\n",
    "        else:\n",
    "            return results.text\n",
    "    else:\n",
    "        print(\"ERROR: API Status Code: \" + str(results.status_code), file = sys.stderr)\n",
    "        return None\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "n05EjAnljLlJ",
   "metadata": {
    "id": "n05EjAnljLlJ"
   },
   "source": [
    "# Study Search\n",
    "\n",
    "## Endpoints to support text and faceted search of study and subject metadata"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "88ce1a1f-0a3f-4ab0-af91-73399fe6e007",
   "metadata": {
    "id": "88ce1a1f-0a3f-4ab0-af91-73399fe6e007"
   },
   "source": [
    "Let's say we are interested in research on vaccine response to the pneumonia vaccine.  In particular, we are interested in whether the weight of a subject affects vaccine response.\n",
    "\n",
    "We know that subject weight has a corresponding CDE named \"Vital Signs Type\" (CDE ID: [GOr1OFJAKC](https://cde.nlm.nih.gov/deView?tinyId=GOr1OFJAKC)), where one of the permissible values is \"Weight\" (Concept Identifier: C81328).  In the ImmPort database, these values are represented as \"cdeId\" = \"GOr1OFJAKC\" and \"cdePvId\" = \"C81328\", respectively.  Since we are specifically interested in studies that contain data about subject weight, rather than data about other subject vital signs, we will use the permissible value concept identifier, or cdePvId, to search.\n",
    "\n",
    "\n",
    "We want to search for studies using \"researchFocus\" = \"Vaccine Response\", \"conditionOrDisease\" = \"Streptococcus pneumonia\" and \"cdePvId\" = \"C81328\".  (Note that, if we wanted to expand our search to include data about other vital signs, we could use \"cdeId\" = \"GOr1OFJAKC\" instead of \"cdePvId\" = \"C81328\".)\n",
    "\n",
    "/api/search/study\n",
    "\n",
    "Notes:\n",
    "*   search endpoints do not require authorization\n",
    "*   Default pageSize = 10 (Maximum number of records to return per page), so we may need to enter a larger number to see full results\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "skqiarQ1di3M",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "skqiarQ1di3M",
    "outputId": "7b826f53-d4c2-478d-c65a-f916b2dc3f10",
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'took': 20,\n",
       " 'timed_out': False,\n",
       " '_shards': {'total': 5, 'successful': 5, 'skipped': 0, 'failed': 0},\n",
       " 'hits': {'total': {'value': 2, 'relation': 'eq'},\n",
       "  'max_score': 0.0,\n",
       "  'hits': [{'_index': 'study_mapping_common_dr68',\n",
       "    '_id': 'SDY87',\n",
       "    '_score': 0.0,\n",
       "    '_source': {'clinical_trial': 'N',\n",
       "     'gender': ['Male'],\n",
       "     'ethnicity': ['Hispanic or Latino', 'Not Hispanic or Latino'],\n",
       "     'brief_title': 'In-Depth Characterization of Immune Responses to Pneumovax Vaccination in Healthy Subjects',\n",
       "     'initial_data_release_version_number': 18.0,\n",
       "     'program_name': ['Human Immunology Project Consortium (HIPC) RFA-AI-14-007, RFA-AI-09-040'],\n",
       "     'latest_data_release_version': 'DR68',\n",
       "     'arm_name': ['Pneumovax'],\n",
       "     'lab_test_panel_count': ['Blood Cell Count with Differential (90)',\n",
       "      'Chemistry Test (180)'],\n",
       "     'assay_method_count': ['Flow Cytometry (198)'],\n",
       "     'clinicaltrials_link': [],\n",
       "     'pubmed_id': [],\n",
       "     'age_range': '22.0-49.0',\n",
       "     'planned_visit_total_count': [8],\n",
       "     'arm_accession': ['ARM564'],\n",
       "     'minimum_age': '  22.00',\n",
       "     'has_lab_test': 'Y',\n",
       "     'latest_data_release_date': '2026-09-24',\n",
       "     'study_size_number': 78973470,\n",
       "     'gender_included': 'Male',\n",
       "     'analyte_preferred_count': [],\n",
       "     'maximum_age': '  49.00',\n",
       "     'research_focus': ['Vaccine Response'],\n",
       "     'contract_grant_external_id': ['AI089987'],\n",
       "     'study_accession_number': 87,\n",
       "     'latest_data_release_version_number': 68.0,\n",
       "     'race': ['Other', 'White'],\n",
       "     'actual_enrollment': 5,\n",
       "     'initial_data_release_date': '2016-03-18',\n",
       "     'brief_description': 'This study will measure the immune response to the Pneumovax vaccine The long-term goal is to develop improved vaccines to infectious diseases such as influenza. Blood will be collected from patients at several visits before and after vaccination. The blood will be used in a series of immunological tests to measure the strength and breadth of immune response. These assays may include T cell and B cell activation assays, microarray testing, Epimax, Epigen, and flow cytometry.',\n",
       "     'biosample_type': ['Other', 'Whole blood'],\n",
       "     'shared_subject_count': [],\n",
       "     'max_age': 49.0,\n",
       "     'study_accession': 'SDY87',\n",
       "     'contract_grant_name': ['Systems Analysis Vaccine Responses in Healthy and Hyporesponsive Humans'],\n",
       "     'study_size': '75.31 MB',\n",
       "     'study_pi': ['A. Karolina Palucka: Baylor Research Institute'],\n",
       "     'species': ['Homo sapiens'],\n",
       "     'initial_data_release_version': 'DR18',\n",
       "     'condition_or_disease': ['Streptococcus pneumonia'],\n",
       "     'has_assessment': 'Y',\n",
       "     'assessment_panel_count': ['Vitals (65)',\n",
       "      'Medical History (209)',\n",
       "      'Followup Questionnaire (51)',\n",
       "      'Vaccination History (13)',\n",
       "      'Eligibility (95)',\n",
       "      'End of Study (30)'],\n",
       "     'age_unit': 'Years',\n",
       "     'assay_method': ['Flow Cytometry'],\n",
       "     'min_age': 22.0,\n",
       "     'doi': '10.21430/M3AA0XR32D'}},\n",
       "   {'_index': 'study_mapping_common_dr68',\n",
       "    '_id': 'SDY180',\n",
       "    '_score': 0.0,\n",
       "    '_source': {'clinical_trial': 'N',\n",
       "     'gender': ['Female', 'Male'],\n",
       "     'ethnicity': ['Hispanic or Latino', 'Not Hispanic or Latino'],\n",
       "     'brief_title': 'Systems scale interactive exploration reveals quantitative and qualitative differences in response to 2009-2010 Fluzone influenza vaccine and pneumococcal vaccine',\n",
       "     'initial_data_release_version_number': 6.0,\n",
       "     'program_name': ['Human Immunology Project Consortium (HIPC) RFA-AI-14-007, RFA-AI-09-040'],\n",
       "     'latest_data_release_version': 'DR58',\n",
       "     'arm_name': ['Study group 1 2009-2010 Fluzone',\n",
       "      'Study group 2 2009-2010 Fluzone',\n",
       "      'Study group 3 2009-2010 Fluzone',\n",
       "      'Study group 1 Saline',\n",
       "      'Study group 1 Pneunomax23',\n",
       "      'Study group 3 Pneunomax23',\n",
       "      'Study group 2 Pneunomax23',\n",
       "      'Study group 2 Saline'],\n",
       "     'lab_test_panel_count': ['Blood Cell Count (1836)'],\n",
       "     'assay_method_count': ['Flow Cytometry (2208)',\n",
       "      'Hemagglutination Inhibition (66)',\n",
       "      'Luminex xMAP (229)',\n",
       "      'Nanostring (18)',\n",
       "      'Neutralizing Antibody Titer Assay (27)',\n",
       "      'Transcription profiling by array (703)',\n",
       "      'Virus Neutralization (89)'],\n",
       "     'clinicaltrials_link': [],\n",
       "     'pubmed_id': ['23601689'],\n",
       "     'age_range': '22.0-49.0',\n",
       "     'planned_visit_total_count': [17],\n",
       "     'arm_accession': ['ARM777',\n",
       "      'ARM775',\n",
       "      'ARM776',\n",
       "      'ARM780',\n",
       "      'ARM778',\n",
       "      'ARM774',\n",
       "      'ARM773',\n",
       "      'ARM779'],\n",
       "     'minimum_age': '  22.00',\n",
       "     'has_lab_test': 'Y',\n",
       "     'latest_data_release_date': '2025-10-30',\n",
       "     'study_size_number': 34131077431,\n",
       "     'gender_included': 'Female, Male',\n",
       "     'analyte_preferred_count': ['CCL22 (182)',\n",
       "      'CSF3 (182)',\n",
       "      'Eotaxin (182)',\n",
       "      'GMCSF (182)',\n",
       "      'GRO (182)',\n",
       "      'IFNA2 (182)',\n",
       "      'IFNG (182)',\n",
       "      'IL10 (182)',\n",
       "      'IL12p40 (182)',\n",
       "      'IL12p70 (182)',\n",
       "      'IL13 (182)',\n",
       "      'IL15 (182)',\n",
       "      'IL17A (182)',\n",
       "      'IL1A (182)',\n",
       "      'IL1B (182)',\n",
       "      'IL1R1 (182)',\n",
       "      'IL2 (182)',\n",
       "      'IL2RA (182)',\n",
       "      'IL3 (182)',\n",
       "      'IL4 (182)',\n",
       "      'IL5 (182)',\n",
       "      'IL6 (182)',\n",
       "      'IL7 (182)',\n",
       "      'IL8 (182)',\n",
       "      'IL9 (182)',\n",
       "      'IP-10 (182)',\n",
       "      'MCP1 (182)',\n",
       "      'MCP3 (182)',\n",
       "      'MIP1A (182)',\n",
       "      'MIP1B (182)',\n",
       "      'PDGFA (182)',\n",
       "      'RANTES (182)',\n",
       "      'TGFA (182)',\n",
       "      'TNFA (182)',\n",
       "      'TNFB (182)',\n",
       "      'VEGFA (182)'],\n",
       "     'maximum_age': '  49.00',\n",
       "     'research_focus': ['Vaccine Response'],\n",
       "     'contract_grant_external_id': ['AI089987'],\n",
       "     'study_accession_number': 180,\n",
       "     'latest_data_release_version_number': 58.0,\n",
       "     'race': ['Black or African American', 'White', 'Asian'],\n",
       "     'actual_enrollment': 46,\n",
       "     'initial_data_release_date': '2013-12-18',\n",
       "     'brief_description': 'Systems approach to study immune response to seasonal influenza and 23-valent pneumoccocal vaccination in healthy adults.',\n",
       "     'biosample_type': ['Serum', 'Whole blood', 'Protein'],\n",
       "     'shared_subject_count': [],\n",
       "     'max_age': 49.0,\n",
       "     'study_accession': 'SDY180',\n",
       "     'contract_grant_name': ['Systems Analysis Vaccine Responses in Healthy and Hyporesponsive Humans'],\n",
       "     'study_size': '31.79 GB',\n",
       "     'study_pi': ['A. Karolina Palucka: Baylor Reasearch Institute'],\n",
       "     'species': ['Homo sapiens'],\n",
       "     'initial_data_release_version': 'DR6',\n",
       "     'condition_or_disease': ['healthy',\n",
       "      'Streptococcus pneumonia',\n",
       "      'influenza'],\n",
       "     'has_assessment': 'N',\n",
       "     'assessment_panel_count': [],\n",
       "     'age_unit': 'Years',\n",
       "     'assay_method': ['Nanostring',\n",
       "      'Virus Neutralization',\n",
       "      'Hemagglutination Inhibition',\n",
       "      'Luminex xMAP',\n",
       "      'Flow Cytometry',\n",
       "      'Transcription profiling by array',\n",
       "      'Neutralizing Antibody Titer Assay'],\n",
       "     'min_age': 22.0,\n",
       "     'doi': '10.21430/M3I44H8R17'}}]},\n",
       " 'aggregations': {'research_focus': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Vaccine Response', 'doc_count': 2},\n",
       "    {'key': 'Atopy/Allergy', 'doc_count': 0},\n",
       "    {'key': 'Autoimmune', 'doc_count': 0},\n",
       "    {'key': 'Cardiovascular system disease', 'doc_count': 0},\n",
       "    {'key': 'Cell Biology', 'doc_count': 0},\n",
       "    {'key': 'Computational Modelling', 'doc_count': 0},\n",
       "    {'key': 'Development', 'doc_count': 0},\n",
       "    {'key': 'Epidemiology', 'doc_count': 0},\n",
       "    {'key': 'Exposome', 'doc_count': 0},\n",
       "    {'key': 'Immune Response', 'doc_count': 0},\n",
       "    {'key': 'Infection Response', 'doc_count': 0},\n",
       "    {'key': 'Method Development', 'doc_count': 0},\n",
       "    {'key': 'Molecular Biology', 'doc_count': 0},\n",
       "    {'key': 'No Research Focus Specified', 'doc_count': 0},\n",
       "    {'key': 'Oncology', 'doc_count': 0},\n",
       "    {'key': 'Other', 'doc_count': 0},\n",
       "    {'key': 'Pregnancy', 'doc_count': 0},\n",
       "    {'key': 'Preterm Birth', 'doc_count': 0},\n",
       "    {'key': 'Psychopathology', 'doc_count': 0},\n",
       "    {'key': 'Radiation Biology', 'doc_count': 0},\n",
       "    {'key': 'Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Vaccine Development', 'doc_count': 0}]},\n",
       "  'clinical_trial': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'N', 'doc_count': 2}, {'key': 'Y', 'doc_count': 0}]},\n",
       "  'gender': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Male', 'doc_count': 2},\n",
       "    {'key': 'Female', 'doc_count': 1},\n",
       "    {'key': 'Not Specified', 'doc_count': 0},\n",
       "    {'key': 'Other', 'doc_count': 0},\n",
       "    {'key': 'Unknown', 'doc_count': 0}]},\n",
       "  'race': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'White', 'doc_count': 2},\n",
       "    {'key': 'Asian', 'doc_count': 1},\n",
       "    {'key': 'Black or African American', 'doc_count': 1},\n",
       "    {'key': 'Other', 'doc_count': 1},\n",
       "    {'key': 'American Indian or Alaska Native', 'doc_count': 0},\n",
       "    {'key': 'Multiracial', 'doc_count': 0},\n",
       "    {'key': 'Native Hawaiian or Other Pacific Islander', 'doc_count': 0},\n",
       "    {'key': 'Not Specified', 'doc_count': 0},\n",
       "    {'key': 'Unknown', 'doc_count': 0}]},\n",
       "  'ethnicity': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Hispanic or Latino', 'doc_count': 2},\n",
       "    {'key': 'Not Hispanic or Latino', 'doc_count': 2},\n",
       "    {'key': 'Not Specified', 'doc_count': 0},\n",
       "    {'key': 'Other', 'doc_count': 0}]},\n",
       "  'program_name': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Human Immunology Project Consortium (HIPC) RFA-AI-14-007, RFA-AI-09-040',\n",
       "     'doc_count': 2},\n",
       "    {'key': 'Accelerating Medicines Partnership RA/SLE (AMP RA/SLE) RFA-AR-14-016',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Asthma and Allergic Diseases Cooperative Research Centers',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Asthma and Allergic Diseases Cooperative Research Centers (AADCRC) RFA-AI-12-006',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Asthma and Allergic Diseases Cooperative Research Centers (AADCRC) RFA-AI-15-032',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Asthma and Allergic Diseases Cooperative Research Centers (AADCRC) RFA-AI-16-065',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Atopic Dermatitis & Vaccinia Network (ADVN)', 'doc_count': 0},\n",
       "    {'key': 'Atopic Dermatitis Research Network (ADRN) RFA-AI-14-033',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Autoimmunity Centers of Excellence (ACE) AI-12-060, AI-12-059',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Autoimmunity Centers of Excellence (ACE), Basic Research Program RFA-AI-18-002',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Bill and Melinda Gates Foundation (BMGF)', 'doc_count': 0},\n",
       "    {'key': 'CEIRR Centers of Excellence for Influenza Research and Response',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'CIVICs Collaborative Influenza Vaccine Innovation Centers',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Centers for Medical Countermeasures Against Radiation Consortium (CMCRC) RFA-AI-19-012',\n",
       "     'doc_count': 0},\n",
       "    {'key': \"Children's Environmental Health and Disease Prevention Research Centers\",\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Clinical Islet Transplantation Consortium RFA-DK-09-501',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Clinical Trials in Organ Transplantation (CTOT)', 'doc_count': 0},\n",
       "    {'key': 'Clinical Trials in Organ Transplantation in Children (CTOT-C) RFA-AI-12-005',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Clinical and Translational Science Award', 'doc_count': 0},\n",
       "    {'key': 'Consortium for Food Allergy Research (CoFAR) RFA-AI-14-003,RFA-AI-09-039,RFA-AI-04-034',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Cooperative Centers on Human Immunology RFA-AI-17-040',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Cooperative Clinical Trials in Pediatric Transplantation (CCTPT)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'DMID Sanaria Grant Program', 'doc_count': 0},\n",
       "    {'key': 'Defining Genomic Influence on Gene Network Regulation',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Development of Sample Sparing Assays for Monitoring Immune Responses (U24 Clinical Trial Not Allowed) RFA-AI-19-017',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Development of Sample Sparing Assays for Monitoring Immune Responses RFA-AI-14-027',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Enhance Applicability of Mouse Models for Translational Research (Oncology Model, OMF)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'European Union’s Horizon 2020 Program', 'doc_count': 0},\n",
       "    {'key': 'Genomics of Transplantation Cooperative Research Program (GEN) RFA-AI-10-019',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'HLA Region Genetics in Immune-mediated Diseases I',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'HLA Region Genetics in Immune-mediated Diseases II',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'HLA and KIR Region Genomics in Immune-Mediated Diseases RFA-AI-14-012, RFA-AI-14-013',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Human Immunology Project Consortium (HIPC) RFA-AI-15-041',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Human Immunology Project Consortium (HIPC) RFA-AI-20-079',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'ITN: Collaborative Network for Clinical Research on Immune Tolerance Network',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Immune Function and Biodefense in Children, Elderly, and Immunocompromised Populations',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Immune Mechanisms of Protection Against Mycobacterium tuberculosis Center (IMPAc-TB)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Immunity in Neonates and Infants (U01) RFA-AI-16-001',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Immunophenotyping Assessment in a COVID-19 Cohort (IMPACC)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Inner City Asthma Consortium (ICAC) RFA-AI-13-036',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'La Jolla Institute for Immunology CMI Flu', 'doc_count': 0},\n",
       "    {'key': 'Lung Diseases Research', 'doc_count': 0},\n",
       "    {'key': 'March of Dimes', 'doc_count': 0},\n",
       "    {'key': 'Mechanisms of Immune Protection from TB among HIV-infected Individuals (R01) RFA-AI-14-072',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Mentored Patient-Oriented Research Career Development Award (Parent K23)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Modeling Immunity for Biodefense I', 'doc_count': 0},\n",
       "    {'key': 'Modeling Immunity for Biodefense II', 'doc_count': 0},\n",
       "    {'key': 'Modeling Immunity for Biodefense RFA-AI-14-028', 'doc_count': 0},\n",
       "    {'key': 'Molecular Transducers of Physical Activity Consortium (MoTrPAC)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIAID Centers of Excellence for Influenza Research and Surveillance (CEIRS)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIAID Investigator Initiated Program PAR-20-072', 'doc_count': 0},\n",
       "    {'key': 'NIAID Investigator Initiated Program Project Applications (P01) PAR-16-413, PAR-13-254',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIAID Laboratory of Immunogenetics', 'doc_count': 0},\n",
       "    {'key': 'NIAID Program Research Project Grant (Parent R01)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIAID SBIR Phase II Clinical Trial Implementation Cooperative Agreement (U44)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIAID Vaccine Research Center (VRC)', 'doc_count': 0},\n",
       "    {'key': 'NIAMS Rheumatic Diseases Research Resource-based Centers (P30) RFA-AR-16-002',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIH American Recovery & Reinvestment Act', 'doc_count': 0},\n",
       "    {'key': 'NIH Center for Human Immunology, Autoimmunity and Inflammation (CHI)',\n",
       "     'doc_count': 0},\n",
       "    {'key': \"NIH Director's New Innovator Award Program (DP2) 2013\",\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIH Program', 'doc_count': 0},\n",
       "    {'key': 'NIH Research Project Grant - Special Emphasis Panel ZRG1 TIR-W (01)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIH Revision Awards for Creating Virtual Consortium for Translational/Transdisciplinary Environmental Research (ViCTER)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'NIHR Biomedical Research Centres (BRCs)', 'doc_count': 0},\n",
       "    {'key': 'NSF Engineering Research Center for Cell Manufacturing Technologies (CMaT)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'National Institute of Allergy and Infectious Diseases (NIAID) Clinical Data and Safety Management Center (CDSMC) RFA-AI-22-058',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Non-NIH funding programs', 'doc_count': 0},\n",
       "    {'key': 'Other Programs', 'doc_count': 0},\n",
       "    {'key': 'Oxford-BMS Fellowship', 'doc_count': 0},\n",
       "    {'key': 'PROSET-HD Profiling of Cell Subsets in Human Disease',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Placeholder Program (**Replace**)', 'doc_count': 0},\n",
       "    {'key': 'Population Genetics Analysis Program (1)', 'doc_count': 0},\n",
       "    {'key': 'Population Genetics Analysis Program (2)', 'doc_count': 0},\n",
       "    {'key': 'Protective Immunity Following Dengue Virus Natural Infections and Vaccination',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Protective Immunity in Special Populations', 'doc_count': 0},\n",
       "    {'key': 'Puerto Rico Idea Network for Biomedical Research Excellence (PR-INBRE)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'RELIVE', 'doc_count': 0},\n",
       "    {'key': 'Radiation/Nuclear Medical Countermeasure (MCM) Product Development Support Services',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Ragon Institute', 'doc_count': 0},\n",
       "    {'key': 'Rapid Investigation of Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-2) and Coronavirus Disease 2019 (COVID-19)',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Research Projects to Enhance Applicability of Mammalian Models for Translational Research',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Respiratory Pathogens Research Center (RPRC)', 'doc_count': 0},\n",
       "    {'key': 'SeroNet', 'doc_count': 0},\n",
       "    {'key': 'Software and Hardware Inference Engines For Automated Determination Of Primary Cell Function',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Systems Approach to Immunity and Inflammation RFA-AI-11-017',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Systems Approach to Immunity and Inflammation RFA-AI-16-050',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Systems Biology for Infectious Diseases Research',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Tuberculosis Research Units (U19) RFA-AI-12-045', 'doc_count': 0},\n",
       "    {'key': 'Unassigned', 'doc_count': 0}]},\n",
       "  'biosample_type': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Whole blood', 'doc_count': 2},\n",
       "    {'key': 'Other', 'doc_count': 1},\n",
       "    {'key': 'Protein', 'doc_count': 1},\n",
       "    {'key': 'Serum', 'doc_count': 1},\n",
       "    {'key': 'Amniotic Fluid', 'doc_count': 0},\n",
       "    {'key': 'Appendix', 'doc_count': 0},\n",
       "    {'key': 'B cell', 'doc_count': 0},\n",
       "    {'key': 'Basophils', 'doc_count': 0},\n",
       "    {'key': 'Bone', 'doc_count': 0},\n",
       "    {'key': 'Bone Marrow', 'doc_count': 0},\n",
       "    {'key': 'Breast Milk', 'doc_count': 0},\n",
       "    {'key': 'Bronchoalveolar Lavage Fluid', 'doc_count': 0},\n",
       "    {'key': 'Cell culture supernatant', 'doc_count': 0},\n",
       "    {'key': 'Cervical lymph nodes', 'doc_count': 0},\n",
       "    {'key': 'Colon', 'doc_count': 0},\n",
       "    {'key': 'Cord blood', 'doc_count': 0},\n",
       "    {'key': 'DNA', 'doc_count': 0},\n",
       "    {'key': 'Decidua', 'doc_count': 0},\n",
       "    {'key': 'Dendritic cell', 'doc_count': 0},\n",
       "    {'key': 'Dermis', 'doc_count': 0},\n",
       "    {'key': 'Epithelium', 'doc_count': 0},\n",
       "    {'key': 'Feces', 'doc_count': 0},\n",
       "    {'key': 'Fibroblast', 'doc_count': 0},\n",
       "    {'key': 'Ileum', 'doc_count': 0},\n",
       "    {'key': 'Inguinal lymph node', 'doc_count': 0},\n",
       "    {'key': 'Jejunum', 'doc_count': 0},\n",
       "    {'key': 'Kidney', 'doc_count': 0},\n",
       "    {'key': 'Leukocytes', 'doc_count': 0},\n",
       "    {'key': 'Lipid', 'doc_count': 0},\n",
       "    {'key': 'Liver', 'doc_count': 0},\n",
       "    {'key': 'Lung', 'doc_count': 0},\n",
       "    {'key': 'Lung lymph node', 'doc_count': 0},\n",
       "    {'key': 'Lymph node', 'doc_count': 0},\n",
       "    {'key': 'Lymphocyte', 'doc_count': 0},\n",
       "    {'key': 'Macrophage', 'doc_count': 0},\n",
       "    {'key': 'Mesenteric lymph node', 'doc_count': 0},\n",
       "    {'key': 'Monocyte', 'doc_count': 0},\n",
       "    {'key': 'Mouse Ear', 'doc_count': 0},\n",
       "    {'key': 'NK cell', 'doc_count': 0},\n",
       "    {'key': 'Nasal Swab or Nose Specimen', 'doc_count': 0},\n",
       "    {'key': 'Nasal lavage fluid', 'doc_count': 0},\n",
       "    {'key': 'Nasopharyngeal Swab Specimen', 'doc_count': 0},\n",
       "    {'key': 'Negative Control', 'doc_count': 0},\n",
       "    {'key': 'Neutrophil', 'doc_count': 0},\n",
       "    {'key': 'Not Specified', 'doc_count': 0},\n",
       "    {'key': 'Optic Nerve', 'doc_count': 0},\n",
       "    {'key': 'Organoids', 'doc_count': 0},\n",
       "    {'key': 'Oropharyngeal Swab Specimen', 'doc_count': 0},\n",
       "    {'key': 'Osteoblasts', 'doc_count': 0},\n",
       "    {'key': 'PBL', 'doc_count': 0},\n",
       "    {'key': 'PBMC', 'doc_count': 0},\n",
       "    {'key': 'Placenta', 'doc_count': 0},\n",
       "    {'key': 'Plasma', 'doc_count': 0},\n",
       "    {'key': 'Pooled Sample', 'doc_count': 0},\n",
       "    {'key': 'Popliteal lymph node', 'doc_count': 0},\n",
       "    {'key': 'Red Blood Cell', 'doc_count': 0},\n",
       "    {'key': 'Saliva', 'doc_count': 0},\n",
       "    {'key': 'Salivary Glands', 'doc_count': 0},\n",
       "    {'key': 'Skin of body', 'doc_count': 0},\n",
       "    {'key': 'Small intestine', 'doc_count': 0},\n",
       "    {'key': 'Spleen', 'doc_count': 0},\n",
       "    {'key': 'Stomach', 'doc_count': 0},\n",
       "    {'key': 'Synovial tissue', 'doc_count': 0},\n",
       "    {'key': 'T cell', 'doc_count': 0},\n",
       "    {'key': 'Thymus', 'doc_count': 0},\n",
       "    {'key': 'Tonsil', 'doc_count': 0},\n",
       "    {'key': 'Trachea', 'doc_count': 0},\n",
       "    {'key': 'Tumor Tissue', 'doc_count': 0},\n",
       "    {'key': 'Umbilical cord blood', 'doc_count': 0},\n",
       "    {'key': 'Urine', 'doc_count': 0},\n",
       "    {'key': 'Vagina', 'doc_count': 0},\n",
       "    {'key': 'brain', 'doc_count': 0},\n",
       "    {'key': 'cell line', 'doc_count': 0}]},\n",
       "  'study_accession': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'SDY180', 'doc_count': 1},\n",
       "    {'key': 'SDY87', 'doc_count': 1},\n",
       "    {'key': 'SDY1', 'doc_count': 0},\n",
       "    {'key': 'SDY10', 'doc_count': 0},\n",
       "    {'key': 'SDY100', 'doc_count': 0},\n",
       "    {'key': 'SDY1015', 'doc_count': 0},\n",
       "    {'key': 'SDY1025', 'doc_count': 0},\n",
       "    {'key': 'SDY1026', 'doc_count': 0},\n",
       "    {'key': 'SDY1027', 'doc_count': 0},\n",
       "    {'key': 'SDY1028', 'doc_count': 0},\n",
       "    {'key': 'SDY1029', 'doc_count': 0},\n",
       "    {'key': 'SDY1039', 'doc_count': 0},\n",
       "    {'key': 'SDY1041', 'doc_count': 0},\n",
       "    {'key': 'SDY1043', 'doc_count': 0},\n",
       "    {'key': 'SDY1045', 'doc_count': 0},\n",
       "    {'key': 'SDY1058', 'doc_count': 0},\n",
       "    {'key': 'SDY1064', 'doc_count': 0},\n",
       "    {'key': 'SDY1079', 'doc_count': 0},\n",
       "    {'key': 'SDY1085', 'doc_count': 0},\n",
       "    {'key': 'SDY1086', 'doc_count': 0},\n",
       "    {'key': 'SDY1092', 'doc_count': 0},\n",
       "    {'key': 'SDY1093', 'doc_count': 0},\n",
       "    {'key': 'SDY1094', 'doc_count': 0},\n",
       "    {'key': 'SDY1095', 'doc_count': 0},\n",
       "    {'key': 'SDY1097', 'doc_count': 0},\n",
       "    {'key': 'SDY1099', 'doc_count': 0},\n",
       "    {'key': 'SDY110', 'doc_count': 0},\n",
       "    {'key': 'SDY1100', 'doc_count': 0},\n",
       "    {'key': 'SDY1108', 'doc_count': 0},\n",
       "    {'key': 'SDY1109', 'doc_count': 0},\n",
       "    {'key': 'SDY111', 'doc_count': 0},\n",
       "    {'key': 'SDY1115', 'doc_count': 0},\n",
       "    {'key': 'SDY1119', 'doc_count': 0},\n",
       "    {'key': 'SDY112', 'doc_count': 0},\n",
       "    {'key': 'SDY113', 'doc_count': 0},\n",
       "    {'key': 'SDY1148', 'doc_count': 0},\n",
       "    {'key': 'SDY1149', 'doc_count': 0},\n",
       "    {'key': 'SDY1152', 'doc_count': 0},\n",
       "    {'key': 'SDY1153', 'doc_count': 0},\n",
       "    {'key': 'SDY1154', 'doc_count': 0},\n",
       "    {'key': 'SDY1155', 'doc_count': 0},\n",
       "    {'key': 'SDY1157', 'doc_count': 0},\n",
       "    {'key': 'SDY1162', 'doc_count': 0},\n",
       "    {'key': 'SDY1164', 'doc_count': 0},\n",
       "    {'key': 'SDY1171', 'doc_count': 0},\n",
       "    {'key': 'SDY1172', 'doc_count': 0},\n",
       "    {'key': 'SDY1173', 'doc_count': 0},\n",
       "    {'key': 'SDY1175', 'doc_count': 0},\n",
       "    {'key': 'SDY1176', 'doc_count': 0},\n",
       "    {'key': 'SDY1177', 'doc_count': 0},\n",
       "    {'key': 'SDY1178', 'doc_count': 0},\n",
       "    {'key': 'SDY1182', 'doc_count': 0},\n",
       "    {'key': 'SDY1185', 'doc_count': 0},\n",
       "    {'key': 'SDY1190', 'doc_count': 0},\n",
       "    {'key': 'SDY1205', 'doc_count': 0},\n",
       "    {'key': 'SDY1206', 'doc_count': 0},\n",
       "    {'key': 'SDY1215', 'doc_count': 0},\n",
       "    {'key': 'SDY1217', 'doc_count': 0},\n",
       "    {'key': 'SDY1230', 'doc_count': 0},\n",
       "    {'key': 'SDY1231', 'doc_count': 0},\n",
       "    {'key': 'SDY1249', 'doc_count': 0},\n",
       "    {'key': 'SDY1252', 'doc_count': 0},\n",
       "    {'key': 'SDY1256', 'doc_count': 0},\n",
       "    {'key': 'SDY1260', 'doc_count': 0},\n",
       "    {'key': 'SDY1264', 'doc_count': 0},\n",
       "    {'key': 'SDY1267', 'doc_count': 0},\n",
       "    {'key': 'SDY1276', 'doc_count': 0},\n",
       "    {'key': 'SDY1288', 'doc_count': 0},\n",
       "    {'key': 'SDY1289', 'doc_count': 0},\n",
       "    {'key': 'SDY1290', 'doc_count': 0},\n",
       "    {'key': 'SDY1291', 'doc_count': 0},\n",
       "    {'key': 'SDY1293', 'doc_count': 0},\n",
       "    {'key': 'SDY1294', 'doc_count': 0},\n",
       "    {'key': 'SDY1295', 'doc_count': 0},\n",
       "    {'key': 'SDY1298', 'doc_count': 0},\n",
       "    {'key': 'SDY1299', 'doc_count': 0},\n",
       "    {'key': 'SDY13', 'doc_count': 0},\n",
       "    {'key': 'SDY1300', 'doc_count': 0},\n",
       "    {'key': 'SDY1302', 'doc_count': 0},\n",
       "    {'key': 'SDY131', 'doc_count': 0},\n",
       "    {'key': 'SDY132', 'doc_count': 0},\n",
       "    {'key': 'SDY1324', 'doc_count': 0},\n",
       "    {'key': 'SDY1325', 'doc_count': 0},\n",
       "    {'key': 'SDY1326', 'doc_count': 0},\n",
       "    {'key': 'SDY1327', 'doc_count': 0},\n",
       "    {'key': 'SDY1328', 'doc_count': 0},\n",
       "    {'key': 'SDY133', 'doc_count': 0},\n",
       "    {'key': 'SDY1331', 'doc_count': 0},\n",
       "    {'key': 'SDY1335', 'doc_count': 0},\n",
       "    {'key': 'SDY1337', 'doc_count': 0},\n",
       "    {'key': 'SDY134', 'doc_count': 0},\n",
       "    {'key': 'SDY1341', 'doc_count': 0},\n",
       "    {'key': 'SDY1343', 'doc_count': 0},\n",
       "    {'key': 'SDY1352', 'doc_count': 0},\n",
       "    {'key': 'SDY1361', 'doc_count': 0},\n",
       "    {'key': 'SDY1363', 'doc_count': 0},\n",
       "    {'key': 'SDY1364', 'doc_count': 0},\n",
       "    {'key': 'SDY1365', 'doc_count': 0},\n",
       "    {'key': 'SDY1368', 'doc_count': 0},\n",
       "    {'key': 'SDY1369', 'doc_count': 0},\n",
       "    {'key': 'SDY1370', 'doc_count': 0},\n",
       "    {'key': 'SDY1371', 'doc_count': 0},\n",
       "    {'key': 'SDY1373', 'doc_count': 0},\n",
       "    {'key': 'SDY1381', 'doc_count': 0},\n",
       "    {'key': 'SDY1385', 'doc_count': 0},\n",
       "    {'key': 'SDY1387', 'doc_count': 0},\n",
       "    {'key': 'SDY1389', 'doc_count': 0},\n",
       "    {'key': 'SDY139', 'doc_count': 0},\n",
       "    {'key': 'SDY1390', 'doc_count': 0},\n",
       "    {'key': 'SDY1393', 'doc_count': 0},\n",
       "    {'key': 'SDY1394', 'doc_count': 0},\n",
       "    {'key': 'SDY1395', 'doc_count': 0},\n",
       "    {'key': 'SDY1396', 'doc_count': 0},\n",
       "    {'key': 'SDY1397', 'doc_count': 0},\n",
       "    {'key': 'SDY14', 'doc_count': 0},\n",
       "    {'key': 'SDY1401', 'doc_count': 0},\n",
       "    {'key': 'SDY1402', 'doc_count': 0},\n",
       "    {'key': 'SDY1403', 'doc_count': 0},\n",
       "    {'key': 'SDY1409', 'doc_count': 0},\n",
       "    {'key': 'SDY1411', 'doc_count': 0},\n",
       "    {'key': 'SDY1412', 'doc_count': 0},\n",
       "    {'key': 'SDY1414', 'doc_count': 0},\n",
       "    {'key': 'SDY1417', 'doc_count': 0},\n",
       "    {'key': 'SDY1418', 'doc_count': 0},\n",
       "    {'key': 'SDY1424', 'doc_count': 0},\n",
       "    {'key': 'SDY1425', 'doc_count': 0},\n",
       "    {'key': 'SDY1426', 'doc_count': 0},\n",
       "    {'key': 'SDY1432', 'doc_count': 0},\n",
       "    {'key': 'SDY1433', 'doc_count': 0},\n",
       "    {'key': 'SDY1434', 'doc_count': 0},\n",
       "    {'key': 'SDY1436', 'doc_count': 0},\n",
       "    {'key': 'SDY1437', 'doc_count': 0},\n",
       "    {'key': 'SDY1439', 'doc_count': 0},\n",
       "    {'key': 'SDY144', 'doc_count': 0},\n",
       "    {'key': 'SDY1446', 'doc_count': 0},\n",
       "    {'key': 'SDY146', 'doc_count': 0},\n",
       "    {'key': 'SDY1464', 'doc_count': 0},\n",
       "    {'key': 'SDY1465', 'doc_count': 0},\n",
       "    {'key': 'SDY1466', 'doc_count': 0},\n",
       "    {'key': 'SDY1467', 'doc_count': 0},\n",
       "    {'key': 'SDY1468', 'doc_count': 0},\n",
       "    {'key': 'SDY1469', 'doc_count': 0},\n",
       "    {'key': 'SDY147', 'doc_count': 0},\n",
       "    {'key': 'SDY1471', 'doc_count': 0},\n",
       "    {'key': 'SDY1472', 'doc_count': 0},\n",
       "    {'key': 'SDY1473', 'doc_count': 0},\n",
       "    {'key': 'SDY1474', 'doc_count': 0},\n",
       "    {'key': 'SDY1475', 'doc_count': 0},\n",
       "    {'key': 'SDY1476', 'doc_count': 0},\n",
       "    {'key': 'SDY1479', 'doc_count': 0},\n",
       "    {'key': 'SDY148', 'doc_count': 0},\n",
       "    {'key': 'SDY1480', 'doc_count': 0},\n",
       "    {'key': 'SDY1481', 'doc_count': 0},\n",
       "    {'key': 'SDY1482', 'doc_count': 0},\n",
       "    {'key': 'SDY1483', 'doc_count': 0},\n",
       "    {'key': 'SDY1484', 'doc_count': 0},\n",
       "    {'key': 'SDY1485', 'doc_count': 0},\n",
       "    {'key': 'SDY1486', 'doc_count': 0},\n",
       "    {'key': 'SDY1487', 'doc_count': 0},\n",
       "    {'key': 'SDY1490', 'doc_count': 0},\n",
       "    {'key': 'SDY15', 'doc_count': 0},\n",
       "    {'key': 'SDY1502', 'doc_count': 0},\n",
       "    {'key': 'SDY1503', 'doc_count': 0},\n",
       "    {'key': 'SDY1513', 'doc_count': 0},\n",
       "    {'key': 'SDY1514', 'doc_count': 0},\n",
       "    {'key': 'SDY1515', 'doc_count': 0},\n",
       "    {'key': 'SDY1519', 'doc_count': 0},\n",
       "    {'key': 'SDY1520', 'doc_count': 0},\n",
       "    {'key': 'SDY1521', 'doc_count': 0},\n",
       "    {'key': 'SDY1522', 'doc_count': 0},\n",
       "    {'key': 'SDY1528', 'doc_count': 0},\n",
       "    {'key': 'SDY1529', 'doc_count': 0},\n",
       "    {'key': 'SDY1530', 'doc_count': 0},\n",
       "    {'key': 'SDY1533', 'doc_count': 0},\n",
       "    {'key': 'SDY1535', 'doc_count': 0},\n",
       "    {'key': 'SDY1536', 'doc_count': 0},\n",
       "    {'key': 'SDY1538', 'doc_count': 0},\n",
       "    {'key': 'SDY1544', 'doc_count': 0},\n",
       "    {'key': 'SDY1550', 'doc_count': 0},\n",
       "    {'key': 'SDY1553', 'doc_count': 0},\n",
       "    {'key': 'SDY1554', 'doc_count': 0},\n",
       "    {'key': 'SDY1555', 'doc_count': 0},\n",
       "    {'key': 'SDY1591', 'doc_count': 0},\n",
       "    {'key': 'SDY1594', 'doc_count': 0},\n",
       "    {'key': 'SDY1595', 'doc_count': 0},\n",
       "    {'key': 'SDY1596', 'doc_count': 0},\n",
       "    {'key': 'SDY1597', 'doc_count': 0},\n",
       "    {'key': 'SDY1598', 'doc_count': 0},\n",
       "    {'key': 'SDY1599', 'doc_count': 0},\n",
       "    {'key': 'SDY16', 'doc_count': 0},\n",
       "    {'key': 'SDY1600', 'doc_count': 0},\n",
       "    {'key': 'SDY1603', 'doc_count': 0},\n",
       "    {'key': 'SDY1613', 'doc_count': 0},\n",
       "    {'key': 'SDY1618', 'doc_count': 0},\n",
       "    {'key': 'SDY1619', 'doc_count': 0},\n",
       "    {'key': 'SDY162', 'doc_count': 0},\n",
       "    {'key': 'SDY1620', 'doc_count': 0},\n",
       "    {'key': 'SDY1625', 'doc_count': 0},\n",
       "    {'key': 'SDY1626', 'doc_count': 0},\n",
       "    {'key': 'SDY1627', 'doc_count': 0},\n",
       "    {'key': 'SDY1628', 'doc_count': 0},\n",
       "    {'key': 'SDY1630', 'doc_count': 0},\n",
       "    {'key': 'SDY1631', 'doc_count': 0},\n",
       "    {'key': 'SDY1632', 'doc_count': 0},\n",
       "    {'key': 'SDY1633', 'doc_count': 0},\n",
       "    {'key': 'SDY1634', 'doc_count': 0},\n",
       "    {'key': 'SDY1636', 'doc_count': 0},\n",
       "    {'key': 'SDY1637', 'doc_count': 0},\n",
       "    {'key': 'SDY1640', 'doc_count': 0},\n",
       "    {'key': 'SDY1641', 'doc_count': 0},\n",
       "    {'key': 'SDY1642', 'doc_count': 0},\n",
       "    {'key': 'SDY1644', 'doc_count': 0},\n",
       "    {'key': 'SDY1646', 'doc_count': 0},\n",
       "    {'key': 'SDY1647', 'doc_count': 0},\n",
       "    {'key': 'SDY1648', 'doc_count': 0},\n",
       "    {'key': 'SDY1649', 'doc_count': 0},\n",
       "    {'key': 'SDY165', 'doc_count': 0},\n",
       "    {'key': 'SDY1654', 'doc_count': 0},\n",
       "    {'key': 'SDY1655', 'doc_count': 0},\n",
       "    {'key': 'SDY1656', 'doc_count': 0},\n",
       "    {'key': 'SDY1657', 'doc_count': 0},\n",
       "    {'key': 'SDY1658', 'doc_count': 0},\n",
       "    {'key': 'SDY1660', 'doc_count': 0},\n",
       "    {'key': 'SDY1662', 'doc_count': 0},\n",
       "    {'key': 'SDY1666', 'doc_count': 0},\n",
       "    {'key': 'SDY1667', 'doc_count': 0},\n",
       "    {'key': 'SDY1669', 'doc_count': 0},\n",
       "    {'key': 'SDY167', 'doc_count': 0},\n",
       "    {'key': 'SDY1671', 'doc_count': 0},\n",
       "    {'key': 'SDY1672', 'doc_count': 0},\n",
       "    {'key': 'SDY1679', 'doc_count': 0},\n",
       "    {'key': 'SDY1680', 'doc_count': 0},\n",
       "    {'key': 'SDY1681', 'doc_count': 0},\n",
       "    {'key': 'SDY1683', 'doc_count': 0},\n",
       "    {'key': 'SDY1684', 'doc_count': 0},\n",
       "    {'key': 'SDY1686', 'doc_count': 0},\n",
       "    {'key': 'SDY1688', 'doc_count': 0},\n",
       "    {'key': 'SDY1689', 'doc_count': 0},\n",
       "    {'key': 'SDY1690', 'doc_count': 0},\n",
       "    {'key': 'SDY1691', 'doc_count': 0},\n",
       "    {'key': 'SDY1692', 'doc_count': 0},\n",
       "    {'key': 'SDY1693', 'doc_count': 0},\n",
       "    {'key': 'SDY1696', 'doc_count': 0},\n",
       "    {'key': 'SDY1697', 'doc_count': 0},\n",
       "    {'key': 'SDY1699', 'doc_count': 0},\n",
       "    {'key': 'SDY17', 'doc_count': 0},\n",
       "    {'key': 'SDY1700', 'doc_count': 0},\n",
       "    {'key': 'SDY1701', 'doc_count': 0},\n",
       "    {'key': 'SDY1702', 'doc_count': 0},\n",
       "    {'key': 'SDY1708', 'doc_count': 0},\n",
       "    {'key': 'SDY1710', 'doc_count': 0},\n",
       "    {'key': 'SDY1711', 'doc_count': 0},\n",
       "    {'key': 'SDY1712', 'doc_count': 0},\n",
       "    {'key': 'SDY1715', 'doc_count': 0},\n",
       "    {'key': 'SDY1720', 'doc_count': 0},\n",
       "    {'key': 'SDY1722', 'doc_count': 0},\n",
       "    {'key': 'SDY1723', 'doc_count': 0},\n",
       "    {'key': 'SDY1725', 'doc_count': 0},\n",
       "    {'key': 'SDY1726', 'doc_count': 0},\n",
       "    {'key': 'SDY1732', 'doc_count': 0},\n",
       "    {'key': 'SDY1733', 'doc_count': 0},\n",
       "    {'key': 'SDY1734', 'doc_count': 0},\n",
       "    {'key': 'SDY1737', 'doc_count': 0},\n",
       "    {'key': 'SDY1738', 'doc_count': 0},\n",
       "    {'key': 'SDY1742', 'doc_count': 0},\n",
       "    {'key': 'SDY1743', 'doc_count': 0},\n",
       "    {'key': 'SDY1752', 'doc_count': 0},\n",
       "    {'key': 'SDY1760', 'doc_count': 0},\n",
       "    {'key': 'SDY1764', 'doc_count': 0},\n",
       "    {'key': 'SDY1765', 'doc_count': 0},\n",
       "    {'key': 'SDY1767', 'doc_count': 0},\n",
       "    {'key': 'SDY1768', 'doc_count': 0},\n",
       "    {'key': 'SDY1769', 'doc_count': 0},\n",
       "    {'key': 'SDY1772', 'doc_count': 0},\n",
       "    {'key': 'SDY1773', 'doc_count': 0},\n",
       "    {'key': 'SDY1774', 'doc_count': 0},\n",
       "    {'key': 'SDY1777', 'doc_count': 0},\n",
       "    {'key': 'SDY1780', 'doc_count': 0},\n",
       "    {'key': 'SDY1781', 'doc_count': 0},\n",
       "    {'key': 'SDY1789', 'doc_count': 0},\n",
       "    {'key': 'SDY1798', 'doc_count': 0},\n",
       "    {'key': 'SDY1799', 'doc_count': 0},\n",
       "    {'key': 'SDY18', 'doc_count': 0},\n",
       "    {'key': 'SDY1800', 'doc_count': 0},\n",
       "    {'key': 'SDY1803', 'doc_count': 0},\n",
       "    {'key': 'SDY1809', 'doc_count': 0},\n",
       "    {'key': 'SDY1810', 'doc_count': 0},\n",
       "    {'key': 'SDY1812', 'doc_count': 0},\n",
       "    {'key': 'SDY1813', 'doc_count': 0},\n",
       "    {'key': 'SDY1815', 'doc_count': 0},\n",
       "    {'key': 'SDY1816', 'doc_count': 0},\n",
       "    {'key': 'SDY1818', 'doc_count': 0},\n",
       "    {'key': 'SDY1819', 'doc_count': 0},\n",
       "    {'key': 'SDY1821', 'doc_count': 0},\n",
       "    {'key': 'SDY1828', 'doc_count': 0},\n",
       "    {'key': 'SDY1829', 'doc_count': 0},\n",
       "    {'key': 'SDY183', 'doc_count': 0},\n",
       "    {'key': 'SDY1831', 'doc_count': 0},\n",
       "    {'key': 'SDY1832', 'doc_count': 0},\n",
       "    {'key': 'SDY1835', 'doc_count': 0},\n",
       "    {'key': 'SDY1840', 'doc_count': 0},\n",
       "    {'key': 'SDY1844', 'doc_count': 0},\n",
       "    {'key': 'SDY1845', 'doc_count': 0},\n",
       "    {'key': 'SDY1848', 'doc_count': 0},\n",
       "    {'key': 'SDY1849', 'doc_count': 0},\n",
       "    {'key': 'SDY1850', 'doc_count': 0},\n",
       "    {'key': 'SDY1851', 'doc_count': 0},\n",
       "    {'key': 'SDY1852', 'doc_count': 0},\n",
       "    {'key': 'SDY1854', 'doc_count': 0},\n",
       "    {'key': 'SDY1862', 'doc_count': 0},\n",
       "    {'key': 'SDY1863', 'doc_count': 0},\n",
       "    {'key': 'SDY1868', 'doc_count': 0},\n",
       "    {'key': 'SDY1869', 'doc_count': 0},\n",
       "    {'key': 'SDY1870', 'doc_count': 0},\n",
       "    {'key': 'SDY1871', 'doc_count': 0},\n",
       "    {'key': 'SDY1872', 'doc_count': 0},\n",
       "    {'key': 'SDY1873', 'doc_count': 0},\n",
       "    {'key': 'SDY1876', 'doc_count': 0},\n",
       "    {'key': 'SDY1877', 'doc_count': 0},\n",
       "    {'key': 'SDY1879', 'doc_count': 0},\n",
       "    {'key': 'SDY1880', 'doc_count': 0},\n",
       "    {'key': 'SDY1881', 'doc_count': 0},\n",
       "    {'key': 'SDY1882', 'doc_count': 0},\n",
       "    {'key': 'SDY1883', 'doc_count': 0},\n",
       "    {'key': 'SDY1884', 'doc_count': 0},\n",
       "    {'key': 'SDY1885', 'doc_count': 0},\n",
       "    {'key': 'SDY1886', 'doc_count': 0},\n",
       "    {'key': 'SDY1887', 'doc_count': 0},\n",
       "    {'key': 'SDY1889', 'doc_count': 0},\n",
       "    {'key': 'SDY1890', 'doc_count': 0},\n",
       "    {'key': 'SDY1898', 'doc_count': 0},\n",
       "    {'key': 'SDY1899', 'doc_count': 0},\n",
       "    {'key': 'SDY19', 'doc_count': 0},\n",
       "    {'key': 'SDY1900', 'doc_count': 0},\n",
       "    {'key': 'SDY1902', 'doc_count': 0},\n",
       "    {'key': 'SDY1903', 'doc_count': 0},\n",
       "    {'key': 'SDY1904', 'doc_count': 0},\n",
       "    {'key': 'SDY1909', 'doc_count': 0},\n",
       "    {'key': 'SDY1912', 'doc_count': 0},\n",
       "    {'key': 'SDY1916', 'doc_count': 0},\n",
       "    {'key': 'SDY1917', 'doc_count': 0},\n",
       "    {'key': 'SDY1924', 'doc_count': 0},\n",
       "    {'key': 'SDY1927', 'doc_count': 0},\n",
       "    {'key': 'SDY1928', 'doc_count': 0},\n",
       "    {'key': 'SDY1930', 'doc_count': 0},\n",
       "    {'key': 'SDY1931', 'doc_count': 0},\n",
       "    {'key': 'SDY1932', 'doc_count': 0},\n",
       "    {'key': 'SDY1936', 'doc_count': 0},\n",
       "    {'key': 'SDY1937', 'doc_count': 0},\n",
       "    {'key': 'SDY1938', 'doc_count': 0},\n",
       "    {'key': 'SDY194', 'doc_count': 0},\n",
       "    {'key': 'SDY1944', 'doc_count': 0},\n",
       "    {'key': 'SDY1945', 'doc_count': 0},\n",
       "    {'key': 'SDY1947', 'doc_count': 0},\n",
       "    {'key': 'SDY196', 'doc_count': 0},\n",
       "    {'key': 'SDY1960', 'doc_count': 0},\n",
       "    {'key': 'SDY1961', 'doc_count': 0},\n",
       "    {'key': 'SDY1962', 'doc_count': 0},\n",
       "    {'key': 'SDY1963', 'doc_count': 0},\n",
       "    {'key': 'SDY1964', 'doc_count': 0},\n",
       "    {'key': 'SDY1965', 'doc_count': 0},\n",
       "    {'key': 'SDY1966', 'doc_count': 0},\n",
       "    {'key': 'SDY1967', 'doc_count': 0},\n",
       "    {'key': 'SDY1968', 'doc_count': 0},\n",
       "    {'key': 'SDY1969', 'doc_count': 0},\n",
       "    {'key': 'SDY197', 'doc_count': 0},\n",
       "    {'key': 'SDY1971', 'doc_count': 0},\n",
       "    {'key': 'SDY1972', 'doc_count': 0},\n",
       "    {'key': 'SDY1973', 'doc_count': 0},\n",
       "    {'key': 'SDY1974', 'doc_count': 0},\n",
       "    {'key': 'SDY1975', 'doc_count': 0},\n",
       "    {'key': 'SDY1976', 'doc_count': 0},\n",
       "    {'key': 'SDY1977', 'doc_count': 0},\n",
       "    {'key': 'SDY1978', 'doc_count': 0},\n",
       "    {'key': 'SDY198', 'doc_count': 0},\n",
       "    {'key': 'SDY1980', 'doc_count': 0},\n",
       "    {'key': 'SDY199', 'doc_count': 0},\n",
       "    {'key': 'SDY1990', 'doc_count': 0},\n",
       "    {'key': 'SDY1991', 'doc_count': 0},\n",
       "    {'key': 'SDY1995', 'doc_count': 0},\n",
       "    {'key': 'SDY1997', 'doc_count': 0},\n",
       "    {'key': 'SDY1998', 'doc_count': 0},\n",
       "    {'key': 'SDY2', 'doc_count': 0},\n",
       "    {'key': 'SDY20', 'doc_count': 0},\n",
       "    {'key': 'SDY200', 'doc_count': 0},\n",
       "    {'key': 'SDY2002', 'doc_count': 0},\n",
       "    {'key': 'SDY2007', 'doc_count': 0},\n",
       "    {'key': 'SDY201', 'doc_count': 0},\n",
       "    {'key': 'SDY2011', 'doc_count': 0},\n",
       "    {'key': 'SDY2012', 'doc_count': 0},\n",
       "    {'key': 'SDY2015', 'doc_count': 0},\n",
       "    {'key': 'SDY2016', 'doc_count': 0},\n",
       "    {'key': 'SDY202', 'doc_count': 0},\n",
       "    {'key': 'SDY2024', 'doc_count': 0},\n",
       "    {'key': 'SDY2026', 'doc_count': 0},\n",
       "    {'key': 'SDY2033', 'doc_count': 0},\n",
       "    {'key': 'SDY2034', 'doc_count': 0},\n",
       "    {'key': 'SDY2035', 'doc_count': 0},\n",
       "    {'key': 'SDY2036', 'doc_count': 0},\n",
       "    {'key': 'SDY2037', 'doc_count': 0},\n",
       "    {'key': 'SDY2038', 'doc_count': 0},\n",
       "    {'key': 'SDY2039', 'doc_count': 0},\n",
       "    {'key': 'SDY2040', 'doc_count': 0},\n",
       "    {'key': 'SDY2041', 'doc_count': 0},\n",
       "    {'key': 'SDY2042', 'doc_count': 0},\n",
       "    {'key': 'SDY2043', 'doc_count': 0},\n",
       "    {'key': 'SDY2044', 'doc_count': 0},\n",
       "    {'key': 'SDY2045', 'doc_count': 0},\n",
       "    {'key': 'SDY2047', 'doc_count': 0},\n",
       "    {'key': 'SDY2052', 'doc_count': 0},\n",
       "    {'key': 'SDY2053', 'doc_count': 0},\n",
       "    {'key': 'SDY2058', 'doc_count': 0},\n",
       "    {'key': 'SDY2060', 'doc_count': 0},\n",
       "    {'key': 'SDY207', 'doc_count': 0},\n",
       "    {'key': 'SDY2075', 'doc_count': 0},\n",
       "    {'key': 'SDY2079', 'doc_count': 0},\n",
       "    {'key': 'SDY208', 'doc_count': 0},\n",
       "    {'key': 'SDY21', 'doc_count': 0},\n",
       "    {'key': 'SDY210', 'doc_count': 0},\n",
       "    {'key': 'SDY2107', 'doc_count': 0},\n",
       "    {'key': 'SDY2108', 'doc_count': 0},\n",
       "    {'key': 'SDY211', 'doc_count': 0},\n",
       "    {'key': 'SDY2111', 'doc_count': 0},\n",
       "    {'key': 'SDY2112', 'doc_count': 0},\n",
       "    {'key': 'SDY2113', 'doc_count': 0},\n",
       "    {'key': 'SDY2114', 'doc_count': 0},\n",
       "    {'key': 'SDY2115', 'doc_count': 0},\n",
       "    {'key': 'SDY2116', 'doc_count': 0},\n",
       "    {'key': 'SDY2117', 'doc_count': 0},\n",
       "    {'key': 'SDY2118', 'doc_count': 0},\n",
       "    {'key': 'SDY2119', 'doc_count': 0},\n",
       "    {'key': 'SDY212', 'doc_count': 0},\n",
       "    {'key': 'SDY2120', 'doc_count': 0},\n",
       "    {'key': 'SDY2121', 'doc_count': 0},\n",
       "    {'key': 'SDY2122', 'doc_count': 0},\n",
       "    {'key': 'SDY2124', 'doc_count': 0},\n",
       "    {'key': 'SDY2125', 'doc_count': 0},\n",
       "    {'key': 'SDY2126', 'doc_count': 0},\n",
       "    {'key': 'SDY2127', 'doc_count': 0},\n",
       "    {'key': 'SDY2129', 'doc_count': 0},\n",
       "    {'key': 'SDY2130', 'doc_count': 0},\n",
       "    {'key': 'SDY2131', 'doc_count': 0},\n",
       "    {'key': 'SDY2132', 'doc_count': 0},\n",
       "    {'key': 'SDY2133', 'doc_count': 0},\n",
       "    {'key': 'SDY2134', 'doc_count': 0},\n",
       "    {'key': 'SDY2135', 'doc_count': 0},\n",
       "    {'key': 'SDY214', 'doc_count': 0},\n",
       "    {'key': 'SDY2141', 'doc_count': 0},\n",
       "    {'key': 'SDY215', 'doc_count': 0},\n",
       "    {'key': 'SDY2157', 'doc_count': 0},\n",
       "    {'key': 'SDY2158', 'doc_count': 0},\n",
       "    {'key': 'SDY2159', 'doc_count': 0},\n",
       "    {'key': 'SDY216', 'doc_count': 0},\n",
       "    {'key': 'SDY2165', 'doc_count': 0},\n",
       "    {'key': 'SDY2166', 'doc_count': 0},\n",
       "    {'key': 'SDY2167', 'doc_count': 0},\n",
       "    {'key': 'SDY2168', 'doc_count': 0},\n",
       "    {'key': 'SDY2169', 'doc_count': 0},\n",
       "    {'key': 'SDY217', 'doc_count': 0},\n",
       "    {'key': 'SDY2170', 'doc_count': 0},\n",
       "    {'key': 'SDY2171', 'doc_count': 0},\n",
       "    {'key': 'SDY2172', 'doc_count': 0},\n",
       "    {'key': 'SDY2173', 'doc_count': 0},\n",
       "    {'key': 'SDY2174', 'doc_count': 0},\n",
       "    {'key': 'SDY2176', 'doc_count': 0},\n",
       "    {'key': 'SDY2177', 'doc_count': 0},\n",
       "    {'key': 'SDY218', 'doc_count': 0},\n",
       "    {'key': 'SDY2187', 'doc_count': 0},\n",
       "    {'key': 'SDY2188', 'doc_count': 0},\n",
       "    {'key': 'SDY2189', 'doc_count': 0},\n",
       "    {'key': 'SDY2193', 'doc_count': 0},\n",
       "    {'key': 'SDY2195', 'doc_count': 0},\n",
       "    {'key': 'SDY2196', 'doc_count': 0},\n",
       "    {'key': 'SDY22', 'doc_count': 0},\n",
       "    {'key': 'SDY2209', 'doc_count': 0},\n",
       "    {'key': 'SDY2210', 'doc_count': 0},\n",
       "    {'key': 'SDY2213', 'doc_count': 0},\n",
       "    {'key': 'SDY2216', 'doc_count': 0},\n",
       "    {'key': 'SDY2220', 'doc_count': 0},\n",
       "    {'key': 'SDY2221', 'doc_count': 0},\n",
       "    {'key': 'SDY2222', 'doc_count': 0},\n",
       "    {'key': 'SDY2224', 'doc_count': 0},\n",
       "    {'key': 'SDY2225', 'doc_count': 0},\n",
       "    {'key': 'SDY2226', 'doc_count': 0},\n",
       "    {'key': 'SDY2227', 'doc_count': 0},\n",
       "    {'key': 'SDY2228', 'doc_count': 0},\n",
       "    {'key': 'SDY2229', 'doc_count': 0},\n",
       "    {'key': 'SDY223', 'doc_count': 0},\n",
       "    {'key': 'SDY2230', 'doc_count': 0},\n",
       "    {'key': 'SDY2231', 'doc_count': 0},\n",
       "    {'key': 'SDY2232', 'doc_count': 0},\n",
       "    {'key': 'SDY2233', 'doc_count': 0},\n",
       "    {'key': 'SDY2234', 'doc_count': 0},\n",
       "    {'key': 'SDY2236', 'doc_count': 0},\n",
       "    {'key': 'SDY2238', 'doc_count': 0},\n",
       "    {'key': 'SDY2239', 'doc_count': 0},\n",
       "    {'key': 'SDY224', 'doc_count': 0},\n",
       "    {'key': 'SDY2240', 'doc_count': 0},\n",
       "    {'key': 'SDY2241', 'doc_count': 0},\n",
       "    {'key': 'SDY2242', 'doc_count': 0},\n",
       "    {'key': 'SDY2243', 'doc_count': 0},\n",
       "    {'key': 'SDY2244', 'doc_count': 0},\n",
       "    {'key': 'SDY2245', 'doc_count': 0},\n",
       "    {'key': 'SDY2246', 'doc_count': 0},\n",
       "    {'key': 'SDY2247', 'doc_count': 0},\n",
       "    {'key': 'SDY2248', 'doc_count': 0},\n",
       "    {'key': 'SDY2249', 'doc_count': 0},\n",
       "    {'key': 'SDY225', 'doc_count': 0},\n",
       "    {'key': 'SDY2250', 'doc_count': 0},\n",
       "    {'key': 'SDY2251', 'doc_count': 0},\n",
       "    {'key': 'SDY2252', 'doc_count': 0},\n",
       "    {'key': 'SDY2253', 'doc_count': 0},\n",
       "    {'key': 'SDY2254', 'doc_count': 0},\n",
       "    {'key': 'SDY2255', 'doc_count': 0},\n",
       "    {'key': 'SDY2256', 'doc_count': 0},\n",
       "    {'key': 'SDY2257', 'doc_count': 0},\n",
       "    {'key': 'SDY2258', 'doc_count': 0},\n",
       "    {'key': 'SDY2259', 'doc_count': 0},\n",
       "    {'key': 'SDY226', 'doc_count': 0},\n",
       "    {'key': 'SDY2260', 'doc_count': 0},\n",
       "    {'key': 'SDY2261', 'doc_count': 0},\n",
       "    {'key': 'SDY2262', 'doc_count': 0},\n",
       "    {'key': 'SDY2263', 'doc_count': 0},\n",
       "    {'key': 'SDY2266', 'doc_count': 0},\n",
       "    {'key': 'SDY2267', 'doc_count': 0},\n",
       "    {'key': 'SDY2268', 'doc_count': 0},\n",
       "    {'key': 'SDY2270', 'doc_count': 0},\n",
       "    {'key': 'SDY2274', 'doc_count': 0},\n",
       "    {'key': 'SDY2275', 'doc_count': 0},\n",
       "    {'key': 'SDY2277', 'doc_count': 0},\n",
       "    {'key': 'SDY2279', 'doc_count': 0},\n",
       "    {'key': 'SDY2281', 'doc_count': 0},\n",
       "    {'key': 'SDY2282', 'doc_count': 0},\n",
       "    {'key': 'SDY2286', 'doc_count': 0},\n",
       "    {'key': 'SDY2295', 'doc_count': 0},\n",
       "    {'key': 'SDY2299', 'doc_count': 0},\n",
       "    {'key': 'SDY23', 'doc_count': 0},\n",
       "    {'key': 'SDY230', 'doc_count': 0},\n",
       "    {'key': 'SDY2306', 'doc_count': 0},\n",
       "    {'key': 'SDY2310', 'doc_count': 0},\n",
       "    {'key': 'SDY2311', 'doc_count': 0},\n",
       "    {'key': 'SDY2312', 'doc_count': 0},\n",
       "    {'key': 'SDY2314', 'doc_count': 0},\n",
       "    {'key': 'SDY2315', 'doc_count': 0},\n",
       "    {'key': 'SDY2316', 'doc_count': 0},\n",
       "    {'key': 'SDY2317', 'doc_count': 0},\n",
       "    {'key': 'SDY2319', 'doc_count': 0},\n",
       "    {'key': 'SDY232', 'doc_count': 0},\n",
       "    {'key': 'SDY2320', 'doc_count': 0},\n",
       "    {'key': 'SDY2321', 'doc_count': 0},\n",
       "    {'key': 'SDY2323', 'doc_count': 0},\n",
       "    {'key': 'SDY2324', 'doc_count': 0},\n",
       "    {'key': 'SDY2325', 'doc_count': 0},\n",
       "    {'key': 'SDY2326', 'doc_count': 0},\n",
       "    {'key': 'SDY2327', 'doc_count': 0},\n",
       "    {'key': 'SDY2328', 'doc_count': 0},\n",
       "    {'key': 'SDY2329', 'doc_count': 0},\n",
       "    {'key': 'SDY2330', 'doc_count': 0},\n",
       "    {'key': 'SDY2331', 'doc_count': 0},\n",
       "    {'key': 'SDY2332', 'doc_count': 0},\n",
       "    {'key': 'SDY2333', 'doc_count': 0},\n",
       "    {'key': 'SDY2334', 'doc_count': 0},\n",
       "    {'key': 'SDY2335', 'doc_count': 0},\n",
       "    {'key': 'SDY2336', 'doc_count': 0},\n",
       "    {'key': 'SDY2337', 'doc_count': 0},\n",
       "    {'key': 'SDY2338', 'doc_count': 0},\n",
       "    {'key': 'SDY2339', 'doc_count': 0},\n",
       "    {'key': 'SDY2340', 'doc_count': 0},\n",
       "    {'key': 'SDY2341', 'doc_count': 0},\n",
       "    {'key': 'SDY2342', 'doc_count': 0},\n",
       "    {'key': 'SDY2343', 'doc_count': 0},\n",
       "    {'key': 'SDY2344', 'doc_count': 0},\n",
       "    {'key': 'SDY2345', 'doc_count': 0},\n",
       "    {'key': 'SDY2346', 'doc_count': 0},\n",
       "    {'key': 'SDY2347', 'doc_count': 0},\n",
       "    {'key': 'SDY2348', 'doc_count': 0},\n",
       "    {'key': 'SDY2349', 'doc_count': 0},\n",
       "    {'key': 'SDY2350', 'doc_count': 0},\n",
       "    {'key': 'SDY2351', 'doc_count': 0},\n",
       "    {'key': 'SDY2352', 'doc_count': 0},\n",
       "    {'key': 'SDY2353', 'doc_count': 0},\n",
       "    {'key': 'SDY2354', 'doc_count': 0},\n",
       "    {'key': 'SDY2355', 'doc_count': 0},\n",
       "    {'key': 'SDY2356', 'doc_count': 0},\n",
       "    {'key': 'SDY2357', 'doc_count': 0},\n",
       "    {'key': 'SDY2361', 'doc_count': 0},\n",
       "    {'key': 'SDY2362', 'doc_count': 0},\n",
       "    {'key': 'SDY2363', 'doc_count': 0},\n",
       "    {'key': 'SDY2364', 'doc_count': 0},\n",
       "    {'key': 'SDY2365', 'doc_count': 0},\n",
       "    {'key': 'SDY2367', 'doc_count': 0},\n",
       "    {'key': 'SDY2369', 'doc_count': 0},\n",
       "    {'key': 'SDY2371', 'doc_count': 0},\n",
       "    {'key': 'SDY2372', 'doc_count': 0},\n",
       "    {'key': 'SDY2373', 'doc_count': 0},\n",
       "    {'key': 'SDY2374', 'doc_count': 0},\n",
       "    {'key': 'SDY2375', 'doc_count': 0},\n",
       "    {'key': 'SDY2376', 'doc_count': 0},\n",
       "    {'key': 'SDY2377', 'doc_count': 0},\n",
       "    {'key': 'SDY2378', 'doc_count': 0},\n",
       "    {'key': 'SDY2379', 'doc_count': 0},\n",
       "    {'key': 'SDY2380', 'doc_count': 0},\n",
       "    {'key': 'SDY2381', 'doc_count': 0},\n",
       "    {'key': 'SDY2382', 'doc_count': 0},\n",
       "    {'key': 'SDY2383', 'doc_count': 0},\n",
       "    {'key': 'SDY2384', 'doc_count': 0},\n",
       "    {'key': 'SDY2385', 'doc_count': 0},\n",
       "    {'key': 'SDY2386', 'doc_count': 0},\n",
       "    {'key': 'SDY2387', 'doc_count': 0},\n",
       "    {'key': 'SDY2388', 'doc_count': 0},\n",
       "    {'key': 'SDY2389', 'doc_count': 0},\n",
       "    {'key': 'SDY2390', 'doc_count': 0},\n",
       "    {'key': 'SDY2393', 'doc_count': 0},\n",
       "    {'key': 'SDY2394', 'doc_count': 0},\n",
       "    {'key': 'SDY2397', 'doc_count': 0},\n",
       "    {'key': 'SDY2398', 'doc_count': 0},\n",
       "    {'key': 'SDY2399', 'doc_count': 0},\n",
       "    {'key': 'SDY24', 'doc_count': 0},\n",
       "    {'key': 'SDY2400', 'doc_count': 0},\n",
       "    {'key': 'SDY2401', 'doc_count': 0},\n",
       "    {'key': 'SDY2402', 'doc_count': 0},\n",
       "    {'key': 'SDY2403', 'doc_count': 0},\n",
       "    {'key': 'SDY2404', 'doc_count': 0},\n",
       "    {'key': 'SDY2405', 'doc_count': 0},\n",
       "    {'key': 'SDY2406', 'doc_count': 0},\n",
       "    {'key': 'SDY2407', 'doc_count': 0},\n",
       "    {'key': 'SDY2408', 'doc_count': 0},\n",
       "    {'key': 'SDY2409', 'doc_count': 0},\n",
       "    {'key': 'SDY241', 'doc_count': 0},\n",
       "    {'key': 'SDY2411', 'doc_count': 0},\n",
       "    {'key': 'SDY2412', 'doc_count': 0},\n",
       "    {'key': 'SDY2421', 'doc_count': 0},\n",
       "    {'key': 'SDY2422', 'doc_count': 0},\n",
       "    {'key': 'SDY2424', 'doc_count': 0},\n",
       "    {'key': 'SDY2425', 'doc_count': 0},\n",
       "    {'key': 'SDY2427', 'doc_count': 0},\n",
       "    {'key': 'SDY2428', 'doc_count': 0},\n",
       "    {'key': 'SDY2429', 'doc_count': 0},\n",
       "    {'key': 'SDY2431', 'doc_count': 0},\n",
       "    {'key': 'SDY2432', 'doc_count': 0},\n",
       "    {'key': 'SDY2433', 'doc_count': 0},\n",
       "    {'key': 'SDY2434', 'doc_count': 0},\n",
       "    {'key': 'SDY2436', 'doc_count': 0},\n",
       "    {'key': 'SDY2437', 'doc_count': 0},\n",
       "    {'key': 'SDY2438', 'doc_count': 0},\n",
       "    {'key': 'SDY2439', 'doc_count': 0},\n",
       "    {'key': 'SDY2440', 'doc_count': 0},\n",
       "    {'key': 'SDY2441', 'doc_count': 0},\n",
       "    {'key': 'SDY2442', 'doc_count': 0},\n",
       "    {'key': 'SDY2444', 'doc_count': 0},\n",
       "    {'key': 'SDY2445', 'doc_count': 0},\n",
       "    {'key': 'SDY2446', 'doc_count': 0},\n",
       "    {'key': 'SDY2447', 'doc_count': 0},\n",
       "    {'key': 'SDY2448', 'doc_count': 0},\n",
       "    {'key': 'SDY2449', 'doc_count': 0},\n",
       "    {'key': 'SDY2450', 'doc_count': 0},\n",
       "    {'key': 'SDY2451', 'doc_count': 0},\n",
       "    {'key': 'SDY2452', 'doc_count': 0},\n",
       "    {'key': 'SDY2453', 'doc_count': 0},\n",
       "    {'key': 'SDY2454', 'doc_count': 0},\n",
       "    {'key': 'SDY2459', 'doc_count': 0},\n",
       "    {'key': 'SDY2463', 'doc_count': 0},\n",
       "    {'key': 'SDY2464', 'doc_count': 0},\n",
       "    {'key': 'SDY2465', 'doc_count': 0},\n",
       "    {'key': 'SDY2466', 'doc_count': 0},\n",
       "    {'key': 'SDY2468', 'doc_count': 0},\n",
       "    {'key': 'SDY2470', 'doc_count': 0},\n",
       "    {'key': 'SDY2471', 'doc_count': 0},\n",
       "    {'key': 'SDY2472', 'doc_count': 0},\n",
       "    {'key': 'SDY2473', 'doc_count': 0},\n",
       "    {'key': 'SDY2474', 'doc_count': 0},\n",
       "    {'key': 'SDY2475', 'doc_count': 0},\n",
       "    {'key': 'SDY2476', 'doc_count': 0},\n",
       "    {'key': 'SDY2477', 'doc_count': 0},\n",
       "    {'key': 'SDY2478', 'doc_count': 0},\n",
       "    {'key': 'SDY2479', 'doc_count': 0},\n",
       "    {'key': 'SDY2480', 'doc_count': 0},\n",
       "    {'key': 'SDY2481', 'doc_count': 0},\n",
       "    {'key': 'SDY2482', 'doc_count': 0},\n",
       "    {'key': 'SDY2483', 'doc_count': 0},\n",
       "    {'key': 'SDY2484', 'doc_count': 0},\n",
       "    {'key': 'SDY2485', 'doc_count': 0},\n",
       "    {'key': 'SDY2486', 'doc_count': 0},\n",
       "    {'key': 'SDY2487', 'doc_count': 0},\n",
       "    {'key': 'SDY2488', 'doc_count': 0},\n",
       "    {'key': 'SDY2489', 'doc_count': 0},\n",
       "    {'key': 'SDY2490', 'doc_count': 0},\n",
       "    {'key': 'SDY2491', 'doc_count': 0},\n",
       "    {'key': 'SDY2492', 'doc_count': 0},\n",
       "    {'key': 'SDY2497', 'doc_count': 0},\n",
       "    {'key': 'SDY25', 'doc_count': 0},\n",
       "    {'key': 'SDY2500', 'doc_count': 0},\n",
       "    {'key': 'SDY2507', 'doc_count': 0},\n",
       "    {'key': 'SDY2509', 'doc_count': 0},\n",
       "    {'key': 'SDY2510', 'doc_count': 0},\n",
       "    {'key': 'SDY2511', 'doc_count': 0},\n",
       "    {'key': 'SDY2516', 'doc_count': 0},\n",
       "    {'key': 'SDY2517', 'doc_count': 0},\n",
       "    {'key': 'SDY2518', 'doc_count': 0},\n",
       "    {'key': 'SDY2519', 'doc_count': 0},\n",
       "    {'key': 'SDY2520', 'doc_count': 0},\n",
       "    {'key': 'SDY2521', 'doc_count': 0},\n",
       "    {'key': 'SDY2522', 'doc_count': 0},\n",
       "    {'key': 'SDY2523', 'doc_count': 0},\n",
       "    {'key': 'SDY2524', 'doc_count': 0},\n",
       "    {'key': 'SDY2525', 'doc_count': 0},\n",
       "    {'key': 'SDY2526', 'doc_count': 0},\n",
       "    {'key': 'SDY2527', 'doc_count': 0},\n",
       "    {'key': 'SDY2529', 'doc_count': 0},\n",
       "    {'key': 'SDY2530', 'doc_count': 0},\n",
       "    {'key': 'SDY2531', 'doc_count': 0},\n",
       "    {'key': 'SDY2532', 'doc_count': 0},\n",
       "    {'key': 'SDY2533', 'doc_count': 0},\n",
       "    {'key': 'SDY2534', 'doc_count': 0},\n",
       "    {'key': 'SDY2537', 'doc_count': 0},\n",
       "    {'key': 'SDY2540', 'doc_count': 0},\n",
       "    {'key': 'SDY2541', 'doc_count': 0},\n",
       "    {'key': 'SDY2543', 'doc_count': 0},\n",
       "    {'key': 'SDY2544', 'doc_count': 0},\n",
       "    {'key': 'SDY2545', 'doc_count': 0},\n",
       "    {'key': 'SDY2546', 'doc_count': 0},\n",
       "    {'key': 'SDY2547', 'doc_count': 0},\n",
       "    {'key': 'SDY2548', 'doc_count': 0},\n",
       "    {'key': 'SDY2549', 'doc_count': 0},\n",
       "    {'key': 'SDY2550', 'doc_count': 0},\n",
       "    {'key': 'SDY2551', 'doc_count': 0},\n",
       "    {'key': 'SDY2552', 'doc_count': 0},\n",
       "    {'key': 'SDY2553', 'doc_count': 0},\n",
       "    {'key': 'SDY2554', 'doc_count': 0},\n",
       "    {'key': 'SDY2555', 'doc_count': 0},\n",
       "    {'key': 'SDY2556', 'doc_count': 0},\n",
       "    {'key': 'SDY2557', 'doc_count': 0},\n",
       "    {'key': 'SDY2558', 'doc_count': 0},\n",
       "    {'key': 'SDY2559', 'doc_count': 0},\n",
       "    {'key': 'SDY256', 'doc_count': 0},\n",
       "    {'key': 'SDY2561', 'doc_count': 0},\n",
       "    {'key': 'SDY2562', 'doc_count': 0},\n",
       "    {'key': 'SDY2563', 'doc_count': 0},\n",
       "    {'key': 'SDY2564', 'doc_count': 0},\n",
       "    {'key': 'SDY2565', 'doc_count': 0},\n",
       "    {'key': 'SDY2566', 'doc_count': 0},\n",
       "    {'key': 'SDY2574', 'doc_count': 0},\n",
       "    {'key': 'SDY2575', 'doc_count': 0},\n",
       "    {'key': 'SDY2576', 'doc_count': 0},\n",
       "    {'key': 'SDY2577', 'doc_count': 0},\n",
       "    {'key': 'SDY2578', 'doc_count': 0},\n",
       "    {'key': 'SDY2579', 'doc_count': 0},\n",
       "    {'key': 'SDY258', 'doc_count': 0},\n",
       "    {'key': 'SDY2580', 'doc_count': 0},\n",
       "    {'key': 'SDY2581', 'doc_count': 0},\n",
       "    {'key': 'SDY2582', 'doc_count': 0},\n",
       "    {'key': 'SDY2583', 'doc_count': 0},\n",
       "    {'key': 'SDY2584', 'doc_count': 0},\n",
       "    {'key': 'SDY2586', 'doc_count': 0},\n",
       "    {'key': 'SDY259', 'doc_count': 0},\n",
       "    {'key': 'SDY2591', 'doc_count': 0},\n",
       "    {'key': 'SDY2592', 'doc_count': 0},\n",
       "    {'key': 'SDY2593', 'doc_count': 0},\n",
       "    {'key': 'SDY2594', 'doc_count': 0},\n",
       "    {'key': 'SDY2596', 'doc_count': 0},\n",
       "    {'key': 'SDY2597', 'doc_count': 0},\n",
       "    {'key': 'SDY2598', 'doc_count': 0},\n",
       "    {'key': 'SDY2599', 'doc_count': 0},\n",
       "    {'key': 'SDY26', 'doc_count': 0},\n",
       "    {'key': 'SDY260', 'doc_count': 0},\n",
       "    {'key': 'SDY2600', 'doc_count': 0},\n",
       "    {'key': 'SDY2601', 'doc_count': 0},\n",
       "    {'key': 'SDY2602', 'doc_count': 0},\n",
       "    {'key': 'SDY2603', 'doc_count': 0},\n",
       "    {'key': 'SDY2604', 'doc_count': 0},\n",
       "    {'key': 'SDY2605', 'doc_count': 0},\n",
       "    {'key': 'SDY2606', 'doc_count': 0},\n",
       "    {'key': 'SDY2607', 'doc_count': 0},\n",
       "    {'key': 'SDY2608', 'doc_count': 0},\n",
       "    {'key': 'SDY2609', 'doc_count': 0},\n",
       "    {'key': 'SDY261', 'doc_count': 0},\n",
       "    {'key': 'SDY2610', 'doc_count': 0},\n",
       "    {'key': 'SDY2611', 'doc_count': 0},\n",
       "    {'key': 'SDY2612', 'doc_count': 0},\n",
       "    {'key': 'SDY2614', 'doc_count': 0},\n",
       "    {'key': 'SDY2617', 'doc_count': 0},\n",
       "    {'key': 'SDY2618', 'doc_count': 0},\n",
       "    {'key': 'SDY262', 'doc_count': 0},\n",
       "    {'key': 'SDY2621', 'doc_count': 0},\n",
       "    {'key': 'SDY2629', 'doc_count': 0},\n",
       "    {'key': 'SDY2631', 'doc_count': 0},\n",
       "    {'key': 'SDY2632', 'doc_count': 0},\n",
       "    {'key': 'SDY2633', 'doc_count': 0},\n",
       "    {'key': 'SDY2634', 'doc_count': 0},\n",
       "    {'key': 'SDY2635', 'doc_count': 0},\n",
       "    {'key': 'SDY2636', 'doc_count': 0},\n",
       "    {'key': 'SDY2637', 'doc_count': 0},\n",
       "    {'key': 'SDY2638', 'doc_count': 0},\n",
       "    {'key': 'SDY2639', 'doc_count': 0},\n",
       "    {'key': 'SDY264', 'doc_count': 0},\n",
       "    {'key': 'SDY2640', 'doc_count': 0},\n",
       "    {'key': 'SDY2641', 'doc_count': 0},\n",
       "    {'key': 'SDY2642', 'doc_count': 0},\n",
       "    {'key': 'SDY2643', 'doc_count': 0},\n",
       "    {'key': 'SDY2644', 'doc_count': 0},\n",
       "    {'key': 'SDY2645', 'doc_count': 0},\n",
       "    {'key': 'SDY2646', 'doc_count': 0},\n",
       "    {'key': 'SDY2647', 'doc_count': 0},\n",
       "    {'key': 'SDY2648', 'doc_count': 0},\n",
       "    {'key': 'SDY2649', 'doc_count': 0},\n",
       "    {'key': 'SDY2650', 'doc_count': 0},\n",
       "    {'key': 'SDY2651', 'doc_count': 0},\n",
       "    {'key': 'SDY2652', 'doc_count': 0},\n",
       "    {'key': 'SDY2653', 'doc_count': 0},\n",
       "    {'key': 'SDY2654', 'doc_count': 0},\n",
       "    {'key': 'SDY2655', 'doc_count': 0},\n",
       "    {'key': 'SDY2656', 'doc_count': 0},\n",
       "    {'key': 'SDY2657', 'doc_count': 0},\n",
       "    {'key': 'SDY2658', 'doc_count': 0},\n",
       "    {'key': 'SDY2659', 'doc_count': 0},\n",
       "    {'key': 'SDY2660', 'doc_count': 0},\n",
       "    {'key': 'SDY2661', 'doc_count': 0},\n",
       "    {'key': 'SDY2662', 'doc_count': 0},\n",
       "    {'key': 'SDY2663', 'doc_count': 0},\n",
       "    {'key': 'SDY2665', 'doc_count': 0},\n",
       "    {'key': 'SDY2666', 'doc_count': 0},\n",
       "    {'key': 'SDY2672', 'doc_count': 0},\n",
       "    {'key': 'SDY2673', 'doc_count': 0},\n",
       "    {'key': 'SDY2674', 'doc_count': 0},\n",
       "    {'key': 'SDY2675', 'doc_count': 0},\n",
       "    {'key': 'SDY2676', 'doc_count': 0},\n",
       "    {'key': 'SDY2677', 'doc_count': 0},\n",
       "    {'key': 'SDY2678', 'doc_count': 0},\n",
       "    {'key': 'SDY2679', 'doc_count': 0},\n",
       "    {'key': 'SDY268', 'doc_count': 0},\n",
       "    {'key': 'SDY2680', 'doc_count': 0},\n",
       "    {'key': 'SDY2682', 'doc_count': 0},\n",
       "    {'key': 'SDY2683', 'doc_count': 0},\n",
       "    {'key': 'SDY2684', 'doc_count': 0},\n",
       "    {'key': 'SDY2685', 'doc_count': 0},\n",
       "    {'key': 'SDY2686', 'doc_count': 0},\n",
       "    {'key': 'SDY2687', 'doc_count': 0},\n",
       "    {'key': 'SDY2688', 'doc_count': 0},\n",
       "    {'key': 'SDY2689', 'doc_count': 0},\n",
       "    {'key': 'SDY269', 'doc_count': 0},\n",
       "    {'key': 'SDY2690', 'doc_count': 0},\n",
       "    {'key': 'SDY2691', 'doc_count': 0},\n",
       "    {'key': 'SDY2692', 'doc_count': 0},\n",
       "    {'key': 'SDY2693', 'doc_count': 0},\n",
       "    {'key': 'SDY2694', 'doc_count': 0},\n",
       "    {'key': 'SDY2695', 'doc_count': 0},\n",
       "    {'key': 'SDY2696', 'doc_count': 0},\n",
       "    {'key': 'SDY2697', 'doc_count': 0},\n",
       "    {'key': 'SDY2699', 'doc_count': 0},\n",
       "    {'key': 'SDY270', 'doc_count': 0},\n",
       "    {'key': 'SDY2703', 'doc_count': 0},\n",
       "    {'key': 'SDY2704', 'doc_count': 0},\n",
       "    {'key': 'SDY2705', 'doc_count': 0},\n",
       "    {'key': 'SDY2706', 'doc_count': 0},\n",
       "    {'key': 'SDY2707', 'doc_count': 0},\n",
       "    {'key': 'SDY2709', 'doc_count': 0},\n",
       "    {'key': 'SDY271', 'doc_count': 0},\n",
       "    {'key': 'SDY2710', 'doc_count': 0},\n",
       "    {'key': 'SDY2711', 'doc_count': 0},\n",
       "    {'key': 'SDY2712', 'doc_count': 0},\n",
       "    {'key': 'SDY2713', 'doc_count': 0},\n",
       "    {'key': 'SDY2716', 'doc_count': 0},\n",
       "    {'key': 'SDY2717', 'doc_count': 0},\n",
       "    {'key': 'SDY2718', 'doc_count': 0},\n",
       "    {'key': 'SDY2719', 'doc_count': 0},\n",
       "    {'key': 'SDY272', 'doc_count': 0},\n",
       "    {'key': 'SDY2720', 'doc_count': 0},\n",
       "    {'key': 'SDY2721', 'doc_count': 0},\n",
       "    {'key': 'SDY2722', 'doc_count': 0},\n",
       "    {'key': 'SDY2723', 'doc_count': 0},\n",
       "    {'key': 'SDY2724', 'doc_count': 0},\n",
       "    {'key': 'SDY2725', 'doc_count': 0},\n",
       "    {'key': 'SDY2726', 'doc_count': 0},\n",
       "    {'key': 'SDY2727', 'doc_count': 0},\n",
       "    {'key': 'SDY2728', 'doc_count': 0},\n",
       "    {'key': 'SDY2733', 'doc_count': 0},\n",
       "    {'key': 'SDY2735', 'doc_count': 0},\n",
       "    {'key': 'SDY2739', 'doc_count': 0},\n",
       "    {'key': 'SDY2740', 'doc_count': 0},\n",
       "    {'key': 'SDY2741', 'doc_count': 0},\n",
       "    {'key': 'SDY2743', 'doc_count': 0},\n",
       "    {'key': 'SDY2744', 'doc_count': 0},\n",
       "    {'key': 'SDY2745', 'doc_count': 0},\n",
       "    {'key': 'SDY2746', 'doc_count': 0},\n",
       "    {'key': 'SDY2751', 'doc_count': 0},\n",
       "    {'key': 'SDY2752', 'doc_count': 0},\n",
       "    {'key': 'SDY2753', 'doc_count': 0},\n",
       "    {'key': 'SDY2757', 'doc_count': 0},\n",
       "    {'key': 'SDY2760', 'doc_count': 0},\n",
       "    {'key': 'SDY2761', 'doc_count': 0},\n",
       "    {'key': 'SDY2762', 'doc_count': 0},\n",
       "    {'key': 'SDY2763', 'doc_count': 0},\n",
       "    {'key': 'SDY2766', 'doc_count': 0},\n",
       "    {'key': 'SDY2770', 'doc_count': 0},\n",
       "    {'key': 'SDY2772', 'doc_count': 0},\n",
       "    {'key': 'SDY2773', 'doc_count': 0},\n",
       "    {'key': 'SDY2774', 'doc_count': 0},\n",
       "    {'key': 'SDY2775', 'doc_count': 0},\n",
       "    {'key': 'SDY2776', 'doc_count': 0},\n",
       "    {'key': 'SDY2777', 'doc_count': 0},\n",
       "    {'key': 'SDY2778', 'doc_count': 0},\n",
       "    {'key': 'SDY278', 'doc_count': 0},\n",
       "    {'key': 'SDY2780', 'doc_count': 0},\n",
       "    {'key': 'SDY2783', 'doc_count': 0},\n",
       "    {'key': 'SDY2784', 'doc_count': 0},\n",
       "    {'key': 'SDY2785', 'doc_count': 0},\n",
       "    {'key': 'SDY2786', 'doc_count': 0},\n",
       "    {'key': 'SDY2787', 'doc_count': 0},\n",
       "    {'key': 'SDY2788', 'doc_count': 0},\n",
       "    {'key': 'SDY2789', 'doc_count': 0},\n",
       "    {'key': 'SDY2790', 'doc_count': 0},\n",
       "    {'key': 'SDY2791', 'doc_count': 0},\n",
       "    {'key': 'SDY2792', 'doc_count': 0},\n",
       "    {'key': 'SDY2793', 'doc_count': 0},\n",
       "    {'key': 'SDY2794', 'doc_count': 0},\n",
       "    {'key': 'SDY2795', 'doc_count': 0},\n",
       "    {'key': 'SDY2796', 'doc_count': 0},\n",
       "    {'key': 'SDY2797', 'doc_count': 0},\n",
       "    {'key': 'SDY2798', 'doc_count': 0},\n",
       "    {'key': 'SDY2799', 'doc_count': 0},\n",
       "    {'key': 'SDY28', 'doc_count': 0},\n",
       "    {'key': 'SDY2800', 'doc_count': 0},\n",
       "    {'key': 'SDY2801', 'doc_count': 0},\n",
       "    {'key': 'SDY2802', 'doc_count': 0},\n",
       "    {'key': 'SDY2803', 'doc_count': 0},\n",
       "    {'key': 'SDY2804', 'doc_count': 0},\n",
       "    {'key': 'SDY2805', 'doc_count': 0},\n",
       "    {'key': 'SDY2807', 'doc_count': 0},\n",
       "    {'key': 'SDY2808', 'doc_count': 0},\n",
       "    {'key': 'SDY2809', 'doc_count': 0},\n",
       "    {'key': 'SDY281', 'doc_count': 0},\n",
       "    {'key': 'SDY2810', 'doc_count': 0},\n",
       "    {'key': 'SDY2811', 'doc_count': 0},\n",
       "    {'key': 'SDY2812', 'doc_count': 0},\n",
       "    {'key': 'SDY282', 'doc_count': 0},\n",
       "    {'key': 'SDY2820', 'doc_count': 0},\n",
       "    {'key': 'SDY2823', 'doc_count': 0},\n",
       "    {'key': 'SDY2824', 'doc_count': 0},\n",
       "    {'key': 'SDY2825', 'doc_count': 0},\n",
       "    {'key': 'SDY2826', 'doc_count': 0},\n",
       "    {'key': 'SDY2827', 'doc_count': 0},\n",
       "    {'key': 'SDY283', 'doc_count': 0},\n",
       "    {'key': 'SDY2830', 'doc_count': 0},\n",
       "    {'key': 'SDY2837', 'doc_count': 0},\n",
       "    {'key': 'SDY2838', 'doc_count': 0},\n",
       "    {'key': 'SDY2839', 'doc_count': 0},\n",
       "    {'key': 'SDY284', 'doc_count': 0},\n",
       "    {'key': 'SDY2840', 'doc_count': 0},\n",
       "    {'key': 'SDY2841', 'doc_count': 0},\n",
       "    {'key': 'SDY2842', 'doc_count': 0},\n",
       "    {'key': 'SDY2843', 'doc_count': 0},\n",
       "    {'key': 'SDY2844', 'doc_count': 0},\n",
       "    {'key': 'SDY2845', 'doc_count': 0},\n",
       "    {'key': 'SDY2846', 'doc_count': 0},\n",
       "    {'key': 'SDY2847', 'doc_count': 0},\n",
       "    {'key': 'SDY2848', 'doc_count': 0},\n",
       "    {'key': 'SDY2849', 'doc_count': 0},\n",
       "    {'key': 'SDY2850', 'doc_count': 0},\n",
       "    {'key': 'SDY2851', 'doc_count': 0},\n",
       "    {'key': 'SDY2852', 'doc_count': 0},\n",
       "    {'key': 'SDY2853', 'doc_count': 0},\n",
       "    {'key': 'SDY2854', 'doc_count': 0},\n",
       "    {'key': 'SDY2855', 'doc_count': 0},\n",
       "    {'key': 'SDY2856', 'doc_count': 0},\n",
       "    {'key': 'SDY2858', 'doc_count': 0},\n",
       "    {'key': 'SDY2859', 'doc_count': 0},\n",
       "    {'key': 'SDY286', 'doc_count': 0},\n",
       "    {'key': 'SDY2860', 'doc_count': 0},\n",
       "    {'key': 'SDY2863', 'doc_count': 0},\n",
       "    {'key': 'SDY2869', 'doc_count': 0},\n",
       "    {'key': 'SDY2873', 'doc_count': 0},\n",
       "    {'key': 'SDY288', 'doc_count': 0},\n",
       "    {'key': 'SDY2884', 'doc_count': 0},\n",
       "    {'key': 'SDY2885', 'doc_count': 0},\n",
       "    {'key': 'SDY2886', 'doc_count': 0},\n",
       "    {'key': 'SDY2887', 'doc_count': 0},\n",
       "    {'key': 'SDY2888', 'doc_count': 0},\n",
       "    {'key': 'SDY2889', 'doc_count': 0},\n",
       "    {'key': 'SDY289', 'doc_count': 0},\n",
       "    {'key': 'SDY2890', 'doc_count': 0},\n",
       "    {'key': 'SDY2891', 'doc_count': 0},\n",
       "    {'key': 'SDY2892', 'doc_count': 0},\n",
       "    {'key': 'SDY2893', 'doc_count': 0},\n",
       "    {'key': 'SDY2894', 'doc_count': 0},\n",
       "    {'key': 'SDY2895', 'doc_count': 0},\n",
       "    {'key': 'SDY2896', 'doc_count': 0},\n",
       "    {'key': 'SDY2897', 'doc_count': 0},\n",
       "    {'key': 'SDY2898', 'doc_count': 0},\n",
       "    {'key': 'SDY29', 'doc_count': 0},\n",
       "    {'key': 'SDY290', 'doc_count': 0},\n",
       "    {'key': 'SDY2903', 'doc_count': 0},\n",
       "    {'key': 'SDY2908', 'doc_count': 0},\n",
       "    {'key': 'SDY291', 'doc_count': 0},\n",
       "    {'key': 'SDY2913', 'doc_count': 0},\n",
       "    {'key': 'SDY2914', 'doc_count': 0},\n",
       "    {'key': 'SDY2917', 'doc_count': 0},\n",
       "    {'key': 'SDY2918', 'doc_count': 0},\n",
       "    {'key': 'SDY292', 'doc_count': 0},\n",
       "    {'key': 'SDY2922', 'doc_count': 0},\n",
       "    {'key': 'SDY2923', 'doc_count': 0},\n",
       "    ...]},\n",
       "  'has_lab_test': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Y', 'doc_count': 2}, {'key': 'N', 'doc_count': 0}]},\n",
       "  'species': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Homo sapiens', 'doc_count': 2},\n",
       "    {'key': 'Anas platyrhynchos', 'doc_count': 0},\n",
       "    {'key': 'Aotus nancymaae', 'doc_count': 0},\n",
       "    {'key': 'Canis lupus familiaris', 'doc_count': 0},\n",
       "    {'key': 'Cavia porcellus', 'doc_count': 0},\n",
       "    {'key': 'Gallus gallus', 'doc_count': 0},\n",
       "    {'key': 'Macaca fascicularis', 'doc_count': 0},\n",
       "    {'key': 'Macaca mulatta', 'doc_count': 0},\n",
       "    {'key': 'Mesocricetus auratus', 'doc_count': 0},\n",
       "    {'key': 'Mus musculus', 'doc_count': 0},\n",
       "    {'key': 'Mustela putorius furo', 'doc_count': 0},\n",
       "    {'key': 'Other', 'doc_count': 0},\n",
       "    {'key': 'Pan troglodytes', 'doc_count': 0},\n",
       "    {'key': 'Rattus norvegicus', 'doc_count': 0},\n",
       "    {'key': 'Sus scrofa domesticus', 'doc_count': 0}]},\n",
       "  'condition_or_disease': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Streptococcus pneumonia', 'doc_count': 2},\n",
       "    {'key': 'healthy', 'doc_count': 1},\n",
       "    {'key': 'influenza', 'doc_count': 1},\n",
       "    {'key': 'Acute Respiratory Distress Syndrome', 'doc_count': 0},\n",
       "    {'key': 'Aging', 'doc_count': 0},\n",
       "    {'key': \"Alzheimer's disease\", 'doc_count': 0},\n",
       "    {'key': 'COVID-19', 'doc_count': 0},\n",
       "    {'key': 'COVID-19-Associated Acute Respiratory Distress Syndrome',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Chronic Fatigue Syndrome', 'doc_count': 0},\n",
       "    {'key': 'Chronic Liver Disease', 'doc_count': 0},\n",
       "    {'key': 'Clostridium difficile colitis', 'doc_count': 0},\n",
       "    {'key': 'Cytogenetically Normal Acute Myeloid Leukemia', 'doc_count': 0},\n",
       "    {'key': 'Cytomegaloviral Infection', 'doc_count': 0},\n",
       "    {'key': 'EBV Infection', 'doc_count': 0},\n",
       "    {'key': 'EBV-Related Post-Transplant Lymphoproliferative Disorder',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'Ebola hemorrhagic fever', 'doc_count': 0},\n",
       "    {'key': 'Escherichia Coli Infection', 'doc_count': 0},\n",
       "    {'key': 'Family Medical History', 'doc_count': 0},\n",
       "    {'key': 'Heart Failure', 'doc_count': 0},\n",
       "    {'key': 'Heart Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Helicobacter Pylori Infection', 'doc_count': 0},\n",
       "    {'key': 'Hematopoietic Cell Transplant Recipient', 'doc_count': 0},\n",
       "    {'key': 'Immunologic Tolerance', 'doc_count': 0},\n",
       "    {'key': 'Immunosuppressive Disorder', 'doc_count': 0},\n",
       "    {'key': 'Inflammatory Disorder', 'doc_count': 0},\n",
       "    {'key': 'Kidney Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Listeria meningitis', 'doc_count': 0},\n",
       "    {'key': 'Liver Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Lung Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Lyme disease', 'doc_count': 0},\n",
       "    {'key': 'Neurological diseases or conditions', 'doc_count': 0},\n",
       "    {'key': 'Newcastle disease', 'doc_count': 0},\n",
       "    {'key': 'Not Applicable', 'doc_count': 0},\n",
       "    {'key': 'Not Specified', 'doc_count': 0},\n",
       "    {'key': 'Pancreas Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Pancreatic Islet Transplantation', 'doc_count': 0},\n",
       "    {'key': \"Parkinson's disease\", 'doc_count': 0},\n",
       "    {'key': 'Perennial Allergic Rhinitis', 'doc_count': 0},\n",
       "    {'key': 'Plasmodium falciparum malaria', 'doc_count': 0},\n",
       "    {'key': 'Plasmodium vivax malaria', 'doc_count': 0},\n",
       "    {'key': 'Post-Acute Sequelae of COVID-19', 'doc_count': 0},\n",
       "    {'key': 'Post-Transplant Lymphoproliferative Disorder', 'doc_count': 0},\n",
       "    {'key': 'Pregnancy', 'doc_count': 0},\n",
       "    {'key': 'Preterm Birth', 'doc_count': 0},\n",
       "    {'key': 'Primary Sjogren Syndrome', 'doc_count': 0},\n",
       "    {'key': 'Radiation Exposure', 'doc_count': 0},\n",
       "    {'key': 'Radiation Sickness Syndrome', 'doc_count': 0},\n",
       "    {'key': 'Recurrent pregnancy loss', 'doc_count': 0},\n",
       "    {'key': 'Rheumatic Disease', 'doc_count': 0},\n",
       "    {'key': 'Rhinovirus Infection', 'doc_count': 0},\n",
       "    {'key': 'Severe Acute Respiratory Syndrome (SARS)', 'doc_count': 0},\n",
       "    {'key': 'Shigellosis', 'doc_count': 0},\n",
       "    {'key': \"Sjogren's syndrome\", 'doc_count': 0},\n",
       "    {'key': 'Small Bowel Transplantation', 'doc_count': 0},\n",
       "    {'key': 'Small for Gestational Age', 'doc_count': 0},\n",
       "    {'key': 'Solid Neoplasm', 'doc_count': 0},\n",
       "    {'key': 'Solid Organ Transplant Recipient', 'doc_count': 0},\n",
       "    {'key': 'Spontaneous Preterm Birth', 'doc_count': 0},\n",
       "    {'key': 'Staphylococcus Aureus Infection', 'doc_count': 0},\n",
       "    {'key': 'Streptococcal Pharyngitis', 'doc_count': 0},\n",
       "    {'key': 'Viral Respiratory Tract Infection', 'doc_count': 0},\n",
       "    {'key': 'West Nile encephalitis', 'doc_count': 0},\n",
       "    {'key': 'West Nile fever', 'doc_count': 0},\n",
       "    {'key': 'Zika fever', 'doc_count': 0},\n",
       "    {'key': 'acquired immunodeficiency syndrome', 'doc_count': 0},\n",
       "    {'key': 'allergic hypersensitivity disease', 'doc_count': 0},\n",
       "    {'key': 'allergic rhinitis', 'doc_count': 0},\n",
       "    {'key': 'anthrax disease', 'doc_count': 0},\n",
       "    {'key': 'asthma', 'doc_count': 0},\n",
       "    {'key': 'atopic dermatitis', 'doc_count': 0},\n",
       "    {'key': 'autoimmune disease', 'doc_count': 0},\n",
       "    {'key': 'autoimmune disease of musculoskeletal system', 'doc_count': 0},\n",
       "    {'key': 'avian influenza', 'doc_count': 0},\n",
       "    {'key': 'brain glioma', 'doc_count': 0},\n",
       "    {'key': 'breast cancer', 'doc_count': 0},\n",
       "    {'key': 'bronchiolitis', 'doc_count': 0},\n",
       "    {'key': 'cancer', 'doc_count': 0},\n",
       "    {'key': 'cardiomyopathy', 'doc_count': 0},\n",
       "    {'key': 'cardiovascular system disease', 'doc_count': 0},\n",
       "    {'key': 'celiac disease', 'doc_count': 0},\n",
       "    {'key': 'chickenpox', 'doc_count': 0},\n",
       "    {'key': 'chikungunya', 'doc_count': 0},\n",
       "    {'key': 'childhood type dermatomyositis', 'doc_count': 0},\n",
       "    {'key': 'chlamydia', 'doc_count': 0},\n",
       "    {'key': 'cholera', 'doc_count': 0},\n",
       "    {'key': 'chorioamnionitis', 'doc_count': 0},\n",
       "    {'key': 'chromosomal disease', 'doc_count': 0},\n",
       "    {'key': 'chronic kidney disease', 'doc_count': 0},\n",
       "    {'key': 'chronic plaque psoriasis', 'doc_count': 0},\n",
       "    {'key': 'chronic spontaneous urticaria', 'doc_count': 0},\n",
       "    {'key': 'clinically isolated syndrome', 'doc_count': 0},\n",
       "    {'key': 'colitis', 'doc_count': 0},\n",
       "    {'key': 'colorectal cancer', 'doc_count': 0},\n",
       "    {'key': 'congestive heart failure', 'doc_count': 0},\n",
       "    {'key': 'dengue disease', 'doc_count': 0},\n",
       "    {'key': 'dengue hemorrhagic fever', 'doc_count': 0},\n",
       "    {'key': 'developmental disorder of mental health', 'doc_count': 0},\n",
       "    {'key': 'diabetes mellitus', 'doc_count': 0},\n",
       "    {'key': 'diphtheria', 'doc_count': 0},\n",
       "    {'key': 'eczema herpeticum', 'doc_count': 0},\n",
       "    {'key': 'eczema vaccinatum', 'doc_count': 0},\n",
       "    {'key': 'egg allergy', 'doc_count': 0},\n",
       "    {'key': 'encephalitis', 'doc_count': 0},\n",
       "    {'key': 'eosinophilic esophagitis', 'doc_count': 0},\n",
       "    {'key': 'food allergy', 'doc_count': 0},\n",
       "    {'key': 'glioblastoma', 'doc_count': 0},\n",
       "    {'key': 'granulomatosis with polyangiitis', 'doc_count': 0},\n",
       "    {'key': 'haemophilus meningitis', 'doc_count': 0},\n",
       "    {'key': 'hepatitis', 'doc_count': 0},\n",
       "    {'key': 'hepatitis A', 'doc_count': 0},\n",
       "    {'key': 'hepatitis B', 'doc_count': 0},\n",
       "    {'key': 'hepatitis C', 'doc_count': 0},\n",
       "    {'key': 'herpes zoster', 'doc_count': 0},\n",
       "    {'key': 'human cytomegalovirus infection', 'doc_count': 0},\n",
       "    {'key': 'human immunodeficiency virus infectious disease', 'doc_count': 0},\n",
       "    {'key': 'hypertension', 'doc_count': 0},\n",
       "    {'key': 'hypoglycemia', 'doc_count': 0},\n",
       "    {'key': 'hypothyroidism', 'doc_count': 0},\n",
       "    {'key': 'idiopathic pulmonary fibrosis', 'doc_count': 0},\n",
       "    {'key': 'inflammatory bowel disease', 'doc_count': 0},\n",
       "    {'key': 'interstitial lung disease', 'doc_count': 0},\n",
       "    {'key': 'intestinal infectious disease', 'doc_count': 0},\n",
       "    {'key': 'juvenile rheumatoid arthritis', 'doc_count': 0},\n",
       "    {'key': 'keratoconjunctivitis sicca', 'doc_count': 0},\n",
       "    {'key': 'kidney failure', 'doc_count': 0},\n",
       "    {'key': 'leukemia', 'doc_count': 0},\n",
       "    {'key': 'liver cancer', 'doc_count': 0},\n",
       "    {'key': 'liver disease', 'doc_count': 0},\n",
       "    {'key': 'lung adenocarcinoma', 'doc_count': 0},\n",
       "    {'key': 'lung cancer', 'doc_count': 0},\n",
       "    {'key': 'lung disease', 'doc_count': 0},\n",
       "    {'key': 'lupus nephritis', 'doc_count': 0},\n",
       "    {'key': 'lymphocytic choriomeningitis', 'doc_count': 0},\n",
       "    {'key': 'lymphoma', 'doc_count': 0},\n",
       "    {'key': 'malaria', 'doc_count': 0},\n",
       "    {'key': 'measles', 'doc_count': 0},\n",
       "    {'key': 'meningitis', 'doc_count': 0},\n",
       "    {'key': 'meningococcal meningitis', 'doc_count': 0},\n",
       "    {'key': 'meningoencephalitis', 'doc_count': 0},\n",
       "    {'key': 'milk allergy', 'doc_count': 0},\n",
       "    {'key': 'molluscum contagiosum', 'doc_count': 0},\n",
       "    {'key': 'multiple myeloma', 'doc_count': 0},\n",
       "    {'key': 'multiple sclerosis', 'doc_count': 0},\n",
       "    {'key': 'mumps', 'doc_count': 0},\n",
       "    {'key': 'muscle invasive bladder cancer', 'doc_count': 0},\n",
       "    {'key': 'myasthenia gravis', 'doc_count': 0},\n",
       "    {'key': 'myocarditis', 'doc_count': 0},\n",
       "    {'key': 'neuromyelitis optica', 'doc_count': 0},\n",
       "    {'key': 'obesity', 'doc_count': 0},\n",
       "    {'key': 'optic nerve glioma', 'doc_count': 0},\n",
       "    {'key': 'osteoarthritis', 'doc_count': 0},\n",
       "    {'key': 'peanut allergy', 'doc_count': 0},\n",
       "    {'key': 'pemphigus vulgaris', 'doc_count': 0},\n",
       "    {'key': 'pertussis', 'doc_count': 0},\n",
       "    {'key': 'pharyngitis', 'doc_count': 0},\n",
       "    {'key': 'plague', 'doc_count': 0},\n",
       "    {'key': 'pneumonia', 'doc_count': 0},\n",
       "    {'key': 'post-traumatic stress disorder', 'doc_count': 0},\n",
       "    {'key': 'pre-eclampsia', 'doc_count': 0},\n",
       "    {'key': 'psoriasis', 'doc_count': 0},\n",
       "    {'key': 'psoriatic arthritis', 'doc_count': 0},\n",
       "    {'key': 'pustulosis of palm and sole', 'doc_count': 0},\n",
       "    {'key': 'respiratory syncytial virus infectious disease', 'doc_count': 0},\n",
       "    {'key': 'rheumatoid arthritis', 'doc_count': 0},\n",
       "    {'key': 'rhinitis', 'doc_count': 0},\n",
       "    {'key': 'rubella', 'doc_count': 0},\n",
       "    {'key': 'salmonellosis', 'doc_count': 0},\n",
       "    {'key': 'sarcoma', 'doc_count': 0},\n",
       "    {'key': 'sickle cell anemia', 'doc_count': 0},\n",
       "    {'key': 'smallpox', 'doc_count': 0},\n",
       "    {'key': 'swine influenza', 'doc_count': 0},\n",
       "    {'key': 'systemic lupus erythematosus', 'doc_count': 0},\n",
       "    {'key': 'systemic scleroderma', 'doc_count': 0},\n",
       "    {'key': 'tetanus', 'doc_count': 0},\n",
       "    {'key': 'tuberculosis', 'doc_count': 0},\n",
       "    {'key': 'tularemia', 'doc_count': 0},\n",
       "    {'key': 'type 1 diabetes mellitus', 'doc_count': 0},\n",
       "    {'key': 'type 2 diabetes mellitus', 'doc_count': 0},\n",
       "    {'key': 'typhoid fever', 'doc_count': 0},\n",
       "    {'key': 'ulcerative colitis', 'doc_count': 0},\n",
       "    {'key': 'upper respiratory tract disease', 'doc_count': 0},\n",
       "    {'key': 'viral tropism', 'doc_count': 0},\n",
       "    {'key': 'yellow fever', 'doc_count': 0}]},\n",
       "  'has_assessment': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'N', 'doc_count': 1}, {'key': 'Y', 'doc_count': 1}]},\n",
       "  'assay_method': {'doc_count_error_upper_bound': 0,\n",
       "   'sum_other_doc_count': 0,\n",
       "   'buckets': [{'key': 'Flow Cytometry', 'doc_count': 2},\n",
       "    {'key': 'Hemagglutination Inhibition', 'doc_count': 1},\n",
       "    {'key': 'Luminex xMAP', 'doc_count': 1},\n",
       "    {'key': 'Nanostring', 'doc_count': 1},\n",
       "    {'key': 'Neutralizing Antibody Titer Assay', 'doc_count': 1},\n",
       "    {'key': 'Transcription profiling by array', 'doc_count': 1},\n",
       "    {'key': 'Virus Neutralization', 'doc_count': 1},\n",
       "    {'key': '16S rRNA gene sequencing', 'doc_count': 0},\n",
       "    {'key': '2D Gel', 'doc_count': 0},\n",
       "    {'key': 'Array', 'doc_count': 0},\n",
       "    {'key': 'B cell receptor repertoire sequencing assay', 'doc_count': 0},\n",
       "    {'key': 'Bio-layer Interferometry Assay', 'doc_count': 0},\n",
       "    {'key': 'Bulk RNA-seq assay', 'doc_count': 0},\n",
       "    {'key': 'CITE-Seq', 'doc_count': 0},\n",
       "    {'key': 'CRISPR Screening', 'doc_count': 0},\n",
       "    {'key': 'Cell Culture', 'doc_count': 0},\n",
       "    {'key': 'Cell Mediated Immunoassay', 'doc_count': 0},\n",
       "    {'key': 'Chemiluminescent Assay', 'doc_count': 0},\n",
       "    {'key': 'Colorimetric Cell Viability Assay', 'doc_count': 0},\n",
       "    {'key': 'Cryo-Electron Microscopy', 'doc_count': 0},\n",
       "    {'key': 'CyTOF', 'doc_count': 0},\n",
       "    {'key': 'Cytometric Bead Array Assay', 'doc_count': 0},\n",
       "    {'key': 'DNA methylation profiling assay', 'doc_count': 0},\n",
       "    {'key': 'DNA microarray', 'doc_count': 0},\n",
       "    {'key': 'ELISA', 'doc_count': 0},\n",
       "    {'key': 'ELISPOT', 'doc_count': 0},\n",
       "    {'key': 'EMSA', 'doc_count': 0},\n",
       "    {'key': 'Fluorescence Resonance Energy Transfer', 'doc_count': 0},\n",
       "    {'key': 'Fluorescent Antibody Procedure', 'doc_count': 0},\n",
       "    {'key': 'Glycan profiling', 'doc_count': 0},\n",
       "    {'key': 'HLA Typing', 'doc_count': 0},\n",
       "    {'key': 'HPLC', 'doc_count': 0},\n",
       "    {'key': 'High-Resolution Mass Spectrometry', 'doc_count': 0},\n",
       "    {'key': 'Histological Assay', 'doc_count': 0},\n",
       "    {'key': 'Histopathology', 'doc_count': 0},\n",
       "    {'key': 'Immune Repertoire Deep Sequencing', 'doc_count': 0},\n",
       "    {'key': 'Immunoblot', 'doc_count': 0},\n",
       "    {'key': 'Immunohistochemistry', 'doc_count': 0},\n",
       "    {'key': 'Immunoprecipitation', 'doc_count': 0},\n",
       "    {'key': 'Intracellular Cytokine Stain Flow Cytometric Assay',\n",
       "     'doc_count': 0},\n",
       "    {'key': 'KIR Typing', 'doc_count': 0},\n",
       "    {'key': 'LC_MS', 'doc_count': 0},\n",
       "    {'key': 'Lateral Flow Assay', 'doc_count': 0},\n",
       "    {'key': 'Liquid Chromatography', 'doc_count': 0},\n",
       "    {'key': 'MS_MS', 'doc_count': 0},\n",
       "    {'key': 'Mass Spectrometry', 'doc_count': 0},\n",
       "    {'key': 'Meso Scale Discovery ECL', 'doc_count': 0},\n",
       "    {'key': 'Microneutralization Assay', 'doc_count': 0},\n",
       "    {'key': 'Microscopy', 'doc_count': 0},\n",
       "    {'key': 'Multiplex Bead Array Assay', 'doc_count': 0},\n",
       "    {'key': 'Multiplex Immunoassay', 'doc_count': 0},\n",
       "    {'key': 'NMR', 'doc_count': 0},\n",
       "    {'key': 'Neuraminidase Inhibition Assay', 'doc_count': 0},\n",
       "    {'key': 'Northern Blot', 'doc_count': 0},\n",
       "    {'key': 'Olink assay', 'doc_count': 0},\n",
       "    {'key': 'Other', 'doc_count': 0},\n",
       "    {'key': 'PCR', 'doc_count': 0},\n",
       "    {'key': 'Plaque Reduction Neutralization Assay', 'doc_count': 0},\n",
       "    {'key': 'Protein microarray', 'doc_count': 0},\n",
       "    {'key': 'Pseudovirus Neutralization Assay', 'doc_count': 0},\n",
       "    {'key': 'Q-PCR', 'doc_count': 0},\n",
       "    {'key': 'RNA sequencing', 'doc_count': 0},\n",
       "    {'key': 'Real time polymerase chain reaction assay', 'doc_count': 0},\n",
       "    {'key': 'SARS-CoV-2 Virus Sequencing', 'doc_count': 0},\n",
       "    {'key': 'SNP microarray', 'doc_count': 0},\n",
       "    {'key': 'SOMAscan assay', 'doc_count': 0},\n",
       "    {'key': 'Sequencing', 'doc_count': 0},\n",
       "    {'key': 'Single-Molecule Array (SIMOA)', 'doc_count': 0},\n",
       "    {'key': 'Spectral Flow Cytometry', 'doc_count': 0},\n",
       "    {'key': 'Surface Plasmon Resonance', 'doc_count': 0},\n",
       "    {'key': 'T cell receptor repertoire sequencing assay', 'doc_count': 0},\n",
       "    {'key': 'TCID50', 'doc_count': 0},\n",
       "    {'key': 'Transcription Profiling by NanoString', 'doc_count': 0},\n",
       "    {'key': 'Transcription profiling assay', 'doc_count': 0},\n",
       "    {'key': 'Virus Plaque Assay', 'doc_count': 0},\n",
       "    {'key': 'Western Blot', 'doc_count': 0},\n",
       "    {'key': 'Whole Genome Sequencing', 'doc_count': 0},\n",
       "    {'key': 'X-Ray Crystallography', 'doc_count': 0},\n",
       "    {'key': 'in situ Hybridization', 'doc_count': 0},\n",
       "    {'key': 'microRNA profiling assay', 'doc_count': 0},\n",
       "    {'key': 'scRNA-seq', 'doc_count': 0}]},\n",
       "  'age': {'buckets': {'< 10': {'from': -1.0, 'to': 10.0, 'doc_count': 0},\n",
       "    '10 - 19': {'from': 10.0, 'to': 20.0, 'doc_count': 0},\n",
       "    '20 - 29': {'from': 20.0, 'to': 30.0, 'doc_count': 2},\n",
       "    '30 - 39': {'from': 30.0, 'to': 40.0, 'doc_count': 0},\n",
       "    '40 - 49': {'from': 40.0, 'to': 50.0, 'doc_count': 0},\n",
       "    '50 - 59': {'from': 50.0, 'to': 60.0, 'doc_count': 0},\n",
       "    '60 - 69': {'from': 60.0, 'to': 70.0, 'doc_count': 0},\n",
       "    '70 - 79': {'from': 70.0, 'to': 80.0, 'doc_count': 0},\n",
       "    '>= 80': {'from': 80.0, 'to': 91.0, 'doc_count': 0}}}}}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "endpoint = DATA_QUERY_URL + \"/api/search/study?pageSize=100&researchFocus=Vaccine%20Response&conditionOrDisease=Streptococcus%20pneumonia&cdePvId=C81328\"\n",
    "results = api_data_query(endpoint, authorization = False)\n",
    "results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "70cae2f5-d964-4d6f-8b76-393fe0cd3616",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 112
    },
    "id": "70cae2f5-d964-4d6f-8b76-393fe0cd3616",
    "outputId": "c7c2863c-4cc2-4f6f-ac8e-49b8242c7150",
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "summary": "{\n  \"name\": \"df\",\n  \"rows\": 2,\n  \"fields\": [\n    {\n      \"column\": \"_index\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"study_mapping_common_dr68\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"_id\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"SDY180\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"_score\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"_source\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}",
       "type": "dataframe",
       "variable_name": "df"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-e32a728c-1663-405e-b084-6e25b574cfa6\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_index</th>\n",
       "      <th>_id</th>\n",
       "      <th>_score</th>\n",
       "      <th>_source</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>study_mapping_common_dr68</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>0</td>\n",
       "      <td>{'clinical_trial': 'N', 'gender': ['Male'], 'e...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>study_mapping_common_dr68</td>\n",
       "      <td>SDY180</td>\n",
       "      <td>0</td>\n",
       "      <td>{'clinical_trial': 'N', 'gender': ['Female', '...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e32a728c-1663-405e-b084-6e25b574cfa6')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-e32a728c-1663-405e-b084-6e25b574cfa6 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-e32a728c-1663-405e-b084-6e25b574cfa6');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "  <div id=\"id_942c1f0c-3a0c-4867-97e2-22c0b3978fc3\">\n",
       "    <style>\n",
       "      .colab-df-generate {\n",
       "        background-color: #E8F0FE;\n",
       "        border: none;\n",
       "        border-radius: 50%;\n",
       "        cursor: pointer;\n",
       "        display: none;\n",
       "        fill: #1967D2;\n",
       "        height: 32px;\n",
       "        padding: 0 0 0 0;\n",
       "        width: 32px;\n",
       "      }\n",
       "\n",
       "      .colab-df-generate:hover {\n",
       "        background-color: #E2EBFA;\n",
       "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "        fill: #174EA6;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate {\n",
       "        background-color: #3B4455;\n",
       "        fill: #D2E3FC;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate:hover {\n",
       "        background-color: #434B5C;\n",
       "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "        fill: #FFFFFF;\n",
       "      }\n",
       "    </style>\n",
       "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
       "            title=\"Generate code using this dataframe.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
       "       width=\"24px\">\n",
       "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    <script>\n",
       "      (() => {\n",
       "      const buttonEl =\n",
       "        document.querySelector('#id_942c1f0c-3a0c-4867-97e2-22c0b3978fc3 button.colab-df-generate');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      buttonEl.onclick = () => {\n",
       "        google.colab.notebook.generateWithVariable('df');\n",
       "      }\n",
       "      })();\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "                      _index     _id  _score  \\\n",
       "0  study_mapping_common_dr68   SDY87       0   \n",
       "1  study_mapping_common_dr68  SDY180       0   \n",
       "\n",
       "                                             _source  \n",
       "0  {'clinical_trial': 'N', 'gender': ['Male'], 'e...  \n",
       "1  {'clinical_trial': 'N', 'gender': ['Female', '...  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_json(json.dumps(results[\"hits\"][\"hits\"]))\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "fa8832d2-37a6-4f2b-b7ef-cbcd05218f7e",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 335
    },
    "id": "fa8832d2-37a6-4f2b-b7ef-cbcd05218f7e",
    "outputId": "5089f438-906b-492d-81db-aafd4c7176a3",
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "variable_name": "df_final"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-eb6e334e-9412-4e9d-90af-dd4d9659401c\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_index</th>\n",
       "      <th>_id</th>\n",
       "      <th>_score</th>\n",
       "      <th>clinical_trial</th>\n",
       "      <th>gender</th>\n",
       "      <th>ethnicity</th>\n",
       "      <th>brief_title</th>\n",
       "      <th>initial_data_release_version_number</th>\n",
       "      <th>program_name</th>\n",
       "      <th>latest_data_release_version</th>\n",
       "      <th>...</th>\n",
       "      <th>study_pi</th>\n",
       "      <th>species</th>\n",
       "      <th>initial_data_release_version</th>\n",
       "      <th>condition_or_disease</th>\n",
       "      <th>has_assessment</th>\n",
       "      <th>assessment_panel_count</th>\n",
       "      <th>age_unit</th>\n",
       "      <th>assay_method</th>\n",
       "      <th>min_age</th>\n",
       "      <th>doi</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>study_mapping_common_dr68</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>0</td>\n",
       "      <td>N</td>\n",
       "      <td>[Male]</td>\n",
       "      <td>[Hispanic or Latino, Not Hispanic or Latino]</td>\n",
       "      <td>In-Depth Characterization of Immune Responses ...</td>\n",
       "      <td>18.0</td>\n",
       "      <td>[Human Immunology Project Consortium (HIPC) RF...</td>\n",
       "      <td>DR68</td>\n",
       "      <td>...</td>\n",
       "      <td>[A. Karolina Palucka: Baylor Research Institute]</td>\n",
       "      <td>[Homo sapiens]</td>\n",
       "      <td>DR18</td>\n",
       "      <td>[Streptococcus pneumonia]</td>\n",
       "      <td>Y</td>\n",
       "      <td>[Vitals (65), Medical History (209), Followup ...</td>\n",
       "      <td>Years</td>\n",
       "      <td>[Flow Cytometry]</td>\n",
       "      <td>22.0</td>\n",
       "      <td>10.21430/M3AA0XR32D</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>study_mapping_common_dr68</td>\n",
       "      <td>SDY180</td>\n",
       "      <td>0</td>\n",
       "      <td>N</td>\n",
       "      <td>[Female, Male]</td>\n",
       "      <td>[Hispanic or Latino, Not Hispanic or Latino]</td>\n",
       "      <td>Systems scale interactive exploration reveals ...</td>\n",
       "      <td>6.0</td>\n",
       "      <td>[Human Immunology Project Consortium (HIPC) RF...</td>\n",
       "      <td>DR58</td>\n",
       "      <td>...</td>\n",
       "      <td>[A. Karolina Palucka: Baylor Reasearch Institute]</td>\n",
       "      <td>[Homo sapiens]</td>\n",
       "      <td>DR6</td>\n",
       "      <td>[healthy, Streptococcus pneumonia, influenza]</td>\n",
       "      <td>N</td>\n",
       "      <td>[]</td>\n",
       "      <td>Years</td>\n",
       "      <td>[Nanostring, Virus Neutralization, Hemagglutin...</td>\n",
       "      <td>22.0</td>\n",
       "      <td>10.21430/M3I44H8R17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2 rows × 49 columns</p>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-eb6e334e-9412-4e9d-90af-dd4d9659401c')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-eb6e334e-9412-4e9d-90af-dd4d9659401c button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-eb6e334e-9412-4e9d-90af-dd4d9659401c');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "                      _index     _id  _score clinical_trial          gender  \\\n",
       "0  study_mapping_common_dr68   SDY87       0              N          [Male]   \n",
       "1  study_mapping_common_dr68  SDY180       0              N  [Female, Male]   \n",
       "\n",
       "                                      ethnicity  \\\n",
       "0  [Hispanic or Latino, Not Hispanic or Latino]   \n",
       "1  [Hispanic or Latino, Not Hispanic or Latino]   \n",
       "\n",
       "                                         brief_title  \\\n",
       "0  In-Depth Characterization of Immune Responses ...   \n",
       "1  Systems scale interactive exploration reveals ...   \n",
       "\n",
       "   initial_data_release_version_number  \\\n",
       "0                                 18.0   \n",
       "1                                  6.0   \n",
       "\n",
       "                                        program_name  \\\n",
       "0  [Human Immunology Project Consortium (HIPC) RF...   \n",
       "1  [Human Immunology Project Consortium (HIPC) RF...   \n",
       "\n",
       "  latest_data_release_version  ...  \\\n",
       "0                        DR68  ...   \n",
       "1                        DR58  ...   \n",
       "\n",
       "                                            study_pi         species  \\\n",
       "0   [A. Karolina Palucka: Baylor Research Institute]  [Homo sapiens]   \n",
       "1  [A. Karolina Palucka: Baylor Reasearch Institute]  [Homo sapiens]   \n",
       "\n",
       "  initial_data_release_version                           condition_or_disease  \\\n",
       "0                         DR18                      [Streptococcus pneumonia]   \n",
       "1                          DR6  [healthy, Streptococcus pneumonia, influenza]   \n",
       "\n",
       "  has_assessment                             assessment_panel_count age_unit  \\\n",
       "0              Y  [Vitals (65), Medical History (209), Followup ...    Years   \n",
       "1              N                                                 []    Years   \n",
       "\n",
       "                                        assay_method min_age  \\\n",
       "0                                   [Flow Cytometry]    22.0   \n",
       "1  [Nanostring, Virus Neutralization, Hemagglutin...    22.0   \n",
       "\n",
       "                   doi  \n",
       "0  10.21430/M3AA0XR32D  \n",
       "1  10.21430/M3I44H8R17  \n",
       "\n",
       "[2 rows x 49 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Normalize the nested column\n",
    "source_expanded = pd.json_normalize(df['_source'])\n",
    "\n",
    "# Join it back to the original DataFrame and drop the old column\n",
    "df_final = df.drop(columns=['_source']).join(source_expanded)\n",
    "df_final.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "GqPPAv_EjViF",
   "metadata": {
    "id": "GqPPAv_EjViF"
   },
   "source": [
    "# Study Data\n",
    "\n",
    "## Endpoints to support the retrieval of study data for a single study including subject, experiment, etc"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c2b06a52-aeef-4cc8-854e-0b96578c7ad9",
   "metadata": {
    "id": "c2b06a52-aeef-4cc8-854e-0b96578c7ad9",
    "tags": []
   },
   "source": [
    "There are two ImmPort studies that matched our search.\n",
    "\n",
    "Let's find out more about this first study, SDY87.  \n",
    "<br>\n",
    "\n",
    "Start with basic study information.\n",
    "\n",
    "/api/study/{studyAccession}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "fc4f068e-a0fe-4f18-bda7-01b5bf476a83",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "fc4f068e-a0fe-4f18-bda7-01b5bf476a83",
    "outputId": "b3019dcd-c847-44a5-daa2-f144d5e0df56",
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'studyAccession': 'SDY87',\n",
       "  'actualCompletionDate': None,\n",
       "  'actualEnrollment': 5,\n",
       "  'actualStartDate': None,\n",
       "  'ageUnit': 'Years',\n",
       "  'briefDescription': 'This study will measure the immune response to the Pneumovax vaccine The long-term goal is to develop improved vaccines to infectious diseases such as influenza. Blood will be collected from patients at several visits before and after vaccination. The blood will be used in a series of immunological tests to measure the strength and breadth of immune response. These assays may include T cell and B cell activation assays, microarray testing, Epimax, Epigen, and flow cytometry.',\n",
       "  'briefTitle': 'In-Depth Characterization of Immune Responses to Pneumovax Vaccination in Healthy Subjects',\n",
       "  'clinicalTrial': 'N',\n",
       "  'description': 'This study will measure the immune response to the Pneumovax vaccine The long-term goal is to develop improved vaccines to infectious diseases such as influenza. Blood will be collected from patients at several visits before and after vaccination. The blood will be used in a series of immunological tests to measure the strength and breadth of immune response. These assays may include T cell and B cell activation assays, microarray testing, Epimax, Epigen, and flow cytometry.',\n",
       "  'dclId': 2,\n",
       "  'doi': '10.21430/M3AA0XR32D',\n",
       "  'endpoints': 'N/A',\n",
       "  'genderIncluded': 'Male',\n",
       "  'hypothesis': 'That immune responses can be measured longitudinally after vaccination and that the information gained may be useful for developing novel vaccines.',\n",
       "  'initialDataReleaseDate': '2016-03-18',\n",
       "  'initialDataReleaseVersion': 'DR18',\n",
       "  'interventionAgent': '23PPV Pneumovax (Merck)',\n",
       "  'latestDataReleaseDate': '2026-09-24',\n",
       "  'latestDataReleaseVersion': 'DR68',\n",
       "  'maximumAge': '  49.00',\n",
       "  'minimumAge': '  22.00',\n",
       "  'objectives': 'To measure immune responses to vaccination with Pneumovax vaccine in healthy adult subjects.',\n",
       "  'officialTitle': 'In-Depth Characterization of Immune Responses to Pneumovax Vaccination in Healthy Subjects',\n",
       "  'sharedStudy': 'Y',\n",
       "  'sponsoringOrganization': 'NIAID',\n",
       "  'targetEnrollment': None}]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "endpoint = DATA_QUERY_URL + \"/api/study/SDY87\"\n",
    "results = api_data_query(endpoint)\n",
    "results"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "qIA_gcRerJ8G",
   "metadata": {
    "id": "qIA_gcRerJ8G"
   },
   "source": [
    "Now let's see if there are other CDEs associated with the data for this study."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6a8tofZZoENQ",
   "metadata": {
    "id": "6a8tofZZoENQ"
   },
   "source": [
    "Retrieve study CDEs\n",
    "\n",
    "/api/study/cde/{studyAccession}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "RjaH7VSrnHG6",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "RjaH7VSrnHG6",
    "outputId": "5dd04d29-9232-4caa-99a4-f388e393dd60",
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'study2CdeMappingId': 12586,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'fmMMaUGpKS',\n",
       "  'name': 'Age',\n",
       "  'cdePvId': None,\n",
       "  'pvLabel': None,\n",
       "  'immportTableName': 'arm_2_subject',\n",
       "  'immportColumnName': 'min_subject_age',\n",
       "  'immportColumnValue': None},\n",
       " {'study2CdeMappingId': 12587,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'FiTk9B5lx',\n",
       "  'name': 'Study Identifier',\n",
       "  'cdePvId': None,\n",
       "  'pvLabel': None,\n",
       "  'immportTableName': 'study',\n",
       "  'immportColumnName': 'study_accession',\n",
       "  'immportColumnValue': 'SDY87'},\n",
       " {'study2CdeMappingId': 12588,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GOr1OFJAKC',\n",
       "  'name': 'Vital Signs Type',\n",
       "  'cdePvId': 'C25298',\n",
       "  'pvLabel': 'Systolic Blood Pressure',\n",
       "  'immportTableName': 'assessment_component',\n",
       "  'immportColumnName': 'name_preferred',\n",
       "  'immportColumnValue': 'Systolic Blood Pressure'},\n",
       " {'study2CdeMappingId': 12589,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GOr1OFJAKC',\n",
       "  'name': 'Vital Signs Type',\n",
       "  'cdePvId': 'C25299',\n",
       "  'pvLabel': 'Diastolic Blood Pressure',\n",
       "  'immportTableName': 'assessment_component',\n",
       "  'immportColumnName': 'name_preferred',\n",
       "  'immportColumnValue': 'Diastolic Blood Pressure'},\n",
       " {'study2CdeMappingId': 12590,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GOr1OFJAKC',\n",
       "  'name': 'Vital Signs Type',\n",
       "  'cdePvId': 'C49677',\n",
       "  'pvLabel': 'Heart Rate',\n",
       "  'immportTableName': 'assessment_component',\n",
       "  'immportColumnName': 'name_preferred',\n",
       "  'immportColumnValue': 'Heart Rate'},\n",
       " {'study2CdeMappingId': 12591,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GOr1OFJAKC',\n",
       "  'name': 'Vital Signs Type',\n",
       "  'cdePvId': 'C49678',\n",
       "  'pvLabel': 'Respiratory Rate',\n",
       "  'immportTableName': 'assessment_component',\n",
       "  'immportColumnName': 'name_preferred',\n",
       "  'immportColumnValue': 'Respiration Rate'},\n",
       " {'study2CdeMappingId': 12592,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GOr1OFJAKC',\n",
       "  'name': 'Vital Signs Type',\n",
       "  'cdePvId': 'C81328',\n",
       "  'pvLabel': 'Weight',\n",
       "  'immportTableName': 'assessment_component',\n",
       "  'immportColumnName': 'name_preferred',\n",
       "  'immportColumnValue': 'Weight'},\n",
       " {'study2CdeMappingId': 12593,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GOr1OFJAKC',\n",
       "  'name': 'Vital Signs Type',\n",
       "  'cdePvId': 'C164634',\n",
       "  'pvLabel': 'Height',\n",
       "  'immportTableName': 'assessment_component',\n",
       "  'immportColumnName': 'name_preferred',\n",
       "  'immportColumnValue': 'Height'},\n",
       " {'study2CdeMappingId': 12594,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'Aguk0xu_dB',\n",
       "  'name': 'Subject ID',\n",
       "  'cdePvId': None,\n",
       "  'pvLabel': None,\n",
       "  'immportTableName': 'subject',\n",
       "  'immportColumnName': 'subject_accession',\n",
       "  'immportColumnValue': 'Subjects Exists'},\n",
       " {'study2CdeMappingId': 12595,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'PDjBiGXjO',\n",
       "  'name': 'Age',\n",
       "  'cdePvId': None,\n",
       "  'pvLabel': None,\n",
       "  'immportTableName': 'arm_2_subject',\n",
       "  'immportColumnName': 'min_subject_age',\n",
       "  'immportColumnValue': None},\n",
       " {'study2CdeMappingId': 12596,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 's0OB4q7Pxk',\n",
       "  'name': 'Age Units',\n",
       "  'cdePvId': 'C29848',\n",
       "  'pvLabel': 'Years',\n",
       "  'immportTableName': 'arm_2_subject',\n",
       "  'immportColumnName': 'age_unit',\n",
       "  'immportColumnValue': 'Years'},\n",
       " {'study2CdeMappingId': 12597,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'GNVoEdFQR0',\n",
       "  'name': 'Age Units',\n",
       "  'cdePvId': 'C29848',\n",
       "  'pvLabel': 'Years',\n",
       "  'immportTableName': 'arm_2_subject',\n",
       "  'immportColumnName': 'age_unit',\n",
       "  'immportColumnValue': 'Years'},\n",
       " {'study2CdeMappingId': 12598,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'sznvIp17G',\n",
       "  'name': 'Unique ID',\n",
       "  'cdePvId': None,\n",
       "  'pvLabel': None,\n",
       "  'immportTableName': 'subject',\n",
       "  'immportColumnName': 'subject_accession',\n",
       "  'immportColumnValue': 'Subjects Exists'},\n",
       " {'study2CdeMappingId': 12599,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'rGEh0ckdmr',\n",
       "  'name': 'Sex at Birth',\n",
       "  'cdePvId': 'C20197',\n",
       "  'pvLabel': 'Male',\n",
       "  'immportTableName': 'subject',\n",
       "  'immportColumnName': 'sex',\n",
       "  'immportColumnValue': 'Male'},\n",
       " {'study2CdeMappingId': 12600,\n",
       "  'studyAccession': 'SDY87',\n",
       "  'cdeId': 'Fakc6Jy2x',\n",
       "  'name': 'Race',\n",
       "  'cdePvId': 'C41261',\n",
       "  'pvLabel': 'White',\n",
       "  'immportTableName': 'subject',\n",
       "  'immportColumnName': 'race',\n",
       "  'immportColumnValue': 'White'}]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "endpoint = DATA_QUERY_URL + \"/api/study/cde/SDY87\"\n",
    "results = api_data_query(endpoint)\n",
    "results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "sI37efJKlPjs",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 520
    },
    "id": "sI37efJKlPjs",
    "outputId": "a6b3f9d8-f7bd-454e-d209-50bae0a1b8fe"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "summary": "{\n  \"name\": \"df_immport_study_cde_sdy87\",\n  \"rows\": 15,\n  \"fields\": [\n    {\n      \"column\": \"study2CdeMappingId\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 4,\n        \"min\": 12586,\n        \"max\": 12600,\n        \"num_unique_values\": 15,\n        \"samples\": [\n          12595,\n          12597,\n          12586\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"studyAccession\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"SDY87\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"cdeId\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"rGEh0ckdmr\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"name\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 8,\n        \"samples\": [\n          \"Study Identifier\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"cdePvId\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 9,\n        \"samples\": [\n          \"C20197\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"pvLabel\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 9,\n        \"samples\": [\n          \"Male\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"immportTableName\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"study\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"immportColumnName\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 7,\n        \"samples\": [\n          \"min_subject_age\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"immportColumnValue\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 11,\n        \"samples\": [\n          \"Weight\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}",
       "type": "dataframe",
       "variable_name": "df_immport_study_cde_sdy87"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-0a07fdd1-1870-44ac-9809-1095107996e3\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>study2CdeMappingId</th>\n",
       "      <th>studyAccession</th>\n",
       "      <th>cdeId</th>\n",
       "      <th>name</th>\n",
       "      <th>cdePvId</th>\n",
       "      <th>pvLabel</th>\n",
       "      <th>immportTableName</th>\n",
       "      <th>immportColumnName</th>\n",
       "      <th>immportColumnValue</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12586</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>fmMMaUGpKS</td>\n",
       "      <td>Age</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>arm_2_subject</td>\n",
       "      <td>min_subject_age</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>12587</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>FiTk9B5lx</td>\n",
       "      <td>Study Identifier</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>study</td>\n",
       "      <td>study_accession</td>\n",
       "      <td>SDY87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>12588</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C25298</td>\n",
       "      <td>Systolic Blood Pressure</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Systolic Blood Pressure</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>12589</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C25299</td>\n",
       "      <td>Diastolic Blood Pressure</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Diastolic Blood Pressure</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12590</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C49677</td>\n",
       "      <td>Heart Rate</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Heart Rate</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>12591</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C49678</td>\n",
       "      <td>Respiratory Rate</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Respiration Rate</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>12592</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C81328</td>\n",
       "      <td>Weight</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Weight</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>12593</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C164634</td>\n",
       "      <td>Height</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Height</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>12594</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>Aguk0xu_dB</td>\n",
       "      <td>Subject ID</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>subject</td>\n",
       "      <td>subject_accession</td>\n",
       "      <td>Subjects Exists</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>12595</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>PDjBiGXjO</td>\n",
       "      <td>Age</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>arm_2_subject</td>\n",
       "      <td>min_subject_age</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>12596</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>s0OB4q7Pxk</td>\n",
       "      <td>Age Units</td>\n",
       "      <td>C29848</td>\n",
       "      <td>Years</td>\n",
       "      <td>arm_2_subject</td>\n",
       "      <td>age_unit</td>\n",
       "      <td>Years</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12597</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GNVoEdFQR0</td>\n",
       "      <td>Age Units</td>\n",
       "      <td>C29848</td>\n",
       "      <td>Years</td>\n",
       "      <td>arm_2_subject</td>\n",
       "      <td>age_unit</td>\n",
       "      <td>Years</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>12598</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>sznvIp17G</td>\n",
       "      <td>Unique ID</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>subject</td>\n",
       "      <td>subject_accession</td>\n",
       "      <td>Subjects Exists</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>12599</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>rGEh0ckdmr</td>\n",
       "      <td>Sex at Birth</td>\n",
       "      <td>C20197</td>\n",
       "      <td>Male</td>\n",
       "      <td>subject</td>\n",
       "      <td>sex</td>\n",
       "      <td>Male</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>12600</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>Fakc6Jy2x</td>\n",
       "      <td>Race</td>\n",
       "      <td>C41261</td>\n",
       "      <td>White</td>\n",
       "      <td>subject</td>\n",
       "      <td>race</td>\n",
       "      <td>White</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-0a07fdd1-1870-44ac-9809-1095107996e3')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-0a07fdd1-1870-44ac-9809-1095107996e3 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-0a07fdd1-1870-44ac-9809-1095107996e3');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "  <div id=\"id_4f16d359-d8a0-4874-9103-198f18d432c9\">\n",
       "    <style>\n",
       "      .colab-df-generate {\n",
       "        background-color: #E8F0FE;\n",
       "        border: none;\n",
       "        border-radius: 50%;\n",
       "        cursor: pointer;\n",
       "        display: none;\n",
       "        fill: #1967D2;\n",
       "        height: 32px;\n",
       "        padding: 0 0 0 0;\n",
       "        width: 32px;\n",
       "      }\n",
       "\n",
       "      .colab-df-generate:hover {\n",
       "        background-color: #E2EBFA;\n",
       "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "        fill: #174EA6;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate {\n",
       "        background-color: #3B4455;\n",
       "        fill: #D2E3FC;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate:hover {\n",
       "        background-color: #434B5C;\n",
       "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "        fill: #FFFFFF;\n",
       "      }\n",
       "    </style>\n",
       "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df_immport_study_cde_sdy87')\"\n",
       "            title=\"Generate code using this dataframe.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
       "       width=\"24px\">\n",
       "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    <script>\n",
       "      (() => {\n",
       "      const buttonEl =\n",
       "        document.querySelector('#id_4f16d359-d8a0-4874-9103-198f18d432c9 button.colab-df-generate');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      buttonEl.onclick = () => {\n",
       "        google.colab.notebook.generateWithVariable('df_immport_study_cde_sdy87');\n",
       "      }\n",
       "      })();\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "    study2CdeMappingId studyAccession       cdeId              name  cdePvId  \\\n",
       "0                12586          SDY87  fmMMaUGpKS               Age     None   \n",
       "1                12587          SDY87   FiTk9B5lx  Study Identifier     None   \n",
       "2                12588          SDY87  GOr1OFJAKC  Vital Signs Type   C25298   \n",
       "3                12589          SDY87  GOr1OFJAKC  Vital Signs Type   C25299   \n",
       "4                12590          SDY87  GOr1OFJAKC  Vital Signs Type   C49677   \n",
       "5                12591          SDY87  GOr1OFJAKC  Vital Signs Type   C49678   \n",
       "6                12592          SDY87  GOr1OFJAKC  Vital Signs Type   C81328   \n",
       "7                12593          SDY87  GOr1OFJAKC  Vital Signs Type  C164634   \n",
       "8                12594          SDY87  Aguk0xu_dB        Subject ID     None   \n",
       "9                12595          SDY87   PDjBiGXjO               Age     None   \n",
       "10               12596          SDY87  s0OB4q7Pxk         Age Units   C29848   \n",
       "11               12597          SDY87  GNVoEdFQR0         Age Units   C29848   \n",
       "12               12598          SDY87   sznvIp17G         Unique ID     None   \n",
       "13               12599          SDY87  rGEh0ckdmr      Sex at Birth   C20197   \n",
       "14               12600          SDY87   Fakc6Jy2x              Race   C41261   \n",
       "\n",
       "                     pvLabel      immportTableName  immportColumnName  \\\n",
       "0                       None         arm_2_subject    min_subject_age   \n",
       "1                       None                 study    study_accession   \n",
       "2    Systolic Blood Pressure  assessment_component     name_preferred   \n",
       "3   Diastolic Blood Pressure  assessment_component     name_preferred   \n",
       "4                 Heart Rate  assessment_component     name_preferred   \n",
       "5           Respiratory Rate  assessment_component     name_preferred   \n",
       "6                     Weight  assessment_component     name_preferred   \n",
       "7                     Height  assessment_component     name_preferred   \n",
       "8                       None               subject  subject_accession   \n",
       "9                       None         arm_2_subject    min_subject_age   \n",
       "10                     Years         arm_2_subject           age_unit   \n",
       "11                     Years         arm_2_subject           age_unit   \n",
       "12                      None               subject  subject_accession   \n",
       "13                      Male               subject                sex   \n",
       "14                     White               subject               race   \n",
       "\n",
       "          immportColumnValue  \n",
       "0                       None  \n",
       "1                      SDY87  \n",
       "2    Systolic Blood Pressure  \n",
       "3   Diastolic Blood Pressure  \n",
       "4                 Heart Rate  \n",
       "5           Respiration Rate  \n",
       "6                     Weight  \n",
       "7                     Height  \n",
       "8            Subjects Exists  \n",
       "9                       None  \n",
       "10                     Years  \n",
       "11                     Years  \n",
       "12           Subjects Exists  \n",
       "13                      Male  \n",
       "14                     White  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_immport_study_cde_sdy87 = pd.read_json(json.dumps(results))\n",
    "df_immport_study_cde_sdy87"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "np_nEuMbaYer",
   "metadata": {
    "id": "np_nEuMbaYer"
   },
   "source": [
    "We can see that this study includes multiple other CDEs beyond the one we were initially interested in, if we'd like to explore them further."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "yMFwSNMNjgyz",
   "metadata": {
    "id": "yMFwSNMNjgyz"
   },
   "source": [
    "# Join with data from another repository\n",
    "\n",
    "## Use the CDE ID to pull additional information about the CDE of interest (Vital Signs Type) from the NIH CDE repository."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "14SxY8YtpSf7",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "collapsed": true,
    "id": "14SxY8YtpSf7",
    "jupyter": {
     "outputs_hidden": true
    },
    "outputId": "ed4021fc-832f-4046-c76e-f7bd948ef745"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stewardOrg': {'name': 'Project 5'},\n",
       " 'createdBy': {'username': 'NIH CDE Repository Team'},\n",
       " 'property': {'concepts': []},\n",
       " 'dataElementConcept': {'concepts': [{'name': 'Vital Signs Measurement',\n",
       "    'origin': 'NCI Thesaurus',\n",
       "    'originId': 'C49672'},\n",
       "   {'name': 'Type', 'origin': 'NCI Thesaurus', 'originId': 'C25284'}]},\n",
       " 'objectClass': {'concepts': []},\n",
       " 'valueDomain': {'identifiers': [],\n",
       "  'ids': [],\n",
       "  'datatype': 'Value List',\n",
       "  'permissibleValues': [{'permissibleValue': 'Systolic blood pressure',\n",
       "    'valueMeaningDefinition': 'The maximum pressure exerted into the systemic arterial circulation during the contraction of the left ventricle of the heart C25298',\n",
       "    'conceptId': 'C25298',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Diastolic blood pressure',\n",
       "    'valueMeaningDefinition': 'The minimum pressure exerted into the systemic arterial circulation during cardiac ventricular relaxation and filling C25299',\n",
       "    'conceptId': 'C25299',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Heart rate',\n",
       "    'valueMeaningDefinition': 'The number of heartbeats per unit of time, usually expressed as beats per minute. C49677',\n",
       "    'conceptId': 'C49677',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Respiratory rate',\n",
       "    'valueMeaningDefinition': 'The rate of breathing (inhalation and exhalation) measured within in a unit time, usually expressed as breaths per minute C49678',\n",
       "    'conceptId': 'C49678',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Body temperature',\n",
       "    'valueMeaningDefinition': 'A measurement of the temperature of the body C174446',\n",
       "    'conceptId': 'C174446',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Weight',\n",
       "    'valueMeaningDefinition': 'The weight of a subject C81328',\n",
       "    'conceptId': 'C81328',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Height',\n",
       "    'valueMeaningDefinition': 'The vertical measurement or distance from the base to the top of a subject or participant C164634',\n",
       "    'conceptId': 'C164634',\n",
       "    'conceptSource': 'NCI Thesaurus'},\n",
       "   {'permissibleValue': 'Oxygen Saturation',\n",
       "    'valueMeaningDefinition': 'The measurement of the ratio of oxygenated hemoglobin to total hemoglobin in the blood C60832',\n",
       "    'conceptId': 'C60832',\n",
       "    'conceptSource': 'NCI Thesaurus'}]},\n",
       " '_id': '62432240ad66cd31638d50d4',\n",
       " 'elementType': 'cde',\n",
       " 'nihEndorsed': True,\n",
       " 'tinyId': 'GOr1OFJAKC',\n",
       " 'designations': [{'designation': 'Vital Signs Type',\n",
       "   'tags': [],\n",
       "   'sources': ['Project 5']},\n",
       "  {'designation': 'Vital Sign Name',\n",
       "   'tags': ['Preferred Question Text'],\n",
       "   'sources': ['Project 5']}],\n",
       " 'definitions': [{'definition': \"A textual description of a person's vital signs measurement category.\",\n",
       "   'tags': [],\n",
       "   'sources': ['Project 5']}],\n",
       " 'sources': [{'sourceName': 'Project 5',\n",
       "   'imported': '2022-03-29T15:13:59.754Z'}],\n",
       " 'created': '2022-03-29T15:13:59.754Z',\n",
       " 'imported': '2022-03-29T15:13:59.754Z',\n",
       " 'changeNote': 'Update Name Source',\n",
       " 'registrationState': {'registrationStatus': 'Qualified',\n",
       "  'administrativeStatus': 'Org Approve'},\n",
       " 'classification': [{'stewardOrg': {'name': 'Project 5'},\n",
       "   'elements': [{'elements': [{'elements': [], 'name': 'Tier 1'}],\n",
       "     'name': 'Project 5 (COVID-19)'}]}],\n",
       " 'properties': [{'key': 'Tags/Keywords',\n",
       "   'value': 'Person, Diagnosis, Vital Signs',\n",
       "   'source': 'Project 5'},\n",
       "  {'key': 'Project 5 Source', 'value': 'FDA, CDC', 'source': 'Project 5'}],\n",
       " 'ids': [],\n",
       " 'attachments': [],\n",
       " 'history': [],\n",
       " 'archived': False,\n",
       " 'views': 4473,\n",
       " 'referenceDocuments': [],\n",
       " 'dataSets': [],\n",
       " 'derivationRules': [],\n",
       " '__v': 30514,\n",
       " 'partOfBundles': ['w_QQb9XUq']}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cdeId = \"GOr1OFJAKC\"\n",
    "\n",
    "base_url = 'https://cde.nlm.nih.gov/api'\n",
    "\n",
    "search_url = base_url + \"/de/\" + cdeId\n",
    "\n",
    "headers= {\n",
    "    'accept': 'application/json',\n",
    "    'Content-Type': 'application/json'\n",
    "}\n",
    "\n",
    "r = requests.get(search_url, headers=headers)\n",
    "results = r.json()\n",
    "results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "vKz7qWBUxgqd",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 182
    },
    "id": "vKz7qWBUxgqd",
    "outputId": "62116a7f-fdb2-4b77-cadc-36e893f016aa"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "variable_name": "df_nih_cde"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-bbb8de78-6ec3-440a-bf16-07960ffc313d\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_id</th>\n",
       "      <th>elementType</th>\n",
       "      <th>nihEndorsed</th>\n",
       "      <th>tinyId</th>\n",
       "      <th>designations</th>\n",
       "      <th>definitions</th>\n",
       "      <th>sources</th>\n",
       "      <th>created</th>\n",
       "      <th>imported</th>\n",
       "      <th>changeNote</th>\n",
       "      <th>...</th>\n",
       "      <th>createdBy.username</th>\n",
       "      <th>property.concepts</th>\n",
       "      <th>dataElementConcept.concepts</th>\n",
       "      <th>objectClass.concepts</th>\n",
       "      <th>valueDomain.identifiers</th>\n",
       "      <th>valueDomain.ids</th>\n",
       "      <th>valueDomain.datatype</th>\n",
       "      <th>valueDomain.permissibleValues</th>\n",
       "      <th>registrationState.registrationStatus</th>\n",
       "      <th>registrationState.administrativeStatus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>62432240ad66cd31638d50d4</td>\n",
       "      <td>cde</td>\n",
       "      <td>True</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>[{'designation': 'Vital Signs Type', 'tags': [...</td>\n",
       "      <td>[{'definition': 'A textual description of a pe...</td>\n",
       "      <td>[{'sourceName': 'Project 5', 'imported': '2022...</td>\n",
       "      <td>2022-03-29T15:13:59.754Z</td>\n",
       "      <td>2022-03-29T15:13:59.754Z</td>\n",
       "      <td>Update Name Source</td>\n",
       "      <td>...</td>\n",
       "      <td>NIH CDE Repository Team</td>\n",
       "      <td>[]</td>\n",
       "      <td>[{'name': 'Vital Signs Measurement', 'origin':...</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>Value List</td>\n",
       "      <td>[{'permissibleValue': 'Systolic blood pressure...</td>\n",
       "      <td>Qualified</td>\n",
       "      <td>Org Approve</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 33 columns</p>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-bbb8de78-6ec3-440a-bf16-07960ffc313d')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-bbb8de78-6ec3-440a-bf16-07960ffc313d button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-bbb8de78-6ec3-440a-bf16-07960ffc313d');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "  <div id=\"id_018d9663-df98-4a31-bb40-e82eea92a601\">\n",
       "    <style>\n",
       "      .colab-df-generate {\n",
       "        background-color: #E8F0FE;\n",
       "        border: none;\n",
       "        border-radius: 50%;\n",
       "        cursor: pointer;\n",
       "        display: none;\n",
       "        fill: #1967D2;\n",
       "        height: 32px;\n",
       "        padding: 0 0 0 0;\n",
       "        width: 32px;\n",
       "      }\n",
       "\n",
       "      .colab-df-generate:hover {\n",
       "        background-color: #E2EBFA;\n",
       "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "        fill: #174EA6;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate {\n",
       "        background-color: #3B4455;\n",
       "        fill: #D2E3FC;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate:hover {\n",
       "        background-color: #434B5C;\n",
       "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "        fill: #FFFFFF;\n",
       "      }\n",
       "    </style>\n",
       "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df_nih_cde')\"\n",
       "            title=\"Generate code using this dataframe.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
       "       width=\"24px\">\n",
       "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    <script>\n",
       "      (() => {\n",
       "      const buttonEl =\n",
       "        document.querySelector('#id_018d9663-df98-4a31-bb40-e82eea92a601 button.colab-df-generate');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      buttonEl.onclick = () => {\n",
       "        google.colab.notebook.generateWithVariable('df_nih_cde');\n",
       "      }\n",
       "      })();\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "                        _id elementType  nihEndorsed      tinyId  \\\n",
       "0  62432240ad66cd31638d50d4         cde         True  GOr1OFJAKC   \n",
       "\n",
       "                                        designations  \\\n",
       "0  [{'designation': 'Vital Signs Type', 'tags': [...   \n",
       "\n",
       "                                         definitions  \\\n",
       "0  [{'definition': 'A textual description of a pe...   \n",
       "\n",
       "                                             sources  \\\n",
       "0  [{'sourceName': 'Project 5', 'imported': '2022...   \n",
       "\n",
       "                    created                  imported          changeNote  \\\n",
       "0  2022-03-29T15:13:59.754Z  2022-03-29T15:13:59.754Z  Update Name Source   \n",
       "\n",
       "   ...       createdBy.username property.concepts  \\\n",
       "0  ...  NIH CDE Repository Team                []   \n",
       "\n",
       "                         dataElementConcept.concepts objectClass.concepts  \\\n",
       "0  [{'name': 'Vital Signs Measurement', 'origin':...                   []   \n",
       "\n",
       "  valueDomain.identifiers  valueDomain.ids  valueDomain.datatype  \\\n",
       "0                      []               []            Value List   \n",
       "\n",
       "                       valueDomain.permissibleValues  \\\n",
       "0  [{'permissibleValue': 'Systolic blood pressure...   \n",
       "\n",
       "  registrationState.registrationStatus registrationState.administrativeStatus  \n",
       "0                            Qualified                            Org Approve  \n",
       "\n",
       "[1 rows x 33 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Normalize the JSON\n",
    "df_nih_cde = pd.json_normalize(results)\n",
    "df_nih_cde"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "QOmXHAoBzE_y",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 165
    },
    "id": "QOmXHAoBzE_y",
    "outputId": "1f18d941-20f1-40a2-edad-3d3666d4554a"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "variable_name": "df_merged"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-a569ee68-8820-4ab6-9134-38c4da22939a\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>study2CdeMappingId</th>\n",
       "      <th>studyAccession</th>\n",
       "      <th>cdeId</th>\n",
       "      <th>name</th>\n",
       "      <th>cdePvId</th>\n",
       "      <th>pvLabel</th>\n",
       "      <th>immportTableName</th>\n",
       "      <th>immportColumnName</th>\n",
       "      <th>immportColumnValue</th>\n",
       "      <th>_id</th>\n",
       "      <th>...</th>\n",
       "      <th>createdBy.username</th>\n",
       "      <th>property.concepts</th>\n",
       "      <th>dataElementConcept.concepts</th>\n",
       "      <th>objectClass.concepts</th>\n",
       "      <th>valueDomain.identifiers</th>\n",
       "      <th>valueDomain.ids</th>\n",
       "      <th>valueDomain.datatype</th>\n",
       "      <th>valueDomain.permissibleValues</th>\n",
       "      <th>registrationState.registrationStatus</th>\n",
       "      <th>registrationState.administrativeStatus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12592</td>\n",
       "      <td>SDY87</td>\n",
       "      <td>GOr1OFJAKC</td>\n",
       "      <td>Vital Signs Type</td>\n",
       "      <td>C81328</td>\n",
       "      <td>Weight</td>\n",
       "      <td>assessment_component</td>\n",
       "      <td>name_preferred</td>\n",
       "      <td>Weight</td>\n",
       "      <td>62432240ad66cd31638d50d4</td>\n",
       "      <td>...</td>\n",
       "      <td>NIH CDE Repository Team</td>\n",
       "      <td>[]</td>\n",
       "      <td>[{'name': 'Vital Signs Measurement', 'origin':...</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>Value List</td>\n",
       "      <td>[{'permissibleValue': 'Systolic blood pressure...</td>\n",
       "      <td>Qualified</td>\n",
       "      <td>Org Approve</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 42 columns</p>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-a569ee68-8820-4ab6-9134-38c4da22939a')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-a569ee68-8820-4ab6-9134-38c4da22939a button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-a569ee68-8820-4ab6-9134-38c4da22939a');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "  <div id=\"id_d48fcdba-529f-4fee-959d-93f6e3e7d59e\">\n",
       "    <style>\n",
       "      .colab-df-generate {\n",
       "        background-color: #E8F0FE;\n",
       "        border: none;\n",
       "        border-radius: 50%;\n",
       "        cursor: pointer;\n",
       "        display: none;\n",
       "        fill: #1967D2;\n",
       "        height: 32px;\n",
       "        padding: 0 0 0 0;\n",
       "        width: 32px;\n",
       "      }\n",
       "\n",
       "      .colab-df-generate:hover {\n",
       "        background-color: #E2EBFA;\n",
       "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "        fill: #174EA6;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate {\n",
       "        background-color: #3B4455;\n",
       "        fill: #D2E3FC;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate:hover {\n",
       "        background-color: #434B5C;\n",
       "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "        fill: #FFFFFF;\n",
       "      }\n",
       "    </style>\n",
       "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df_merged')\"\n",
       "            title=\"Generate code using this dataframe.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
       "       width=\"24px\">\n",
       "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    <script>\n",
       "      (() => {\n",
       "      const buttonEl =\n",
       "        document.querySelector('#id_d48fcdba-529f-4fee-959d-93f6e3e7d59e button.colab-df-generate');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      buttonEl.onclick = () => {\n",
       "        google.colab.notebook.generateWithVariable('df_merged');\n",
       "      }\n",
       "      })();\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "   study2CdeMappingId studyAccession       cdeId              name cdePvId  \\\n",
       "0               12592          SDY87  GOr1OFJAKC  Vital Signs Type  C81328   \n",
       "\n",
       "  pvLabel      immportTableName immportColumnName immportColumnValue  \\\n",
       "0  Weight  assessment_component    name_preferred             Weight   \n",
       "\n",
       "                        _id  ...       createdBy.username  property.concepts  \\\n",
       "0  62432240ad66cd31638d50d4  ...  NIH CDE Repository Team                 []   \n",
       "\n",
       "                         dataElementConcept.concepts objectClass.concepts  \\\n",
       "0  [{'name': 'Vital Signs Measurement', 'origin':...                   []   \n",
       "\n",
       "  valueDomain.identifiers valueDomain.ids valueDomain.datatype  \\\n",
       "0                      []              []           Value List   \n",
       "\n",
       "                       valueDomain.permissibleValues  \\\n",
       "0  [{'permissibleValue': 'Systolic blood pressure...   \n",
       "\n",
       "  registrationState.registrationStatus registrationState.administrativeStatus  \n",
       "0                            Qualified                            Org Approve  \n",
       "\n",
       "[1 rows x 42 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# filter the data from the ImmPort API to include only the row that corresponds to the CDE permissible value we are interested in (Weight) and join it with the results from the CDE API\n",
    "df_merged = pd.merge(df_immport_study_cde_sdy87[df_immport_study_cde_sdy87[\"cdePvId\"] == \"C81328\"], df_nih_cde, left_on='cdeId', right_on='tinyId', how='inner')\n",
    "df_merged"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2SclYY80Yzmq",
   "metadata": {
    "id": "2SclYY80Yzmq"
   },
   "source": [
    "We can see that the NIH CDE repository API results provide us with lots of additional metadata about the CDE of interest.  Perhaps we are interested in getting a list of all possbile permissible values for this CDE to investigate what other possible vital sign type values exist."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "xmwpkf4t1DaK",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 300
    },
    "id": "xmwpkf4t1DaK",
    "outputId": "147cd901-dd73-4459-b1ab-0889c84370b6"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "summary": "{\n  \"name\": \"pd\",\n  \"rows\": 8,\n  \"fields\": [\n    {\n      \"column\": \"permissibleValue\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 8,\n        \"samples\": [\n          \"Diastolic blood pressure\",\n          \"Weight\",\n          \"Systolic blood pressure\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"valueMeaningDefinition\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 8,\n        \"samples\": [\n          \"The minimum pressure exerted into the systemic arterial circulation during cardiac ventricular relaxation and filling C25299\",\n          \"The weight of a subject C81328\",\n          \"The maximum pressure exerted into the systemic arterial circulation during the contraction of the left ventricle of the heart C25298\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"conceptId\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 8,\n        \"samples\": [\n          \"C25299\",\n          \"C81328\",\n          \"C25298\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"conceptSource\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"NCI Thesaurus\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}",
       "type": "dataframe"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-69eb7abf-76f1-4e3b-8f27-df0520d18159\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>permissibleValue</th>\n",
       "      <th>valueMeaningDefinition</th>\n",
       "      <th>conceptId</th>\n",
       "      <th>conceptSource</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Systolic blood pressure</td>\n",
       "      <td>The maximum pressure exerted into the systemic...</td>\n",
       "      <td>C25298</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Diastolic blood pressure</td>\n",
       "      <td>The minimum pressure exerted into the systemic...</td>\n",
       "      <td>C25299</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Heart rate</td>\n",
       "      <td>The number of heartbeats per unit of time, usu...</td>\n",
       "      <td>C49677</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Respiratory rate</td>\n",
       "      <td>The rate of breathing (inhalation and exhalati...</td>\n",
       "      <td>C49678</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Body temperature</td>\n",
       "      <td>A measurement of the temperature of the body C...</td>\n",
       "      <td>C174446</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Weight</td>\n",
       "      <td>The weight of a subject C81328</td>\n",
       "      <td>C81328</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Height</td>\n",
       "      <td>The vertical measurement or distance from the ...</td>\n",
       "      <td>C164634</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Oxygen Saturation</td>\n",
       "      <td>The measurement of the ratio of oxygenated hem...</td>\n",
       "      <td>C60832</td>\n",
       "      <td>NCI Thesaurus</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-69eb7abf-76f1-4e3b-8f27-df0520d18159')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-69eb7abf-76f1-4e3b-8f27-df0520d18159 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-69eb7abf-76f1-4e3b-8f27-df0520d18159');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "           permissibleValue  \\\n",
       "0   Systolic blood pressure   \n",
       "1  Diastolic blood pressure   \n",
       "2                Heart rate   \n",
       "3          Respiratory rate   \n",
       "4          Body temperature   \n",
       "5                    Weight   \n",
       "6                    Height   \n",
       "7         Oxygen Saturation   \n",
       "\n",
       "                              valueMeaningDefinition conceptId  conceptSource  \n",
       "0  The maximum pressure exerted into the systemic...    C25298  NCI Thesaurus  \n",
       "1  The minimum pressure exerted into the systemic...    C25299  NCI Thesaurus  \n",
       "2  The number of heartbeats per unit of time, usu...    C49677  NCI Thesaurus  \n",
       "3  The rate of breathing (inhalation and exhalati...    C49678  NCI Thesaurus  \n",
       "4  A measurement of the temperature of the body C...   C174446  NCI Thesaurus  \n",
       "5                     The weight of a subject C81328    C81328  NCI Thesaurus  \n",
       "6  The vertical measurement or distance from the ...   C164634  NCI Thesaurus  \n",
       "7  The measurement of the ratio of oxygenated hem...    C60832  NCI Thesaurus  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_json(json.dumps(df_merged[\"valueDomain.permissibleValues\"][0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "q49TIyOL1aWV",
   "metadata": {
    "id": "q49TIyOL1aWV"
   },
   "source": [
    "Now we can see all the possible permissible values for this CDE from the NIH CDE repository metadata.  We can see that each of these concepts comes from the NCI Thesaurus and that there exists a corresponding definition and concept ID for each of the permissible values."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "AJTPpWgDZbx1",
   "metadata": {
    "id": "AJTPpWgDZbx1"
   },
   "source": [
    "# Next Steps\n",
    "\n",
    "This same approach can be utilized to search for other CDE data within ImmPort and combine the results with data from other repositories that incorporate the use of CDEs, as adoption of CDEs increases."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ehuilqSLZx5u",
   "metadata": {
    "id": "ehuilqSLZx5u"
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
