CLOSER-Cohorts / archivist

Archivist is designed to be an easy to use editor that allows documention of questionnaires and data in DDI-Lifecycle
MIT License
18 stars 8 forks source link

qv mapping - enforce dataset prefix from .txt #848

Closed HayleyMills closed 2 months ago

HayleyMills commented 6 months ago

The qv mapping file for import via Admin > Instruments > import, has four columns. For the instrument, questions, dataset and variable. The dataset prefix usually has to match the dataset which the variables are within. However, I loaded a qv.txt file with the dataset in the .txt as whii_89_hs, when no such dataset exists, however it found the variables.

whii_89_hs.qv_mapping.txt https://closer-archivist.herokuapp.com/admin/instruments/1543/imports/2536

and in the qv.txt to export it has the correct dataset https://closer-archivist.herokuapp.com/admin/instruments/whii_89_hs2/exports

The datasets which are linked and have been mapped are labelled whii_89_hs and Wh2_phase_02_quest and Wh2_phase_02_events

HayleyMills commented 3 months ago

Can we enforce that it uses the dataset prefix from the file, rather than whatever it's linked to. As this will flag potential issues.

simonreed commented 2 months ago

@HayleyMills this is on staging.

HayleyMills commented 2 months ago

@simonreed Tested on staging, and it's working as expected. One minor thing is the error message meant to say the what's in the file? e.g. Wh2_phase_03 instead of (%{dataset)? image

simonreed commented 2 months ago

@HayleyMills this translation error should be fixed on staging now

HayleyMills commented 2 months ago

Tested on staging and error message is correct.