Created
July 23, 2021 15:34
-
-
Save docsteveharris/5899d85ff7a5e133e654df9d945f9906 to your computer and use it in GitHub Desktop.
Lymphocyte count and outcomes in CCHIC - OMOP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- P of PICO looks like | |
-- Lymphocyte count less than 1.2 within 72 hours of critical care admission + mechanical ventilation. | |
-- O 60-day mortality…. So in hospital mortality would be great | |
-- 1. find lymphocyte counts | |
SELECT | |
* | |
FROM dsf_omop.measurement m | |
WHERE m.measurement_concept_id = 3019198 | |
LIMIT 3; | |
-- 2. find mechanical ventilation | |
-- this is tricky! https://github.com/alan-turing-institute/DECOVID-datamgmt/blob/master/derrived-concepts/ventilation.md | |
SELECT | |
p.procedure_concept_id | |
,COUNT(*) n | |
FROM dsf_omop.procedure_occurrence p | |
GROUP BY p.procedure_concept_id | |
ORDER BY n DESC | |
--LIMIT 100 | |
; | |
--this reveals that 4013354 is the concept code of insertion of an ET tube | |
--so now user this to define patients who are intubated | |
--would expect about 20% of patients in ICU to be intubated at some time | |
-- 3. find critical care admission | |
SELECT * FROM care_site WHERE | |
care_site_id IN (1,2,3) LIMIT 3; | |
-- 4. find 60d mortality | |
SELECT * FROM dsf_omop.death LIMIT 3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment