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

[imaging browser] Fix Human dangling out of nowhere #8363

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/imaging_browser/jsx/imagingBrowserIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ class ImagingBrowserIndex extends Component {
type: 'multiselect',
options: options.pendingNew,
}},
{label: 'Entity Type', show: false, filter: {
name: 'entityType',
type: 'multiselect',
option: options.entityType,
}},
];
/**
* Adding columns based on the Imaging Browser Tabulated Scan Types
Expand Down
7 changes: 7 additions & 0 deletions modules/imaging_browser/php/imaging_browser.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,20 @@ class Imaging_Browser extends \DataFrameworkMenu
$config = \NDB_Config::singleton();
$toTable_scan_types = $config->getSetting('tblScanTypes');

// get entity type options
$entityType = [
'Human' => 'Human',
'Scanner' => 'Scanner',
];

return [
'sites' => $siteList,
'projects' => $list_of_projects,
'visitQCStatus' => $visitQCStatus,
'sequenceTypes' => $sequenceTypes,
'pendingNew' => $pending,
'configLabels' => $toTable_scan_types,
'entityType' => $entityType,
];

}
Expand Down
18 changes: 13 additions & 5 deletions modules/imaging_browser/php/imagingbrowserrowprovisioner.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,18 @@ class ImagingBrowserRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisi
$pass = [];
$coalesce_desc = [];

foreach ($scan_id_types as $id => $type) {
$pass[$id] = $DB->escape($type);
$qc[$id] = $DB->quote($type);
// in order to keep the same order as the order of modalities
// specified in the config module, loop through the
// $toTable_scan_types array that conserved the order with
// which modalities will be displayed (which is what the React
// side expects)
foreach ($toTable_scan_types as $type) {
if (!in_array($type, $scan_id_types)) {
continue;
}
$id = array_search($type, $scan_id_types);
$pass[$id] = $DB->escape($type);
$qc[$id] = $DB->quote($type);
$coalesce_desc[$id] = $DB->escape($type);
$case_desc[$id] = "
CASE
Expand Down Expand Up @@ -172,7 +181,6 @@ class ImagingBrowserRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisi
// =================================================
// Final query
// =================================================

parent::__construct(
"SELECT
p.Name as Site,
Expand All @@ -189,9 +197,9 @@ class ImagingBrowserRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisi
s.ID as sessionID,
GROUP_CONCAT(DISTINCT modality.Scan_type) as sequenceType,
$PendingNewquery as pending,
$modalities_subquery
s.CenterID as CenterID,
c.Entity_type as entityType,
$modalities_subquery
s.ProjectID
FROM psc AS p
JOIN session s ON (s.CenterID=p.CenterID)
Expand Down