AMP-SCZ / lochness

Download your data to a data lake.
Other
3 stars 1 forks source link

Extract all rows for multi-record forms #106

Open tashrifbillah opened 2 years ago

tashrifbillah commented 2 years ago

Lochness's current design of extracting only latest row for each visit of RPMS forms won't work for multi-record forms. We need to condition this by the existence of Row# column. If Row# is present, extract all rows of each visit.

Take PrescientStudy_Prescient_family_interview_for_genetic_studies_figs_child_01.07.2022.csv for example. We created this record together recently. The subject has two children hence two rows under visit 1. We need to extract both rows.

tashrifbillah commented 2 years ago

This can probably be solved by just adding an or to the if:

if len(table) == 1 or 'Row#' in subject_df.columns:

https://github.com/AMP-SCZ/lochness/blob/b8426efe12ab9bfc99af414011f2372317d129b7/lochness/rpms/__init__.py#L262-L272