OHDSI / ETL-CMS

Workproducts to ETL CMS datasets into OMOP Common Data Model
Apache License 2.0
96 stars 53 forks source link

Column mismatch in create_CDMv5_tables.sql and load_CDMv5_vocabulary.sql #42

Closed vickysam closed 5 months ago

vickysam commented 7 years ago

File : https://github.com/OHDSI/ETL-CMS/blob/master/SQL/create_CDMv5_tables.sql CREATE TABLE IF NOT EXISTS synpuf5.drug_strength ( drug_concept_id INTEGER NOT NULL, ingredient_concept_id INTEGER NOT NULL, amount_value NUMERIC NULL, amount_unit_concept_id INTEGER NULL, numerator_value NUMERIC NULL, numerator_unit_concept_id INTEGER NULL, denominator_value NUMERIC NULL, denominator_unit_concept_id INTEGER NULL, valid_start_date DATE NOT NULL, valid_end_date DATE NOT NULL, invalid_reason VARCHAR(1) NULL ) ; File : https://github.com/OHDSI/ETL-CMS/blob/master/SQL/load_CDMv5_vocabulary.sql The CSV we get from http://www.ohdsi.org/web/athena/ contains additional column as 'BOX_SIZE' in drug_strength.csv

vickysam commented 7 years ago

Should i take a pull request ? Here is the Fix. File : https://github.com/OHDSI/ETL-CMS/blob/master/SQL/create_CDMv5_tables.sql

Old code


CREATE TABLE IF NOT EXISTS synpuf5.drug_strength (
drug_concept_id               INTEGER     NOT NULL,
ingredient_concept_id         INTEGER     NOT NULL,
amount_value                  NUMERIC     NULL,
amount_unit_concept_id        INTEGER     NULL,
numerator_value               NUMERIC     NULL,
numerator_unit_concept_id     INTEGER     NULL,
denominator_value             NUMERIC     NULL,
denominator_unit_concept_id   INTEGER     NULL,
valid_start_date              DATE        NOT NULL,
valid_end_date                DATE        NOT NULL,
invalid_reason                VARCHAR(1)  NULL
)
;
>New Code

CREATE TABLE IF NOT EXISTS synpuf5.drug_strength ( drug_concept_id INTEGER NOT NULL, ingredient_concept_id INTEGER NOT NULL, amount_value NUMERIC NULL, amount_unit_concept_id INTEGER NULL, numerator_value NUMERIC NULL, numerator_unit_concept_id INTEGER NULL, denominator_value NUMERIC NULL, denominator_unit_concept_id INTEGER NULL, box_size NUMERIC NULL, valid_start_date DATE NOT NULL, valid_end_date DATE NOT NULL, invalid_reason VARCHAR(1) NULL ) ;