WIP: (re)modularize converter (to_reproschema) #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
based on discussion with @djarecka on 08/23/2024, we want to improve our (some format)2reproschema converter by remodularizing it. in this current converter:
redcap2reproschema
we have SCHEMA_MAP that maps redcap column names to reproschema variables. this time, I reversed the key-value pairs and made aCSV_TO_REPROSCHEMA_MAP
where the keys are reproschema variables but values are input csv column names. in this way, we will always use keys in classes and functions but customize the map with different values (input csv column names)CSV_TO_REPROSCHEMA_MAP
,VALUE_TYPE_MAP
,INPUT_TYPE_MAP
, andADDITIONAL_NOTES_LIST
csv.DictReader
, put the lovelypandas
thereI made this converter based on the LORIS format, which a sort of simplified version of the general REDCap version we used to deal with. They are missing some important information (I'll email them soon). but at the same time we can think about how to make the converter more generalized to handle simple and complex cases.
TODOs (popping up when converting the LORIS format):
maxValue
andminValue
can we use other variables' answer as those values? (this comes from date which should be greater than a certain date but smaller thantoday
)