Emergency Room Data Using SQL
The ER is always a hot topic because of how busy it gets and not enough staff to serve incoming patients in a timely manner. With the data we have, we will look at emergency room throughout or length of stay. This will help us understand the status of patient access, patient volume and health system support.
How many enocunters occurred in 2019?
|
|
Looking at the total number:
|
|
Identify conditions using the JOIN function
We will look at the conditions table and the encounters table:
|
|
We could add LEFT JOIN to pull all information from encounters column that meet the criteria identified in this WHERE query, if there’s no match, stil return data (could be null data).
|
|
What is the LOS in the ED?
|
|
Note: DATEDIFF is specific to SMSS and it is the same as TIMESTAMPDIFF function for MySQL.
Dataset source: https://synthetichealth.github.io/synthea/
Github repository: https://github.com/ib99