Skip to content

[dataquery] Add toggle to hide candidates with no data - #11017

Open
HenriRabalais wants to merge 1 commit into
aces:mainfrom
HenriRabalais:2026-07-27_dataquery-hide-empty-candidates
Open

[dataquery] Add toggle to hide candidates with no data#11017
HenriRabalais wants to merge 1 commit into
aces:mainfrom
HenriRabalais:2026-07-27_dataquery-hide-empty-candidates

Conversation

@HenriRabalais

@HenriRabalais HenriRabalais commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Description

The beta DQT queries the candidate table first and then joins the data, so candidates with no data for the selected fields still come back as rows with just their metadata (PSCID and empty columns). The old CouchDB DQT excluded them naturally because the document simply did not exist.

As discussed in #9837, the decision was to keep returning all rows from the API and add a UI toggle to hide the empty ones, so a coordinator doing quality control can still see every participant while a researcher can filter them out without adding filters.

This carries over the work from #10348 by @arnav-makkar, who is no longer working on LORIS. The filtering logic is his, with a reworded label and the translations added.

Changes

  • Added a "Show candidates with no data" toggle on the View Data page. When unchecked, rows that only contain candidate metadata are filtered out.
  • The "Display empty visits?" toggle is now only shown for Inline mode, where it applies. Cross-sectional mode is handled by the candidate filter since each visit is its own row.
  • Renders "No result found" directly when everything is filtered out, which avoids a React reconciliation error when the table goes from populated to empty.
  • Downloaded CSVs follow the same filters as the table.
  • Added the new string to the .pot template and to the French, Hindi, Japanese and Chinese .po files.

Testing Instructions

  1. Go to the Data Query Tool (Beta) and continue to Define Fields.
  2. Select the "Image Acquisitions" category and add the t1_file field.
  3. Run the query. With "Show candidates with no data" checked you should see every candidate, most of them showing "(No data)" for all visits.
  4. Uncheck "Show candidates with no data". Only the candidates that actually have a t1 file should remain, and every visible row should show a real file path.
  5. On RaisinBread this takes the result from 671 candidates down to 24, which matches the database.

Note that a field like ScanDone is not a good test here, since it is computed as EXISTS(files) OR EXISTS(mri_upload) OR EXISTS(tarchive) and returns a real false for any session that exists. It displays as "(No data)" but it is data, so those rows are correctly kept.

Related Issues

Resolves #9837
Replaces #10348

Co-authored-by: arnav-makkar <arnav-makkar@users.noreply.github.com>
@github-actions github-actions Bot added Module: dataquery PR or issue related to (new) dataquery module Multilingual Any tasks related to making LORIS multilingual labels Jul 27, 2026
@HenriRabalais
HenriRabalais requested a review from marandmart July 27, 2026 10:44
@HenriRabalais

Copy link
Copy Markdown
Collaborator Author

Also verified on the instrument path, which is what the original report in #9837 was using.

Query: PSCID + bmi_bmi at V1. Unchecking "Show candidates with no data" takes it from 671 to 327, which matches the database (327 candidates have a non-null bmi at V1). The imaging test above gives 671 to 24 with t1_file, so both query engines behave correctly.

@arnav-makkar

Copy link
Copy Markdown
Contributor

Thanks for picking this up, @HenriRabalais

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module: dataquery PR or issue related to (new) dataquery module Multilingual Any tasks related to making LORIS multilingual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DQT] - Inconsistent data displayed between old DQT and new DQT

2 participants