Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[media] Instrument not parsed/linked #9703

Open
jeffersoncasimir opened this issue Mar 14, 2025 · 3 comments
Open

[media] Instrument not parsed/linked #9703

jeffersoncasimir opened this issue Mar 14, 2025 · 3 comments
Assignees
Labels
27.0.0 - Bugs Bugs Found in LORIS 27 testing Module: media PR or issue related to media module
Milestone

Comments

@jeffersoncasimir
Copy link
Contributor

jeffersoncasimir commented Mar 14, 2025

Discovered during round 2 of testing.

When uploading a file suffixed with _bmi or _aosi (only two tested), it does not get assigned the corresponding "Instrument" field, or at least, does not appear to on the front-end.

Edit: This is incorrect and parsing/auto-linking was never expected

@jeffersoncasimir jeffersoncasimir added 27.0.0 - Bugs Bugs Found in LORIS 27 testing Module: media PR or issue related to media module labels Mar 14, 2025
@jeffersoncasimir jeffersoncasimir added this to the 27.0.0 milestone Mar 14, 2025
@sruthymathew123
Copy link
Contributor

@jeffersoncasimir @driusan

I took a look at this issue. The media module expects the instrument to be selected in order to properly parse the file and assign it to the corresponding instrument. I think media module supports non instrument related files also to get uploaded.

I checked hbcd/ibis code base with parser instruments; it is always sets the instrument value to properly parse the instrument file.

See below ex:

$query = [
                      'session_id'  => $this->getSessionID(),
                      'instrument'  => $this->table,
		      'date_taken'  => $dateTaken,
		      'comments'    => $otherComments,
                      'file_name'   => $file->getDestinationFilename(),
                      'file_type'   => 'DAS_SA',
                      'data_dir'    => $mediaPath,
		      'uploaded_by' => $user->getData('UserID'),
            ];

            // File alread exists in media module: update
            if (!is_null($mediaID)) {
                $db->update('media', $query, array('ID' => $mediaID));
            // File does not exist in media module: insert new
            } else {
                $db->insert('media', $query);
            }

@jeffersoncasimir
Copy link
Contributor Author

jeffersoncasimir commented Mar 19, 2025

@sruthymathew123 I gave it another look I am going to open a new issue to request a change to the instructions on the Upload tab, to match the TestPlan and reality.

The Upload tab says: File name must begin with [PSCID]_[Visit Label]_[Instrument]

I can confirm that it works as normal when selecting an instrument from the dropdown:

Image

Please close this issue once acknowledged, @driusan

@adamdaudrich
Copy link
Collaborator

related to #9721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
27.0.0 - Bugs Bugs Found in LORIS 27 testing Module: media PR or issue related to media module
Projects
None yet
Development

No branches or pull requests

3 participants