The purpose of this data exploration is an answer a simple question: Where do cardiac arrests occur in Seattle, WA? This type of analysis can be useful for staging ambulances, positioning AEDs, and targeting community enagagement.
The purpose of this project is to faciliate mapping and geospatial analysis of open source Seattle Fire Realtime 911 data, with a particular focus on out of hospital cardiac arrest (OHCA).
Out of Hospital Cardiac Arrest is a life threatening emergency. Prompt initation of high quality CPR, early defibrilation, and advanced life support and transport to a suitable medical center can dramatically improve outcomes. Because of the time sensitive nature of cardiac arrest resuscitation, geospatial analysis of where cardiac arrests occur is potentially useful. Thus, identifying 'hotspots' for OHCA can conceivable be used in several different ways:
- it can be used to determine where to place AEDs
- it can be used to determine staging locations for ambulances
- You can see the realtime feed of 911 dispatches which is a fairly unique level of transparency provided by the City of Seattle. In another repository, I show you we can use this near-realtime feed to predict ED visits.
- I pull data from the Seattle Fire 911 API provided by the Seattle Open Data Program.
- I use the incident type
"Medical Response, 7 per rule"
to identify high acuity medical emergencies, of which OHCA is one particular subtype. This is not quite perfect (it also includes medical emergencies like 'person not breathing' but it's a good first pass approximation.
- Next I loaded the flat file (.csv) into powerBI and used ArcGIS esri to explore the data. Unfortunately, there are so many events it can be hard to identify patterns, even if we create an automated time slicer:
- We can use alternative visualization tools, such as MapBox to build simple heatmaps. This starts to show us some more subtle patterns in the data.
- But what if we want more nuanced control of the visualization? For this it helps to use the GoogleMaps API directly.
- I export the GPS coordinates of these events and load them into the Google Maps Javascript API where I display the events as a heatmap.
- The Google maps API makes it easy to zoom and translate on the map. You can adjust the color scheme, and the heatmap gradient, and other parameters
var map, heatmap;\
// load map centered on Seattle, default is roadmap\
function initMap() \{\
map = new google.maps.Map(document.getElementById('map'), \{\
zoom: 11,\
center: \{lat: 47.63, lng: -122.35\},\
mapTypeId: 'roadmap'\
\});\
\
// ideally would like to have multiple different heatmaps, for now just one\
heatmap = new google.maps.visualization.HeatmapLayer(\{\
data: getPoints(),\
map: map\
\});\
\}\
\
// default = red/green, alternative = red/blue\
function toggleHeatmap() \{\
heatmap.setMap(heatmap.getMap() ? null : map);\
\}\
function changeRadius() \{\
heatmap.set('radius', heatmap.get('radius') ? null : 19);\
\}\
\
function changeOpacity() \{\
heatmap.set('opacity', heatmap.get('opacity') ? null : 0.2);\
\}\
- This is a much more efficient way to specify some of the parameters for visualization. We can also make it more user friendly and interactive.
- The final live map of OHCA in Seattle can be found here:
- https://jsfiddle.net/user/nickmmark/fiddles/
<script async src="//jsfiddle.net/nickmmark/j6k2vhg0/embed/"></script>
- Additional examples: live and interactive heatmap showing the locations of cardiac arrests in Seattle, WA
- Seattle Fire 911 Calls multi-year database updated every 5 minutes; available as an API or as a .csv for download
- Seattle Fire Realtime 911 calls a near realtime feed of 911 dispatch information
- Demographic Statistics by ZIP Code available as a .csv, .json, .rdf, or .xml file.
v1.0 by Nick Mark, 7/16/2017
- need to load census data for population density to normalize
- would also be helpful to explore by ZIP and aggregate
- Public911 Seattle
- Raun LH et al, Geospatial analysis for targeting out-of-hospital cardiac arrest intervention, Am J Prev Med. 2013
- Similar work in other geographic regions:
- Houston, Texas: Raun LH et al, Geospatial analysis for targeting out-of-hospital cardiac arrest intervention, Am J Prev Med. 2013 Aug;45(2)
- Mesa, Arizona: Somers S, Spatial Cluster Analysis of Out-of-Hospital Cardiac arrest in Mesa Arizona
- Singapore: Tan M et al, Geospatial Analysis of Out-of-hospital Cardiac Arrest (OHCA) in Singapore, Irish Journal of Medical Science 2015 184:560-561
- Taiwan: Chen CC et al, Spatial Variation and Resuscitation Process Affecting Survival after Out-of-Hospital Cardiac Arrests (OHCA), PLoS One 2015
- Netherlands: Balistreri G, Spatial Analysis of Out-of-Hospital Cardiac Arrest Incidences in the Netherlands, 2017