Skip to content

Commit

Permalink
feat (mimic): queries about infarction
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed May 14, 2024
1 parent 5b031bb commit a37a489
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions data/mimic/infarction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SQL sequence to prepare the tables

## ICD codes related to myocardial infarction

~~~sql
select * from d_icd_diagnoses where long_title like '%myocardial infarction%';

create view myocardial_infarction_codes as select * from d_icd_diagnoses where long_title like '%myocardial infarction%';

select * from myocardial_infarction_codes;

select count(*) from diagnoses_icd d, myocardial_infarction_codes m where d.icd_code=m.icd_code;
>> 31.829

select count(*) from diagnoses_icd d where d.icd_code='I219';

create view selected_mi_cases as select * from diagnoses_icd d, myocardial_infarction_codes m where d.icd_code=m.icd_code limit 5;

select * from diagnoses_icd d where d.icd_code='I219';

select * from hcpcsevents where hadm_id = '20242490';

select * from hcpcsevents h, selected_mi_cases s where h.hadm_id = s.hadm_id;
~~~

0 comments on commit a37a489

Please sign in to comment.