[ab5bfb]: / vital_signs.ipynb

Download this file

662 lines (661 with data), 26.6 kB

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a570f68c-d378-4716-b1ff-1b50f4acd8a3",
   "metadata": {},
   "outputs": [],
   "source": [
    "filepath = './data/csv/observations.csv'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f717307c-ddd5-4e7e-9e7f-440b2b009835",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "833a7f9c-d3a1-4743-ae12-602576e92ce2",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(filepath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "33ea73db-da7a-4621-9910-c646c0271a6f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 20742 entries, 0 to 20741\n",
      "Data columns (total 9 columns):\n",
      " #   Column       Non-Null Count  Dtype \n",
      "---  ------       --------------  ----- \n",
      " 0   DATE         20742 non-null  object\n",
      " 1   PATIENT      20742 non-null  object\n",
      " 2   ENCOUNTER    19194 non-null  object\n",
      " 3   CATEGORY     19194 non-null  object\n",
      " 4   CODE         20742 non-null  object\n",
      " 5   DESCRIPTION  20742 non-null  object\n",
      " 6   VALUE        20742 non-null  object\n",
      " 7   UNITS        14744 non-null  object\n",
      " 8   TYPE         20742 non-null  object\n",
      "dtypes: object(9)\n",
      "memory usage: 1.4+ MB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "9b2aae31-6744-448e-bf8a-385dc52fac8c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['vital-signs', 'social-history', 'survey', 'laboratory', nan,\n",
       "       'exam', 'procedure'], dtype=object)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"CATEGORY\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7c14585b-e91a-4467-87c3-dbb82ae24857",
   "metadata": {},
   "outputs": [],
   "source": [
    "def isnumber(num):\n",
    "    try:\n",
    "        float(num)\n",
    "        return True\n",
    "    except ValueError:\n",
    "        return False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d096f972-5cbe-434b-a640-6d77fcb76b2c",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df[df[\"VALUE\"].apply(lambda x: isnumber(x))]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e27de5af-ffc1-473c-a4b4-514b38a4feb3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "ecafbe81-3d34-40dc-b670-4ee6a507fda5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 18 entries, 0 to 13685\n",
      "Data columns (total 2 columns):\n",
      " #   Column       Non-Null Count  Dtype \n",
      "---  ------       --------------  ----- \n",
      " 0   DESCRIPTION  18 non-null     object\n",
      " 1   UNITS        18 non-null     object\n",
      "dtypes: object(2)\n",
      "memory usage: 432.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "df[df[\"CATEGORY\"] == 'vital-signs'][['DESCRIPTION', 'UNITS']].drop_duplicates().info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "dfb869f3-ec6e-4484-8ddb-93b913fd7dfd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<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>DATE</th>\n",
       "      <th>PATIENT</th>\n",
       "      <th>ENCOUNTER</th>\n",
       "      <th>CATEGORY</th>\n",
       "      <th>CODE</th>\n",
       "      <th>DESCRIPTION</th>\n",
       "      <th>VALUE</th>\n",
       "      <th>UNITS</th>\n",
       "      <th>TYPE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>19203</th>\n",
       "      <td>2021-05-18T06:00:31Z</td>\n",
       "      <td>ba193b51-efb6-4323-51df-db3877751e4b</td>\n",
       "      <td>61df5560-7382-462b-7b98-23c1ef382ed7</td>\n",
       "      <td>laboratory</td>\n",
       "      <td>20454-5</td>\n",
       "      <td>Protein [Presence] in Urine by Test strip</td>\n",
       "      <td>1.0</td>\n",
       "      <td>{presence}</td>\n",
       "      <td>numeric</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       DATE                               PATIENT  \\\n",
       "19203  2021-05-18T06:00:31Z  ba193b51-efb6-4323-51df-db3877751e4b   \n",
       "\n",
       "                                  ENCOUNTER    CATEGORY     CODE  \\\n",
       "19203  61df5560-7382-462b-7b98-23c1ef382ed7  laboratory  20454-5   \n",
       "\n",
       "                                     DESCRIPTION VALUE       UNITS     TYPE  \n",
       "19203  Protein [Presence] in Urine by Test strip   1.0  {presence}  numeric  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[\"DESCRIPTION\"] == 'Protein [Presence] in Urine by Test strip']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "bf60d2a8-252f-4bcc-82d5-8a5265d67b9b",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'DESCRIPTION': 'Glucose', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Urea Nitrogen', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Creatinine', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Calcium', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Sodium', 'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Potassium', 'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Chloride', 'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Carbon Dioxide', 'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Total Cholesterol', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Triglycerides', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Low Density Lipoprotein Cholesterol', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'High Density Lipoprotein Cholesterol', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Hemoglobin A1c/Hemoglobin.total in Blood', 'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Leukocytes [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Erythrocytes [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*6/uL'},\n",
       " {'DESCRIPTION': 'Hemoglobin [Mass/volume] in Blood', 'UNITS': 'g/dL'},\n",
       " {'DESCRIPTION': 'Hematocrit [Volume Fraction] of Blood by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'MCV [Entitic volume] by Automated count', 'UNITS': 'fL'},\n",
       " {'DESCRIPTION': 'MCH [Entitic mass] by Automated count', 'UNITS': 'pg'},\n",
       " {'DESCRIPTION': 'MCHC [Mass/volume] by Automated count', 'UNITS': 'g/dL'},\n",
       " {'DESCRIPTION': 'Erythrocyte distribution width [Entitic volume] by Automated count',\n",
       "  'UNITS': 'fL'},\n",
       " {'DESCRIPTION': 'Platelets [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Platelet distribution width [Entitic volume] in Blood by Automated count',\n",
       "  'UNITS': 'fL'},\n",
       " {'DESCRIPTION': 'Platelet mean volume [Entitic volume] in Blood by Automated count',\n",
       "  'UNITS': 'fL'},\n",
       " {'DESCRIPTION': 'Glomerular filtration rate/1.73 sq M.predicted',\n",
       "  'UNITS': 'mL/min'},\n",
       " {'DESCRIPTION': 'Glucose [Mass/volume] in Urine by Test strip',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Bilirubin.total [Mass/volume] in Urine by Test strip',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Ketones [Mass/volume] in Urine by Test strip',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Specific gravity of Urine by Test strip',\n",
       "  'UNITS': '{nominal}'},\n",
       " {'DESCRIPTION': 'pH of Urine by Test strip', 'UNITS': 'pH'},\n",
       " {'DESCRIPTION': 'Protein [Mass/volume] in Urine by Test strip',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Erythrocyte distribution width [Ratio] by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Neutrophils/100 leukocytes in Blood by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Lymphocytes/100 leukocytes in Blood by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Monocytes/100 leukocytes in Blood by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Eosinophils/100 leukocytes in Blood by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Basophils/100 leukocytes in Blood by Automated count',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Neutrophils [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Lymphocytes [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Monocytes [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Eosinophils [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Basophils [#/volume] in Blood by Automated count',\n",
       "  'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'Glucose [Mass/volume] in Serum or Plasma', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Urea nitrogen [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Creatinine [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Calcium [Mass/volume] in Serum or Plasma', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Sodium [Moles/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Potassium [Moles/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Chloride [Moles/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Carbon dioxide  total [Moles/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Protein [Mass/volume] in Serum or Plasma', 'UNITS': 'g/dL'},\n",
       " {'DESCRIPTION': 'Albumin [Mass/volume] in Serum or Plasma', 'UNITS': 'g/dL'},\n",
       " {'DESCRIPTION': 'Bilirubin.total [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma',\n",
       "  'UNITS': 'U/L'},\n",
       " {'DESCRIPTION': 'Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma',\n",
       "  'UNITS': 'U/L'},\n",
       " {'DESCRIPTION': 'Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma',\n",
       "  'UNITS': 'U/L'},\n",
       " {'DESCRIPTION': 'Fibrin D-dimer FEU [Mass/volume] in Platelet poor plasma',\n",
       "  'UNITS': 'ug/mL'},\n",
       " {'DESCRIPTION': 'Ferritin [Mass/volume] in Serum or Plasma', 'UNITS': 'ug/L'},\n",
       " {'DESCRIPTION': 'Troponin I.cardiac [Mass/volume] in Serum or Plasma by High sensitivity method',\n",
       "  'UNITS': 'pg/mL'},\n",
       " {'DESCRIPTION': 'Lactate dehydrogenase [Enzymatic activity/volume] in Serum or Plasma by Lactate to pyruvate reaction',\n",
       "  'UNITS': 'U/L'},\n",
       " {'DESCRIPTION': 'Creatine kinase [Enzymatic activity/volume] in Serum or Plasma',\n",
       "  'UNITS': 'U/L'},\n",
       " {'DESCRIPTION': 'C reactive protein [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mg/L'},\n",
       " {'DESCRIPTION': 'Prothrombin time (PT)', 'UNITS': 's'},\n",
       " {'DESCRIPTION': 'INR in Platelet poor plasma by Coagulation assay',\n",
       "  'UNITS': '{INR}'},\n",
       " {'DESCRIPTION': 'Procalcitonin [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'ng/mL'},\n",
       " {'DESCRIPTION': 'NT-proBNP', 'UNITS': 'pg/mL'},\n",
       " {'DESCRIPTION': 'Magnesium [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'Iron [Mass/volume] in Serum or Plasma', 'UNITS': 'ug/dL'},\n",
       " {'DESCRIPTION': 'Iron binding capacity [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'ug/dL'},\n",
       " {'DESCRIPTION': 'Iron saturation [Mass Fraction] in Serum or Plasma',\n",
       "  'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Left ventricular Ejection fraction', 'UNITS': '%'},\n",
       " {'DESCRIPTION': 'Hematocrit [Volume Fraction] of Blood', 'UNITS': '%'},\n",
       " {'DESCRIPTION': 'WBC Auto (Bld) [#/Vol]', 'UNITS': '10*3/uL'},\n",
       " {'DESCRIPTION': 'RBC Auto (Bld) [#/Vol]', 'UNITS': '10*6/uL'},\n",
       " {'DESCRIPTION': 'RDW - Erythrocyte distribution width Auto (RBC) [Entitic vol]',\n",
       "  'UNITS': 'fL'},\n",
       " {'DESCRIPTION': 'Globulin [Mass/volume] in Serum by calculation',\n",
       "  'UNITS': 'g/L'},\n",
       " {'DESCRIPTION': 'Hemoglobin.gastrointestinal [Presence] in Stool by Immunologic method',\n",
       "  'UNITS': 'ng/mL'},\n",
       " {'DESCRIPTION': 'Microalbumin Creatinine Ratio', 'UNITS': 'mg/g'},\n",
       " {'DESCRIPTION': 'Estimated Glomerular Filtration Rate',\n",
       "  'UNITS': 'mL/min/{1.73_m2}'},\n",
       " {'DESCRIPTION': 'Peanut IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Walnut IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Codfish IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Shrimp IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Wheat IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Egg white IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Soybean IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Cow milk IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'White oak IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Common Ragweed IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Cat dander IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'American house dust mite IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Cladosporium herbarum IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Honey bee IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Latex IgE Ab in Serum', 'UNITS': 'kU/L'},\n",
       " {'DESCRIPTION': 'Lactate [Moles/volume] in Blood', 'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Diastolic Blood Pressure', 'UNITS': 'mm[Hg]'},\n",
       " {'DESCRIPTION': 'Magnesium [Mass/volume] in Blood', 'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'aPTT in Blood by Coagulation assay', 'UNITS': 's'},\n",
       " {'DESCRIPTION': 'Troponin I.cardiac [Mass/volume] in Serum or Plasma by High sensitivity method',\n",
       "  'UNITS': 'ng/L'},\n",
       " {'DESCRIPTION': 'Phosphate [Mass/volume] in Serum or Plasma',\n",
       "  'UNITS': 'mg/dL'},\n",
       " {'DESCRIPTION': 'pH of Arterial blood', 'UNITS': '[pH]'},\n",
       " {'DESCRIPTION': 'Carbon dioxide [Partial pressure] in Arterial blood',\n",
       "  'UNITS': 'mm[Hg]'},\n",
       " {'DESCRIPTION': 'Oxygen [Partial pressure] in Arterial blood',\n",
       "  'UNITS': 'mm[Hg]'},\n",
       " {'DESCRIPTION': 'Bicarbonate [Moles/volume] in Arterial blood',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Activated clotting time (ACT) of Blood by Coagulation assay',\n",
       "  'UNITS': 's'},\n",
       " {'DESCRIPTION': 'pH of Venous blood', 'UNITS': '[pH]'},\n",
       " {'DESCRIPTION': 'Carbon dioxide [Partial pressure] in Venous blood',\n",
       "  'UNITS': 'mm[Hg]'},\n",
       " {'DESCRIPTION': 'Oxygen [Partial pressure] in Venous blood',\n",
       "  'UNITS': 'mm[Hg]'},\n",
       " {'DESCRIPTION': 'Bicarbonate [Moles/volume] in Venous blood',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Carbon dioxide  total [Moles/volume] in Venous blood',\n",
       "  'UNITS': 'mmol/L'},\n",
       " {'DESCRIPTION': 'Thyrotropin [Units/volume] in Serum or Plasma',\n",
       "  'UNITS': 'm[IU]/L'},\n",
       " {'DESCRIPTION': 'Glucose [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'},\n",
       " {'DESCRIPTION': 'Bilirubin.total [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'},\n",
       " {'DESCRIPTION': 'Ketones [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'},\n",
       " {'DESCRIPTION': 'Specific gravity of Urine by Test strip', 'UNITS': '{SG}'},\n",
       " {'DESCRIPTION': 'pH of Urine by Test strip', 'UNITS': '[pH]'},\n",
       " {'DESCRIPTION': 'Protein [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'},\n",
       " {'DESCRIPTION': 'Nitrite [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'},\n",
       " {'DESCRIPTION': 'Hemoglobin [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'},\n",
       " {'DESCRIPTION': 'Leukocyte esterase [Presence] in Urine by Test strip',\n",
       "  'UNITS': '{presence}'}]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[\"CATEGORY\"] == 'laboratory'][['DESCRIPTION', 'UNITS']].dropna().drop_duplicates().to_dict('records')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "d1688233-f642-4001-988a-7a55d6b198e4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<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>DATE</th>\n",
       "      <th>PATIENT</th>\n",
       "      <th>ENCOUNTER</th>\n",
       "      <th>CATEGORY</th>\n",
       "      <th>CODE</th>\n",
       "      <th>DESCRIPTION</th>\n",
       "      <th>VALUE</th>\n",
       "      <th>UNITS</th>\n",
       "      <th>TYPE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2020-12-23T09:39:51Z</td>\n",
       "      <td>068eef5f-34ae-7fc9-6c6c-a5af808089dc</td>\n",
       "      <td>6bcbdd0b-7a02-384d-80ac-c520fb3ab179</td>\n",
       "      <td>vital-signs</td>\n",
       "      <td>8302-2</td>\n",
       "      <td>Body Height</td>\n",
       "      <td>170.1</td>\n",
       "      <td>cm</td>\n",
       "      <td>numeric</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020-12-23T09:39:51Z</td>\n",
       "      <td>068eef5f-34ae-7fc9-6c6c-a5af808089dc</td>\n",
       "      <td>6bcbdd0b-7a02-384d-80ac-c520fb3ab179</td>\n",
       "      <td>vital-signs</td>\n",
       "      <td>72514-3</td>\n",
       "      <td>Pain severity - 0-10 verbal numeric rating [Sc...</td>\n",
       "      <td>3.0</td>\n",
       "      <td>{score}</td>\n",
       "      <td>numeric</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2021-05-25T23:58:21Z</td>\n",
       "      <td>0e11fbdf-a5f4-75fd-241c-039c9d4eedb2</td>\n",
       "      <td>240bad83-5e31-bb5e-f6d9-9b0d0542d9fa</td>\n",
       "      <td>vital-signs</td>\n",
       "      <td>8302-2</td>\n",
       "      <td>Body Height</td>\n",
       "      <td>153.2</td>\n",
       "      <td>cm</td>\n",
       "      <td>numeric</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2021-05-25T23:58:21Z</td>\n",
       "      <td>0e11fbdf-a5f4-75fd-241c-039c9d4eedb2</td>\n",
       "      <td>240bad83-5e31-bb5e-f6d9-9b0d0542d9fa</td>\n",
       "      <td>vital-signs</td>\n",
       "      <td>72514-3</td>\n",
       "      <td>Pain severity - 0-10 verbal numeric rating [Sc...</td>\n",
       "      <td>3.0</td>\n",
       "      <td>{score}</td>\n",
       "      <td>numeric</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2021-05-25T23:58:21Z</td>\n",
       "      <td>0e11fbdf-a5f4-75fd-241c-039c9d4eedb2</td>\n",
       "      <td>240bad83-5e31-bb5e-f6d9-9b0d0542d9fa</td>\n",
       "      <td>vital-signs</td>\n",
       "      <td>29463-7</td>\n",
       "      <td>Body Weight</td>\n",
       "      <td>42.5</td>\n",
       "      <td>kg</td>\n",
       "      <td>numeric</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   DATE                               PATIENT  \\\n",
       "0  2020-12-23T09:39:51Z  068eef5f-34ae-7fc9-6c6c-a5af808089dc   \n",
       "1  2020-12-23T09:39:51Z  068eef5f-34ae-7fc9-6c6c-a5af808089dc   \n",
       "2  2021-05-25T23:58:21Z  0e11fbdf-a5f4-75fd-241c-039c9d4eedb2   \n",
       "3  2021-05-25T23:58:21Z  0e11fbdf-a5f4-75fd-241c-039c9d4eedb2   \n",
       "4  2021-05-25T23:58:21Z  0e11fbdf-a5f4-75fd-241c-039c9d4eedb2   \n",
       "\n",
       "                              ENCOUNTER     CATEGORY     CODE  \\\n",
       "0  6bcbdd0b-7a02-384d-80ac-c520fb3ab179  vital-signs   8302-2   \n",
       "1  6bcbdd0b-7a02-384d-80ac-c520fb3ab179  vital-signs  72514-3   \n",
       "2  240bad83-5e31-bb5e-f6d9-9b0d0542d9fa  vital-signs   8302-2   \n",
       "3  240bad83-5e31-bb5e-f6d9-9b0d0542d9fa  vital-signs  72514-3   \n",
       "4  240bad83-5e31-bb5e-f6d9-9b0d0542d9fa  vital-signs  29463-7   \n",
       "\n",
       "                                         DESCRIPTION  VALUE    UNITS     TYPE  \n",
       "0                                        Body Height  170.1       cm  numeric  \n",
       "1  Pain severity - 0-10 verbal numeric rating [Sc...    3.0  {score}  numeric  \n",
       "2                                        Body Height  153.2       cm  numeric  \n",
       "3  Pain severity - 0-10 verbal numeric rating [Sc...    3.0  {score}  numeric  \n",
       "4                                        Body Weight   42.5       kg  numeric  "
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "2fdae325-04d7-4edc-b114-db9663452cb0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 3527 entries, 0 to 20711\n",
      "Data columns (total 9 columns):\n",
      " #   Column       Non-Null Count  Dtype \n",
      "---  ------       --------------  ----- \n",
      " 0   DATE         3527 non-null   object\n",
      " 1   PATIENT      3527 non-null   object\n",
      " 2   ENCOUNTER    3527 non-null   object\n",
      " 3   CATEGORY     3527 non-null   object\n",
      " 4   CODE         3527 non-null   object\n",
      " 5   DESCRIPTION  3527 non-null   object\n",
      " 6   VALUE        3527 non-null   object\n",
      " 7   UNITS        3527 non-null   object\n",
      " 8   TYPE         3527 non-null   object\n",
      "dtypes: object(9)\n",
      "memory usage: 275.5+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "357470c4-15e6-4d60-8584-1435ffea4924",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['Body Height',\n",
       "       'Pain severity - 0-10 verbal numeric rating [Score] - Reported',\n",
       "       'Body Weight', 'Body Mass Index',\n",
       "       'Body mass index (BMI) [Percentile] Per age and gender',\n",
       "       'Diastolic Blood Pressure', 'Systolic Blood Pressure',\n",
       "       'Heart rate', 'Respiratory rate', 'Body temperature',\n",
       "       'Oxygen saturation in Arterial blood',\n",
       "       'Weight-for-length Per age and sex',\n",
       "       'Head Occipital-frontal circumference Percentile',\n",
       "       'Head Occipital-frontal circumference', 'Body Temperature',\n",
       "       'Oxygen Saturation', 'Mean blood pressure',\n",
       "       'Natriuretic peptide.B prohormone N-Terminal [Mass/volume] in Blood by Immunoassay'],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"DESCRIPTION\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d4b6b3ef-7e94-4fee-90ab-b9fb4c701545",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "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.10.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}