Skip to content
New issue

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

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

Already on GitHub? # to your account

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

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,42 @@ class ImagingBrowserRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisi
// =================================================
// Final query
// =================================================
error_log(print_r(
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
"SELECT
p.Name as Site,
c.PSCID as PSCID,
c.CandID as DCCID,
Project.Name as project,
s.Visit_label as visitLabel,
$PendingFailSubquery as Visit_QC_Status,
DATE_FORMAT(MIN(f.AcquisitionDate), \"%Y-%m-%d\") as First_Acquisition,
FROM_UNIXTIME(MIN(f.InsertTime)) as First_Insertion,
FROM_UNIXTIME(MAX(fqc.QCLastChangeTime)) as Last_QC,
$NewDataSubquery as New_Data,
GROUP_CONCAT(DISTINCT OutputType) as Links,
s.ID as sessionID,
GROUP_CONCAT(DISTINCT modality.Scan_type) as sequenceType,
$PendingNewquery as pending,
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)
JOIN candidate c ON (c.CandID=s.CandID)
LEFT JOIN Project ON (s.ProjectID=Project.ProjectID)
JOIN files f ON (f.SessionID=s.ID)
LEFT JOIN files_qcstatus fqc ON (fqc.FileID=f.FileID)
LEFT JOIN mri_scan_type modality ON
(f.AcquisitionProtocolID=modality.ID)
$left_joins
WHERE
s.Active = 'Y' AND
f.FileType IN ('mnc', 'nii')
GROUP BY s.ID
ORDER BY c.PSCID, s.Visit_label
"
));

parent::__construct(
"SELECT
Expand All @@ -189,9 +225,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