Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e4243a8
[statistics] Cleanup filters and add Registration Date
skarya22 Jul 30, 2025
3f14d60
Fix line length
skarya22 Jul 30, 2025
8355dd0
Add subtitles to dashboard panels
skarya22 Jul 31, 2025
ab499d1
Fix formatting
skarya22 Jul 31, 2025
69994e2
Fix tests
skarya22 Jul 31, 2025
c45fa23
Fix issue with visit filter + console warning + date_registered
skarya22 Aug 13, 2025
22e7083
Reorganize and add age distribution
skarya22 Aug 14, 2025
c3b9c24
Fix php formatting
skarya22 Aug 14, 2025
8f148d6
Just trying to make phan happy
skarya22 Aug 14, 2025
49b9729
Add % to age chart and bigger subtitle
skarya22 Sep 3, 2025
7389b4b
Add project size charts + Generalize helpers
jeffersoncasimir Sep 15, 2025
90534f7
Add SQL patch + RB
jeffersoncasimir Sep 15, 2025
1612603
Rename 'Project Size' to 'Dataset Size'
jeffersoncasimir Sep 15, 2025
a40e1c7
Fint php lint
jeffersoncasimir Sep 16, 2025
81204c2
Remove commented code
jeffersoncasimir Sep 16, 2025
3c2159a
Fix conflict
jeffersoncasimir Sep 16, 2025
93f133c
Compliance changes
jeffersoncasimir Sep 17, 2025
86c1a80
Lint fixes
jeffersoncasimir Sep 17, 2025
30e5592
Static fixes
jeffersoncasimir Sep 17, 2025
d0aa6bb
Satisfy linter
jeffersoncasimir Sep 17, 2025
683709d
Satisfy linter
jeffersoncasimir Sep 17, 2025
08f6a54
Corrected merge change
jeffersoncasimir Oct 20, 2025
d3ce416
Remove console.log
jeffersoncasimir Oct 20, 2025
eed888b
Rebase to aces/main
jeffersoncasimir Oct 27, 2025
0c89da1
Fix failing static tests
jeffersoncasimir Oct 27, 2025
f14630c
Fix failing static tests
jeffersoncasimir Oct 27, 2025
cf24d8c
Fix null scenario
jeffersoncasimir Oct 27, 2025
f3e66dc
Fix null scenario
jeffersoncasimir Oct 27, 2025
15842fa
Make strings translatable
jeffersoncasimir Oct 29, 2025
79748e2
EEG widget + charts endpoints
jeffersoncasimir Sep 17, 2025
94e0088
Show graphs + Fix payload
jeffersoncasimir Sep 29, 2025
259eb1c
php lint fix
jeffersoncasimir Sep 29, 2025
ce3b601
Add request to endpoints
jeffersoncasimir Oct 22, 2025
a3c698d
Delete redeclaration
jeffersoncasimir Oct 29, 2025
254602f
Add translations
jeffersoncasimir Oct 29, 2025
113a605
Revert unecessary changes
jeffersoncasimir Oct 29, 2025
2927838
Linter compliance
jeffersoncasimir Oct 29, 2025
bbbb226
Linter compliance
jeffersoncasimir Oct 29, 2025
a59afe9
Static compliance
jeffersoncasimir Oct 30, 2025
2acd59f
Static compliance
jeffersoncasimir Oct 30, 2025
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
31 changes: 30 additions & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,35 @@ INSERT INTO StatisticsTabs (ModuleName, SubModuleName, Description, OrderNo) VAL
('statistics', 'stats_behavioural', 'Behavioural Statistics', 3),
('statistics', 'stats_MRI', 'Imaging Statistics', 4);


-- ********************************
-- statistics
-- ********************************


CREATE TABLE `cached_data_type` (
`CachedDataTypeID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(255) UNIQUE NOT NULL,
PRIMARY KEY (`CachedDataTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `cached_data_type` (`Name`) SELECT 'projects_disk_space';


CREATE TABLE `cached_data` (
`CachedDataID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`CachedDataTypeID` INT(10) UNSIGNED NOT NULL,
`Value` TEXT NOT NULL,
`LastUpdate` TIMESTAMP NOT NULL
DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CachedDataID`),
CONSTRAINT `FK_cached_data_type` FOREIGN KEY (`CachedDataTypeID`)
REFERENCES `cached_data_type` (`CachedDataTypeID`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- ********************************
-- server_processes tables
-- ********************************
Expand Down Expand Up @@ -2688,4 +2717,4 @@ CREATE TABLE `redcap_notification` (
`handled_dt` datetime NULL,
PRIMARY KEY (`id`),
KEY `i_redcap_notif_received_dt` (`received_dt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21 changes: 21 additions & 0 deletions SQL/New_patches/2025_09_11_add_data_cache_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Create cached_data_type table to track different types of cached data
CREATE TABLE `cached_data_type` (
`CachedDataTypeID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(255) UNIQUE NOT NULL,
PRIMARY KEY (`CachedDataTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create cached_data table to track cached data
CREATE TABLE `cached_data` (
`CachedDataID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`CachedDataTypeID` INT(10) UNSIGNED NOT NULL,
`Value` TEXT NOT NULL,
`LastUpdate` TIMESTAMP NOT NULL
DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CachedDataID`),
CONSTRAINT `FK_cached_data_type` FOREIGN KEY (`CachedDataTypeID`)
REFERENCES `cached_data_type` (`CachedDataTypeID`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `cached_data_type` (`Name`) SELECT 'projects_disk_space';
81 changes: 81 additions & 0 deletions modules/electrophysiology_browser/php/module.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,85 @@ class Module extends \Module
{
return dgettext("electrophysiology_browser", "Electrophysiology Browser");
}

/**
* {@inheritDoc}
*
* @param string $type The type of widgets to get.
* @param \User $user The user widgets are being retrieved for.
* @param array $options A type dependent list of options to provide
* to the widget.
*
* @return \LORIS\GUI\Widget[]
*/
public function getWidgets(string $type, \User $user, array $options) : array
{
$factory = \NDB_Factory::singleton();
$baseURL = $factory->settings()->getBaseURL();

switch ($type) {
case 'study-progression':
$DB = $factory->database();
$sessionData = $DB->pselectWithIndexKey(
"SELECT
p.ProjectID,
p.Name AS ProjectName,
COUNT(s.ID) AS count,
CONCAT('"
. $baseURL .
"/electrophysiology_browser/?project=', p.Name
) as url
FROM session s
JOIN Project p ON p.ProjectID = s.ProjectID
JOIN physiological_file pf ON pf.SessionID = s.ID
WHERE s.Active <> 'N'
AND s.CenterID <> 1
GROUP BY p.Name",
[],
'ProjectID'
);
$eventData = $DB->pselectWithIndexKey(
"SELECT
p.ProjectID,
p.Name AS ProjectName,
COUNT(pte.PhysiologicalTaskEventID) AS count,
CONCAT('"
. $baseURL .
"/electrophysiology_browser/?project=', p.Name
) as url
FROM session s
JOIN Project p ON p.ProjectID = s.ProjectID
JOIN physiological_file pf ON pf.SessionID = s.ID
JOIN physiological_task_event pte USING (PhysiologicalFileID)
WHERE s.Active <> 'N'
AND s.CenterID <> 1
GROUP BY p.Name",
[],
'ProjectID'
);
return [
new \LORIS\dashboard\DataWidget(
new \LORIS\GUI\LocalizableString(
"dqt",
"EEG Session",
"EEG Sessions",
),
$sessionData,
"",
'rgb(186,255,201)',
),
new \LORIS\dashboard\DataWidget(
new \LORIS\GUI\LocalizableString(
"dqt",
"EEG Event",
"EEG Events",
),
$eventData,
"",
'rgb(186,255,201)',
)
];
}
return [];
}
}
4 changes: 2 additions & 2 deletions modules/statistics/css/recruitment.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
background-color: #2FA4E7;
}

.study-progression-container {
.study-progression-container, .eeg-data-container {
max-height: 415px;
overflow-y: auto;
}
Expand Down Expand Up @@ -42,4 +42,4 @@
transform: translateY(-10px);
background-color: #f9fdff;
box-shadow: 0 12px 12px rgba(0, 0, 0, 0.25);
}
}
9 changes: 9 additions & 0 deletions modules/statistics/jsx/WidgetIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {useEffect, useState} from 'react';
import PropTypes from 'prop-types';
import Recruitment from './widgets/recruitment';
import StudyProgression from './widgets/studyprogression';
import Electrophysiology from './widgets/electrophysiology';
import {fetchData} from './Fetch';
import Modal from 'Modal';
import Loader from 'Loader';
Expand All @@ -23,6 +24,7 @@ import jaStrings from '../locale/ja/LC_MESSAGES/statistics.json';
const WidgetIndex = (props) => {
const [recruitmentData, setRecruitmentData] = useState({});
const [studyProgressionData, setStudyProgressionData] = useState({});
const [electrophysiologyData, setElectrophysiologyData] = useState({});
const [modalChart, setModalChart] = useState(null);
const {t, i18n} = useTranslation();
useEffect( () => {
Expand Down Expand Up @@ -253,6 +255,7 @@ const WidgetIndex = (props) => {
);
setRecruitmentData(data);
setStudyProgressionData(data);
setElectrophysiologyData(data);
};
setup().catch(
(error) => {
Expand Down Expand Up @@ -348,6 +351,12 @@ const WidgetIndex = (props) => {
showChart ={showChart}
updateFilters ={updateFilters}
/>
<Electrophysiology
data ={electrophysiologyData}
baseURL ={props.baseURL}
showChart ={showChart}
updateFilters ={updateFilters}
/>
</>
);
};
Expand Down
Loading
Loading