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

The number of Infant born in 2002 was wrong #6

Open chandryou opened 6 years ago

chandryou commented 6 years ago

The number of Infant born in 2002 was wrong Some babies who actually not born in 2002 was also included to infant group born in 2002.

The age algorithm should be revised.

For now, the DB itself was modified.

SELECT * INTO #temp_person FROM @CDM_DB.PERSON WHERE YEAR_OF_BIRTH =2002 AND PERSON_ID NOT IN (SELECT DISTINCT PERSON_ID FROM @Original_DB.ID02_13_JK WHERE AGE_GROUP =0 AND STND_Y=2002);

UPDATE @CDM_DB.PERSON .PERSON SET YEAR_OF_BIRTH = 2001 WHERE PERSON_ID IN (SELECT PERSON_ID FROM #temp_person);