streamlining and simplifying data flow of health presen..pdf•folium –open source python package...

57
Streamlining and Simplifying Data Flow from your desktop Chris Waldron Robert Gottlieb Garry Raynor October 30, 2018

Upload: duongkien

Post on 19-Mar-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Streamlining and Simplifying Data Flowfrom your desktop

Chris WaldronRobert GottliebGarry Raynor

October 30, 2018

Page 2: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Collecting Data

Moving Data

Analyzing Data

Distributing Data

Why spend time pushing data from place to place...

when we can automate and speed up these processes?

Streamlining and Simplifying Data Flowfrom your desktop

Page 3: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Our Examples Your New Ideas

EZ Editor

For Non-

GIS Staff

Hepatitis A

Outbreak

Dashboard

Resources,

Scraping, &

Stats

Emergency

Department

Analysis

Collect Data Distribute Data Move, Etc DataAnalyze Data

Page 4: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Chris WaldronGIS Coordinator

Robert GottliebGIS Analyst

Garry RaynorGIS Analyst

Overview of GIS at ISDH: Public Health Geographics

Program Areas and Workforce

GIS Desktop and Web Users

Page 5: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

72%

Overview of GIS at ISDH: Public Health Geographics

Page 6: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Overview of GIS at ISDH: Public Health Geographics

Page 7: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Current Tools and Skills

ArcGIS Products, Spatial Concepts and Analysis Methods, Statistics,

Database design (Oracle), SQL, Python, Javascript, JSON, HTML, UX,

.NET, VBA and Office, Cartographic Concepts and Design, Census,

Population Health and Epi Basics, Tableau and other BI, GIS Support…

Future Skills Required

Office 365 and AI

Overview of GIS at ISDH: Public Health Geographics

Page 8: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

The Best Tool is Always Changing

Automating and Streamlining will be different by the 2019 GIS Day...

AML VB6

MapObjectsAvenue ArcObjects

.NET SQL Proc

Model Builder

JavaScript AGOL

Python MSO 365

1990 20202005

Page 9: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local
Page 10: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Current Tools for Problem Solving

Python(ArcPy and ArcGIS API for Py)

JavaScript(Vanilla + Esri JavaScript API)

SQL

ArcGIS OnLine

Page 11: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

Non-technical staff need to update stats and other

information contained in maps and lists on web

pages (without the GIS UX)

Solution:

Streamline with “EZ Editors” via

JavaScript and AGOL

Page 13: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

GIS Editors Landing Page

AGOL

(table)

Page 14: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

EZ Editor

with Form View

EZ Editor

with Mapping

and Multi Data

Types

Page 15: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

EZ Editors – Technical Requirements

AGOL – Hosted Data and Security

Web App – Vanilla Javascript

• Hosted Feature Layer (a table of data with or without spatial)

• State Credentials and AGOL Roles

• App Registration (where the app is just a .html file)

• Esri API 3.x

• esri/layers/FeatureLayer

• esri/dijit/FeatureTable

Page 16: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

We need to quickly pull data from spreadsheets

into dashboards, maps, and emails for Hepatitis A

Outbreak situational awareness.

Solution:

Python and AGOL Operations Dashboard

Page 17: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

hepAfacts.isdh.in.gov

Page 18: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Hepatitis A Outbreak

0

100

200

300

400

500

600

Indiana Hep A Cases

2017 2018

Page 19: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Hepatitis A Outbreak Dashboard

https://www.in.gov/isdh/27791.htm

Page 20: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

ArcGIS Operations Dashboard*

Operations Dashboards and Survey 123 are the most

versatile and user-friendly tools you are not using

Table

(AGOL Hosted Feature Layer)

*Tableau nor Power BI required

Page 21: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Hepatitis A County Stats Workflow

Friday

Script

at 11am

Epi

Excel

(xls sheet .csv)

Daily From Program Area

Friday From Program Area

Analyst

Cases

Immunizations

Excel

(oracle .xls)

ArcPy Mod

Daily

Script

at 6pm

Map for Daily

Report

Email Status

ArcGIS Mod

