OHDSI Home | Forums | Wiki | Github

Duplicate row in CDMv5 DRUG_STRENGTH.csv

While applying the constraints to the drug_strength

ALTER TABLE drug_strength ADD CONSTRAINT xpk_drug_strength PRIMARY KEY (drug_concept_id, ingredient_concept_id);

[Error] Script lines: 17-18 ------------------------
ERROR: could not create unique index “xpk_drug_strength”
Detail: Key (drug_concept_id, ingredient_concept_id)=(529373, 529411) is duplicated.
Line: 1

wstephens:Vocabulary5.0-20141013$ cat DRUG_STRENGTH.csv | grep 529373,529411
529373,529411,10.048,8576,8587,19700101,20991231,
529373,529411,10.048,8510,8587,19700101,20991231,

Bill

Bill:

Yes, you caught that one right. We need to remove the constraint. The reason is the duplicate records, which are legit. See in the documentation under http://ohdsi.org/web/wiki/doku.php?id=documentation:cdm:drug_strength the penultimate bullet point in the Convention sections. We cannot get combination drug/ingredient completely unique. We also cannot add the unit, because it can be blank, and then the constraint barfes.

So, we need to remove it. Which is fine, we will check this particular constraint in the QA.

C

t