vocabulary_id updated_concepts replaced_bys
SPL 6 6
ATC 6 0
Domain 11 11
CPT4 92 0
MedDRA 21,036 21,033
UCUM 59 56
DRG 32 0
ETC 5 0
ICD10 266 266
LOINC 2,474 2,474
RxNorm 43,890 43,879
ICD9CM 1,108 1,108
SNOMED 27,336 23,269
HCPCS 113 68
SELECT vocabulary_id, count(*) as Updated_concepts
, SUM( CASE WHEN rel.relationship_id IS NOT NULL then 1 ELSE 0 END ) AS replaced_bys
FROM concept
LEFT OUTER JOIN concept_relationship rel
ON concept_id_1 = concept_id
AND relationship_id = ‘Concept replaced by’
WHERE concept.invalid_reason = ‘U’
GROUP BY vocabulary_id