OHDSI / WhiteRabbit

WhiteRabbit is a small application that can be used to analyse the structure and contents of a database as preparation for designing an ETL. It comes with RabbitInAHat, an application for interactive design of an ETL to the OMOP Common Data Model with the help of the the scan report generated by White Rabbit.
http://ohdsi.github.io/WhiteRabbit
Apache License 2.0
174 stars 85 forks source link

Allow multiple mappings from one source to the same target table #275

Open MaximMoinat opened 3 years ago

MaximMoinat commented 3 years ago

In some cases, one source table has several variables that have to be mapped to one target table. Now they all end up in the same table to table mapping, which gives a confusing ETL document. A target table should be duplicated to allow multiple of the same source table to same target table maps.

jnothman commented 2 years ago

I and my colleague @ElevnLi were looking at a case where one source table and record contains many measurements, each in its own field. Specifically there are multiple constituent results of a procedure, in this case a neuropsychological assessment.

In this case, we want the field name to map to measurement_source_value and the value to value_source_value.

Thus what we generate in mapping would be equivalent to first making the table "longer" by duplicating the source row for each field, but adding new columns called "name" and "value" for each of those fields, and then mapping those.

We could perform a pivot_longer operation on our data before performing the White Rabbit scan, but this essentially means that we need to do some of the mapping already.

Have you made progress on developing a UI for this? Perhaps it would be helpful to consider the UI by analogy to the pivot_longer operation.

Thanks for your work on this :)