Skip to content

concept code uniqueness constraint rule implementation #13

@sshenzha

Description

@sshenzha

In OMOP CDM, when querying concepts by concept_code, this is unique only within a vocabulary, not globally. The same concept_code can exist in multiple vocabularies and refer to completely different things. For example:
Image

-- BAD: returns rows from NDC *and* SNOMED *and* RxNorm
SELECT concept_id, concept_name, vocabulary_id
FROM base.concept
WHERE concept_code = '7980';
-- Returns 3 rows, 3 different concept_ids
-- GOOD: returns exactly one intended concept
SELECT concept_id, concept_name, vocabulary_id
FROM base.concept
WHERE concept_code = '7980'
  AND vocabulary_id = 'RxNorm';
-- Returns 1 row

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions