OHDSI / ETL---Korean-NSC

ETL code for converting Korean National Sample Cohort (NSC) derived from national insurance health service into OMOP-CDM v5 developed by Ajou University
Apache License 2.0
10 stars 16 forks source link

visit_occurrence table issue : visit_start_date > visit_end_date #7

Open JaehyeongCho opened 6 years ago

JaehyeongCho commented 6 years ago

select * from nhis_nsc.dbo.visit_occurrence where visit_start_date > visit_end_date image

JaehyeongCho commented 6 years ago

VSCN = 0인 경우의 오류로 생각됨

--- 51252 select count(*) from nhis_nsc.dbo.visit_occurrence where visit_start_date > visit_end_date

-- 9203 inpat + ED : 12953 select count(*) from 20T where form_cd in ('02', '04', '06', '07', '10', '12') and in_pat_cors_type in ('11', '21', '31') and vscn = 0

-- 9201 inpat + inpat : 38298 select count(*) from 20T where form_cd in ('02', '04', '06', '07', '10', '12') and in_pat_cors_type not in ('11', '21', '31') and vscn = 0

-- 9203 outpat + ED : 1 select count(*) from 20T where form_cd in ('03', '05', '08', '09', '11', '13', '20', '21', 'ZZ') and in_pat_cors_type in ('11', '21', '31') and vscn = 0

12,953 + 38,298 + 1 = 51,252