OHDSI / CommonDataModel

Definition and DDLs for the OMOP Common Data Model (CDM)
https://ohdsi.github.io/CommonDataModel
877 stars 448 forks source link

Not null vocabulary_version column conflicts with data in CSVs downloaded from Athena #149

Closed pavgra closed 3 years ago

pavgra commented 6 years ago

@clairblacketer,

CDM v5.3 changed "vocabulary_version" column (table "vocabulary") to be NOT NULL. But after this change I cannot load vocabularies downloaded from Athena into my database, because following vocabs have nulls in the column:

ABMS
Cohort
Cohort Type
Concept Class
Condition Type
Cost Type
Death Type
Device Type
Domain
Drug Type
Ethnicity
Gender
MMI
Meas Type
Note Type
OXMIS
Obs Period Type
Observation Type
PCORNet
Procedure Type
Relationship
Specialty
Specimen Type
Visit
Visit Type
Vocabulary
clairblacketer commented 6 years ago

@pavgra I will address this in the next bugfix release.

Thanks!

dimshitc commented 6 years ago

https://github.com/OHDSI/CommonDataModel/blob/master/PostgreSQL/OMOP%20CDM%20postgresql%20ddl.txt#L65 https://github.com/OHDSI/CommonDataModel/blob/master/Oracle/OMOP%20CDM%20oracle%20ddl.txt#L65 hm, still "not null" here

clairblacketer commented 6 years ago

thanks @dimshitc for catching this. I'll be sure to fix this in cdm v6.0

clairblacketer commented 3 years ago

Labelled as Documentation for the 2021 CDM Hackathon.

Final Decision

The csv files for v5.3, v5.4, and v6.0 need to be checked and updated to make sure the VOCABULARY_VERSION field in the VOCABULARY table is set to nullable.

NACHC-CAD commented 3 years ago

@aandryc: We can take this one (@NACHC-CAD, John Gresh)

NACHC-CAD commented 3 years ago

It looks like there is a column "isRequired". I'm assuming this is the indicator for nullable? Also, vocabulary_version is set to "No" for isRequired in all three files.

VOCABULARY_VERSION is already set to "No" for is required. Is there a different way to set "nullable"?

VOCABULARY_REFERENCE is set to "Yes" for isRequired. Based on the tickets mentioning this issue above I'm thinking the task here is to change "isRequired" to "No" for the VOCABULARY_REFERENCE column.

clairblacketer commented 3 years ago

@NACHC-CAD in this case this is an old issue that persisted because of the prior way of versioning the CDM. It has since been fixed on the v5.4 branch but the fix never made it's way to master. The column VOCABULARY_REFERENCE needs to remain as required (NOT NULL in the isRequired field) so it looks like you can close this one :)