diff --git a/UseCases/CostOfCare_Healthcare/CostOfCare_Healthcare.ipynb b/UseCases/CostOfCare_Healthcare/CostOfCare_Healthcare.ipynb new file mode 100644 index 00000000..634874d8 --- /dev/null +++ b/UseCases/CostOfCare_Healthcare/CostOfCare_Healthcare.ipynb @@ -0,0 +1,364 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "59134b4c-1ed7-4552-ac6a-5293da3f4367", + "metadata": {}, + "source": [ + "
\n", + "

\n", + " Cost Of Care Analytics Demo\n", + "
\n", + " \"Teradata\"\n", + "

\n", + "
" + ] + }, + { + "cell_type": "markdown", + "id": "bad1bb80-35d4-4787-a1ae-76d9c161d9bf", + "metadata": {}, + "source": [ + "

Introduction:

\n", + "

With rising healthcare expenditures, there's a growing urgency to track, analyze, and optimize cost drivers across emergency room (ER), imaging, surgical, and mental health services. Traditional cost auditing methods are retrospective, siloed, and lack the granularity to enable proactive cost containment. By leveraging advanced analytics and integrated hospital datasets, a scalable, dynamic, and contextual cost intelligence solution can be achieved. However, key challenges remain: \n", + "

\n", + "\n", + "

Proposed Solution:

\n", + "

The proposed solution leverages Teradata Vantage as an intelligent analytics platform to consolidate, process, and visualize healthcare cost data across clinical domains. Structured datasets from emergency room (ER) visits, imaging studies, surgical procedures, and mental health conditions were ingested into the Vantage environment

\n", + "\n", + "\n", + "\n", + "

Using these curated datasets, interactive dashboards were developed in Superset to provide a unified “Cost of Care” view that enables value-based decision-making:\n", + "

\n", + "

Benefits:

\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "059e24ad-9108-48f7-88c4-b577153593a9", + "metadata": {}, + "source": [ + "
\n", + "

1. Connect to Vantage, Import python packages and explore the dataset

" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "89b8c63c-94d8-4b6e-b29b-f0208beb8d23", + "metadata": {}, + "outputs": [], + "source": [ + "#import libraries\n", + "import getpass\n", + "from teradataml import *\n", + "\n", + "import warnings\n", + "warnings.filterwarnings('ignore')\n", + "warnings.simplefilter(action='ignore', category=DeprecationWarning)\n", + "warnings.simplefilter(action='ignore', category=RuntimeWarning)\n", + "warnings.simplefilter(action='ignore', category=FutureWarning)\n", + "\n", + "display.max_rows=5" + ] + }, + { + "cell_type": "markdown", + "id": "4f91da96-35e7-4cc2-aa5b-3a3eb71b543d", + "metadata": {}, + "source": [ + "
\n", + " 1.1 Connect to Vantage\n", + "

We will be prompted to provide the password. We will enter the password, press the Enter key, and then use the down arrow to go to the next cell.

" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cb703946-e2ba-446f-aae5-e2a34d699faa", + "metadata": {}, + "outputs": [], + "source": [ + "%run -i ../startup.ipynb\n", + "eng = create_context(host = 'host.docker.internal', username='demo_user', password = password)\n", + "print(eng)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ef79de0d-ce15-4d28-a642-5eda67c7c56e", + "metadata": {}, + "outputs": [], + "source": [ + "%%capture\n", + "execute_sql('''SET query_band='DEMO=FF_CostOfCare_Healthcare.ipynb;' UPDATE FOR SESSION; ''')" + ] + }, + { + "cell_type": "markdown", + "id": "2aea1cce-2002-4169-8e48-39a04c77eb90", + "metadata": {}, + "source": [ + "

Getting Data for This Demo

\n", + "

We have provided data for this demo on cloud storage. We have the option of either running the demo using foreign tables to access the data without using any storage on our environment or downloading the data to local storage, which may yield somewhat faster execution. However, we need to consider available storage. There are two statements in the following cell, and one is commented out. We may switch which mode we choose by changing the comment string.

" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79059da9-5a68-4860-8c55-b530d85f67fd", + "metadata": {}, + "outputs": [], + "source": [ + "%run -i ../run_procedure.py \"call get_data('DEMO_HealthcareCOC_cloud');\"\n", + "# takes about 3 minutes\n", + "#%run -i ../run_procedure.py \"call get_data('DEMO_HealthcareCOC_local');\" \n", + "# takes about 15minutes" + ] + }, + { + "cell_type": "markdown", + "id": "73b03eb2-acc3-4289-8a1c-98aeca10d2d6", + "metadata": {}, + "source": [ + "

Optional step – We should execute the below step only if we want to see the status of databases/tables created and space used.

" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "09848365-4c41-4c9d-8db4-a57249bf6dd8", + "metadata": {}, + "outputs": [], + "source": [ + "%run -i ../run_procedure.py \"call space_report();\"" + ] + }, + { + "cell_type": "markdown", + "id": "6940e9db-d80c-4cae-841b-98dd565c9038", + "metadata": {}, + "source": [ + "
\n", + "

2. Data Exploration

" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "501b0984-378e-41b5-915a-f9beb8e327f2", + "metadata": {}, + "outputs": [], + "source": [ + "db_list_tables('DEMO_HealthcareCOC')" + ] + }, + { + "cell_type": "markdown", + "id": "39f95466-1c7f-45d7-8533-ff2028bfc40f", + "metadata": {}, + "source": [ + "

Data Sources and Schema Overview:

\n", + "