select
m.measurement_concept_id
,m.value_as_number * c.factor as new_value_as_number
,c.target_unit_concept_id as new_unit_concept_id
,m.value_as_number
,m.unit_concept_id
from measurement m
join conv c on
m.measurement_concept_id=c.measurement_concept_id
and m.unit_concept_id=c.unit_concept_id
where m.value_as_number is not null
The CONV table already has the “correct” target unit. I don’t get your yellow part of the query.
It would be great to know that once we re-run ThemisUnits study with latest 2025 data, that we are doing this all for a nice final cherry on top of truly building it into the tool. (or even CDM spec itself (the idea of targeting unit standardization) (for subset of tests). And truly strongly recommending units for a set of top 50 (or any other topN number).
The challenge of expert driven consensus vs. data-driven consensus still remains. Few years ago, I pursued the data-driven consensus since there is no “voting”/“personal preference” involved.
As a survey call to community - please reply if you are currently standardizing units (and converting numberical values) at ETL time for any (or for subset) of lab tests?
v.5.4 has now the missing column we needed back in 2018-2020