OHDSI / CommonDataModel

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

vocabulary_reference not null constraint raises issue with Athena vocabularies #233

Closed tropicalberto closed 3 years ago

tropicalberto commented 6 years ago

Hi all,

one difference between CDMv5 and CDMv6 is that the column vocabulary_reference now has a not null constraint. When I try to load the vocabularies from Athena into the CDM, I get a VOCABULARY: ERROR: null value in column "vocabulary_reference" violates not-null constraint when I try to do it. (the vocabularies include all the default ones, as well as ICD9/ICD10).

This happened with this row from the vocabularies: "Plan Health Plan - contract to administer healthcare transactions by the payer, facilitated by the sponsor 32471"

I manually removed the non-null constraint on that column, and now it works. Is there any specific reason behind this change? I find a bit confusing, as now some conflicts are raised while trying to load supported vocabularies by OMOP (that used to work with CDMv5).

clairblacketer commented 5 years ago

I believe that vocabulary.vocabulary_reference should be optional. @aostropolets or @cgreich can you confirm?

cgreich commented 5 years ago

We could make it optional, or we create a dummy reference "OMOP generated" for the ones where there is no reference. Sounds better to me, really. Or we refer to Athena.

clairblacketer commented 3 years ago

closing this as it is a duplicate of #149