XLRD Mod

Check Data

Structure

Email Errors

Update AGOL

Table: Cases,

Hospitalizations,

Deaths,

Immunizations

fields

Email xls

Network Folder

Network Folder

Page 22: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Update AGOL Table(Case, Hosp, Imz Columns)

Friday

Script

at 11am

Hep A Webpage Dashboard Hep A in Stats Explorer

Any app connected to tables (REST endpoint)

reflects changes made by script

Tableau, GIS, Excel, etc

Page 23: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Windows Task Scheduler

Page 24: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

We need to conduct daily spatial analysis of

ED data and distribute results

Solution:

Python

Page 25: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Syndromic Surveillance

• Indiana hospitals send emergency department visit

records to Public Health Electronic Surveillance System

(PHESS)

• PHESS data fed into ESSENCE – Electronic Surveillance

System for the Early Notification of Community-Based

Epidemics

• ISDH epidemiologists use queries for various conditions

• ESSENCE identifies statistically significant alerts for a

county or hospital

• Epidemiologists review and send alerts to local health

departments

Page 26: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

PHESS Data Flow

Emergency Department

Reports

Emergency Department

Reports

Emergency Department

Reports

PHESS

SQLESSENCE

ISDH Epis

!

Review and

Send To LHDs

and Hospitals

Enhanced Surveillance

Density

Page 27: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Sample ESSENCE Query Results

Page 28: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Enhancing Syndromic Surveillance

• Can we identify areas of increased activity at the

neighborhood level?

• Can we look at trends for different time periods?

• Can we automate this process?

Page 29: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Calculating Neighborhood Density

• Python script runs each morning – Windows Task

Scheduler

• Run SQL query to get emergency department records

• Deduplicate and geocode

• Geocoding is automated. Won’t be able to review every

address (about 92% geocoded to point or street segment)

• Calculate count, rate, and difference in hexagonal grids

• Calculate kernel density and difference

• Flexible time periods and spatial scales

Page 30: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

PHESS

SQL

Clean Query Result (CSV)

Geocode

Calculate

Rate

Hexagonal

Grid

Calculate

Kernel

Density

Create

ArcPro Map

Create

HTML Maps

Email Epis

For Review

Page 31: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Neighborhood Density

• Kernel density converts points into a

'cloud' representing a concentration of points

• Easier visualization of points

• Allows us to look at neighborhoods while protecting

privacy

• Represent concentrations of points without worrying

about borders

Page 32: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Creating Maps

• ArcPro project created

• Output GEOJSON files

• Folium – open source Python package

• Can clip data to restrict map to single county for

private distribution to local health department

Page 33: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Folium

• Open source Python package (version 0.6)

• Can work with JSON files, geopandas

• Creates maps in HTML file

• Some features more convenient than others

• Other mapping options – Leaflet (Javascript), Pysal,

Shapely, Cartopy, Geopy

Page 34: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Summarized Map Data in Self-Contained

HTML File

Example

Page 35: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

We need to query multiple data sources and update

our health resources in our Oracle database, the

GIO Library, and ArcGIS On-Line

Solution:

Python to glue ETL

Page 36: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Health Resource DataOver 150 layers of health resources (e.g. hospitals, clinics, etc)

https://data-isdh.opendata.arcgis.com/https://gis.in.gov/apps/isdh/meta/resources_layers.htm

Resource Explorer AGOL Open Data

Page 37: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Over 150 layers of health resources (e.g. hospitals, clinics, etc)

ArcGIS OnLine Organization Desktop GIS

Health Resource Data

Page 38: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local
Page 39: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

No time to keep contact information updated

for the map on our website.

Solution:

Web Scrape with Python

Page 40: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Connect to hosted

feature layer.

Query hosted

feature layer to

return all results.

Parse returned

results.

1.Pass department name and url to loop.

2. Use urllibto test url.

3. Determine if url is valid or invalid.

4. If invalid, determine reason if possible.

5. Append department name and reason to

list.

If valid, move on to step 1

with the next department.

while loop

Determine if any

invalid urls are

present in list.

Determine email

