RADar-AZDelta / Rabbit-in-a-Blender

An ETL pipeline to transform your EMP data to OMOP.
https://radar-azdelta.github.io/Rabbit-in-a-Blender/
GNU General Public License v3.0
11 stars 3 forks source link

Add check for duplicate custom concepts #45

Closed pjlammertyn closed 5 months ago

pjlammertyn commented 5 months ago

example query for check:

select T.concept_code, count(*)
from (
    SELECT DISTINCT swap.y as concept_id, t.* EXCEPT(concept_id)
    FROM `work.observation__observation_concept_id_concept` t
    INNER JOIN `work.concept_id_swap` swap 
        on swap.x = concat('observation_concept_id__', t.concept_code)
) T
group by T.concept_code
having count(*) > 1
pjlammertyn commented 5 months ago

solved in commit https://github.com/RADar-AZDelta/Rabbit-in-a-Blender/commit/b81f8cf172d1f9361c68f0fdf227f7a8f3d00f1c