a2cps / vbr-app

Virtual Biospecimen Repository Web Service API
Other
0 stars 0 forks source link

Parse numeric:text descriptions from Data dictonary #44

Open JoshuaUrrutia opened 1 year ago

JoshuaUrrutia commented 1 year ago

Currently, race/ethnicity numeric:text mappings are hard-coded in the VBR: https://github.com/a2cps/vbr-app/blob/main/application/routers/models/transformers.py#L8

This is undesirable because if new fields get updated in the data dictionary, they will need to be manually added to the VBR code. We'd like to move towards a model based off the data dictionaries to centralize curation of this information, make it easier to update the VBR transformations in the future, and make this code more generalizable.

The rules for the data dictionary mappings are: Select “select_choices_or_calculations” column Filter field_types column for “radio”, “checkbox”, or “dropdown” only Separate fields by the | delimiter, and grab the first comma separated pair for num:text