diff --git a/modules/imaging_browser/jsx/imagingBrowserIndex.js b/modules/imaging_browser/jsx/imagingBrowserIndex.js index 54d6f373fdc..35402204d96 100644 --- a/modules/imaging_browser/jsx/imagingBrowserIndex.js +++ b/modules/imaging_browser/jsx/imagingBrowserIndex.js @@ -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 diff --git a/modules/imaging_browser/php/imaging_browser.class.inc b/modules/imaging_browser/php/imaging_browser.class.inc index eca7b1bb641..a203d4b2490 100644 --- a/modules/imaging_browser/php/imaging_browser.class.inc +++ b/modules/imaging_browser/php/imaging_browser.class.inc @@ -137,6 +137,12 @@ 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, @@ -144,6 +150,7 @@ class Imaging_Browser extends \DataFrameworkMenu 'sequenceTypes' => $sequenceTypes, 'pendingNew' => $pending, 'configLabels' => $toTable_scan_types, + 'entityType' => $entityType, ]; } diff --git a/modules/imaging_browser/php/imagingbrowserrowprovisioner.class.inc b/modules/imaging_browser/php/imagingbrowserrowprovisioner.class.inc index 98e18425e5a..ee614bc9ff2 100644 --- a/modules/imaging_browser/php/imagingbrowserrowprovisioner.class.inc +++ b/modules/imaging_browser/php/imagingbrowserrowprovisioner.class.inc @@ -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 @@ -172,7 +181,6 @@ class ImagingBrowserRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisi // ================================================= // Final query // ================================================= - parent::__construct( "SELECT p.Name as Site, @@ -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)