message.

Send email and exit.

Testing URL Validity for Local Health Departments

ISDH Web Map

Web Editor

Page 41: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

Stats are scattered all over the ISDH website

which make finding health stats difficult

Solution:

Streamline Stats Discovery for End-

Users with ArcGIS and JavaScript

Page 42: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Stats ExplorerA new path to Indiana Health Datagis.in.gov/apps/isdh/StatsExplorer

Easy Access!

One Stop!

Chart!

Map!

Download!

Embed!

Interactive!

gis.in.gov/apps/isdh/statsexplorer

in.gov/isdh/26720.htm

Page 43: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Simple User Experience

Systematic Organization of Data

Dynamic/Interactive

Open Data

Single Data Destination

Design Goals(2016)

Minimal Additional Funds

Use Existing/Published Data

Page 44: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Data(Record-Level) Data Analysis

Stats/Reports(Aggregated)

Flow of Analyzed Data

Page 45: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

ISDH Public Stats/Reports Commonality

Geography (County, Facility)

Temporal (Annual)

Statistic (Rate, Count)

Stratifications (Age, Sex, Race)

Page 46: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

VAR_IDGEOG_IDGEOG_NAMEGEOG_TYPEDATE_STARTDATE_ENDPERIODDATE_NAMEVAR_STATVAR_COUNTVAR_DENOMVAR_UNSTABLEVAR_LCIVAR_UCIVAR_CIVAR_SIGVAL_NATVAR_SIG_NATVAR_SIGVAL_STATEVAR_SIG_STATEVAR_SIGVAL_DISVAR_SIG_DISVAR_SIGVAL_CNTYVAR_SIG_CNTYROW_IDVAR_RACEVAR_SEX

Currently 200+ variables and 500,000+ data pointsfor one or more time periods (single years, range)

some stratified by sex, race

Most Public Data Are Shared via Excel…but all different styling/formatting

Easy Transformation to a Standard

Table

Page 47: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

VAR_IDGEOG_IDGEOG_NAMEGEOG_TYPEDATE_STARTDATE_ENDPERIODDATE_NAMEVAR_STATVAR_COUNTVAR_DENOMVAR_UNSTABLE

ArcGISPlatform

Web API’s

Current Data Analysisand Reporting Process

Existing InfrastructureAnd Existing Skillsets

Extending Current Processes

Page 48: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

GIS Database

Why GIS?

GIS App Server GIS Web Server

Oracle

ID Info Info Geo

1 Data Data 39.22..

2 Data Data 41.32..

3 Data Data 37.91..

(Table)

Data Source

Query

Data ServiceConnect

ServeScripts/HTML

(Config File)

…leverage existing infrastructure

(Web Files)

Page 49: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

= Stats Explorer Web Pagegis.in.gov/apps/isdh/statsexplorer

Page 50: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

…with Transportable/Embeddable Visuals

http://www.in.gov/isdh/27358.htm

Page 51: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

...with an Open Data Service

https://gis.in.gov/arcgis/rest/services/ISDH/IndianaHealthStats/FeatureServer/0/query

Page 52: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Open Data = Data Everywhereone single source

Data streamed fromStats Explorer to amap on a webpage

http://www.in.gov/isdh/27358.htm

Page 53: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Open Data = Data Everywhereone single source

Data streamed fromStats Explorer to anExcel Spreadsheet

Page 54: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Open Data = Data Everywhereone single source

Data streamed fromStats Explorer to your

own dashboard

https://arcg.is/1TnTua

Page 55: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Problem:

How do I get started scripting?

Solution:

Python comes installed with ArcGIS

Visual Studio Code is good for JavaScript

Page 56: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

https://www.esri.com/training/

Page 57: Streamlining and Simplifying Data Flow of Health Presen..pdf•Folium –open source Python package •Can clip data to restrict map to single county for private distribution to local

Acknowledgements

• Kayley Dotson, Amanda Billman, Nicole Stone,

Shawn Richards, Charles Clark

Public Health Geographics

• Chris at [email protected]

• Robert at [email protected]

• Garry at [email protected]