Loris icon indicating copy to clipboard operation
Loris copied to clipboard

Add script which converts a REDCap data dictionary to LINST format

Open driusan opened this issue 3 years ago • 7 comments

This adds a new tools/ script, redcap2linst, which takes a REDCap data dictionary CSV and outputs a LINST file for each instrument in it. It does not (currently) deal with rules or scoring, only builds the LINST files. It also doesn't deal with inserting into the Test_names or creating the .meta files, as that's currently done by the instrument_manager when the LINST file is uploaded to LORIS.

I was only able to implement the types in the data dictionary that I was given for HBCD, so it's possible there are some data types that are missing which need to be implemented (in which case the script will currently throw an exception.)

driusan avatar Oct 06 '22 15:10 driusan

to add date validation, look at column 'Text Validation Type OR Show Slider Number' (8th col) which can have values such as 'date_ymd'. The 9th and 10th columns, 'Text Validation Min' and 'Text Validation Max' respectively, can also have further validation info

zaliqarosli avatar Mar 07 '23 17:03 zaliqarosli

this needs to add {-@-}testname{@}<test_name> to each linst files

xlecours avatar Sep 25 '23 17:09 xlecours

Why? The only reference I see to testname in NDB_BVL_Instrument_LINST comes from the meta file, not the LINST file.

driusan avatar Sep 26 '23 12:09 driusan

(also I don't think the test name is in the redcap data dictionary)

driusan avatar Sep 26 '23 12:09 driusan

Why? The only reference I see to testname in NDB_BVL_Instrument_LINST comes from the meta file, not the LINST file.

The issue is with tools/exporters/data_dictionary_builder.php which loops through ip_output looking for testname

xlecours avatar Sep 26 '23 13:09 xlecours

@xlecours this is fixed somewhat by https://github.com/aces/Loris/pull/8434 @driusan that PR is assigned to you to sign off because the solution is a bit of a quick fix that @ridz1208 and I thought up. if it's all good with you, then we won't need to add {-@-}testname{@}<test_name> as xavier suggested

zaliqarosli avatar Nov 03 '23 21:11 zaliqarosli

@driusan this PR is failing tests, probably just needs a rebasing. do you have some time to take a look at the unresolved comments before I leave?

zaliqarosli avatar Jan 08 '24 20:01 zaliqarosli