Is there an established best practice when the mapping is dependent on both the source code and value?
For example, we have a source term “Alcohol user?” where the value is either “yes” or “no”. If we ignore the value the best interpretation we can gather is that the question was asked, which isn’t all that useful. However, if the combination of term and value are considered we can map to either:
If this isn’t a solved problem, my initial thought is to add a column to source_to_concept_map for source_value, which is left NULL unless the mapping is value dependent.
Something along the lines of:
....
INNER JOIN
(
SELECT *
FROM source_to_concept_map
WHERE source_vocabulary_id = 'xyz vocab'
) stcm
ON source_table.code = stcm.source_code
AND
(
stcm.source_value IS NULL
OR
source_table.value = stcm.value
)
Yes, those are tabs.
Any feedback on how others have tackled this would be appreciated.