OHDSI Home | Forums | Wiki | Github

UCUM Maps to Relationship Missing Values

There are UCUM concepts that do not map to themselves. Shows up in V4.5 source to concept map to UCUM. The value uL/g is a valid UCUM unit, but is not in the source_to_concept_map table. There are 58 other similar entries.

Points out a need to maintain the source to concept map table so that you can map various source ‘unit’ values to UCUM.

Query to identify missing Maps to for UCUM units

SELECT *
FROM
(
SELECT concept.concept_code, map.concept_code AS mapped
FROM
(
SELECT concept.concept_code
FROM concept
WHERE vocabulary_id = ‘UCUM’ and domain_id = ‘Unit’ and invalid_reason IS NULL
) concept
LEFT OUTER JOIN
( SELECT source.concept_code
FROM concept source
JOIN concept_relationship ON concept_id_1 = source.concept_id
JOIN concept target on target.concept_id = concept_id_2
WHERE source.vocabulary_id = ‘UCUM’ AND source.domain_id = ‘Unit’ and source.invalid_reason IS NULL
AND target.vocabulary_id = ‘UCUM’ and target.domain_id = ‘Unit’ and target.invalid_reason IS NULL
) map ON map.concept_code = concept.concept_code
) where mapped IS NULL

@DTorok:

Got it. Will put in.

On the other hand: Ucum is never a source, at least I haven’t heard of it. Instead, everybody has their own c***y input units, as ugly as “mcgs” for micrograms. There is no way those mappings can be maintained centrally.

t