Skip to content

Commit

Permalink
workedon OMOPdeath proc, still need to test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjoss committed Mar 28, 2018
1 parent 3a2b591 commit d43550a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions MSSQL/OMOPLoader.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1154,13 +1154,8 @@ go
create procedure OMOPDeath as

begin
insert into death( person_id, death_date, death_date_impute, death_source,death_match_confidence) --need to update these: insert into death(person_id, death_date, death_datetime, death_type_concept_id, cause_concept_id, cause_source_value, cause_source_concept_id)
select distinct pat.patient_num, pat.death_date, case
when vital_status_cd like 'X%' then 'B'
when vital_status_cd like 'M%' then 'D'
when vital_status_cd like 'Y%' then 'N'
else 'OT'
end, 'NI','NI'
insert into death( person_id, death_date, death_type_concept_id)
select distinct pat.patient_num, pat.death_date, '38003569'
from i2b2patient pat
where (pat.death_date is not null or vital_status_cd like 'Z%') and pat.patient_num in (select person_id from person)

Expand Down

0 comments on commit d43550a

Please sign in to comment.