Skip to content

Commit

Permalink
[Subproject] Rename Subproject to Cohort (aces#7817)
Browse files Browse the repository at this point in the history
This consistently renamed "Subproject" to "Cohort" throughout LORIS (both the backend, frontend, and documentation) to remove confusion. The word "Cohort" is more consistently used and easily understood by end users.
  • Loading branch information
ridz1208 authored Nov 7, 2022
1 parent 90e4984 commit c70e615
Show file tree
Hide file tree
Showing 188 changed files with 3,380 additions and 2,853 deletions.
2 changes: 0 additions & 2 deletions .githooks/pre-push

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
project
p_*/
smarty/templates_c
.gitmodules
project-*
Expand Down
76 changes: 70 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,70 @@ core section.***
- ***When possible please provide the number of the pull request(s) containing the
changes in the following format: PR #1234***

## LORIS 25.0 (Release Date: ????-??-??)
### Core
#### Features
- placeholder

#### Updates and Improvements
- Rename subproject to Cohort (PR #7817)
- Create new CohortData and CohortController classes to use as data access model
and transfer object (PR #7817)
-

#### Bug Fixes
- placeholder

### Modules
#### ModuleName
- placeholder

### Tools
- placeholder

### Clean Up
- placeholder

### Notes For Existing Projects
- placeholder


### Notes For Developers
- placeholder




## LORIS 24.1 (Release Date: 2022-10-05)
### Core
#### Updates and Improvements
- Addition of `PhaseEncodingDirection` and `EchoNumber` columns to the `mri_protocol`
and `mri_protocol_violated_scans` tables to allow for better discrimination between some
MRI sequences.
- Addition of `PhaseEncodingDirection` and `EchoNumber` columns to the `files`, `files_qcstatus`
and `feedback_mri_comments` tables to ensure uniqueness keys for specific GE sequences for
which the `SeriesUID/EchoTime` combination is not enough (PR #8152).
- Addition of `image_type`, `PhaseEncodingDirection` and `EchoNumber` fields to the tables
present in the "Could not identify scan" page of the MRI violation module (PR #8156)
- Modification of the list of headers displayed in the image panel headers table (PR #8157)
#### Bug Fixes
- Bug fix to the imaging uploader so that when clicking on an upload row, the row is
highlighted and the proper log is being displayed in the log viewer (PR #8154)
- Remove SNR label from the image panel of the imaging browser when no SNR values can
be found for the image (PR #8155)
- Add the missing download buttons for BVAL, BVEC and JSON files that comes with BIDS/NIfTI
dataset/images. In addition, the "Download MINC" button has been renamed to a more generic
label "Download Image" (PR #8159)
- Fix ConfigurationException bug (PR #8107)
- Fix PHP fatal error when running the LORIS installation script (PR #8108)
- Add psr/log to composer (PR #8109)
- Fixed broken DB calls in `assign_missing_instruments` and `instruments` (PR #8162)
- Add support for PHP 8.1 (PR #7989)
### Modules
#### API
- Ability to use PSCID instead of the CandID in the candidates API (PR #8138)


## LORIS 24.0 (Release Date: 2022-03-24)
### Core
#### Features
Expand Down Expand Up @@ -39,7 +103,7 @@ on the naming format of a Basic Date or `MonthYear` field. (PR #6923)
- React Form Select Element now has the ability to set an option in the element
as a disabled option. (PR #7306)
- Pending accounts in Dashboard now includes DCC users (PR #7054)
- Subproject filter added to Behavioural QC module (PR #7430)
- Cohort filter added to Behavioural QC module (PR #7430)
- Addition of `date_format` as a DataType in ConfigSettings (PR #6719)
- Addition of new tables to store PET HRRT data (PR #6142)
- Modification of the `parameter_file` table's `Value` field type to `longtext` (PR #7392)
Expand Down Expand Up @@ -124,7 +188,7 @@ inefficient code and conditional display of select options based on previous sel
- The dataquery module user interface has been completely redesigned. (PR #6908)
#### EEG Browser
- Signal Visualization, Events and Electrode map (PR #7387)
- Site/Project/subproject filters only displays entries user has permission for. (PR #7400)
- Site/Project/cohort filters only displays entries user has permission for. (PR #7400)
- Addition of tables in the SQL schema, a filter on the main page of the module, and a download button
on the session page to support new annotation features (PR #7345)
- New integration test class added to this module (PR #6922)
Expand Down Expand Up @@ -170,7 +234,7 @@ user name match email address" and "Generate new password". (PR #6803)
- New tool `generate_candidate_externalids.php` to fill external IDs for all
candidates where a NULL value is found. (PR #7095)
- New tool `populate_visits.php` to back-populate visits from the `config.xml`,
`session` table and `Visit_Windows` table into the `visit` and `visit_project_subproject_rel` (#7663)
`session` table and `Visit_Windows` table into the `visit` and `visit_project_cohort_rel` (#7663)
- Deprecation of the `populate_visit_windows.php` tool in favour of `populate_visits.php` (#7663)
- Fixes a bug in the way that the data dictionary entries associated to MRI comments were named in the CouchDB database (PR #7082).

Expand All @@ -196,8 +260,8 @@ scanners, then `ScannerID` of the protocol should be set to `NULL` (PR #7496)
- The `RegistrationProjectID` column of the candidate table and the `ProjectID` column of the session table
in the database are no longer nullable. This means that a value must be set in these fields BEFORE running
the release SQL patch or it will fail.
- New function `Candidate::getSubjectForMostRecentVisit` replaces `Utility::getSubprojectIDUsingCandID`,
adding the ability to determine which subproject a candidate belongs to given their most recent visit.
- New function `Candidate::getSubjectForMostRecentVisit` replaces `Utility::getCohortIDUsingCandID`,
adding the ability to determine which cohort a candidate belongs to given their most recent visit.
- LINST instrument class was modified to implement the `getFullName()` and `getSubtestList()`
functions thus making entries in the `test_names` and `instrument_subtests` tables
unnecessary for LINST instruments (PR #7169)
Expand Down Expand Up @@ -314,7 +378,7 @@ or not matching password confirmation. (PR #6615, #6705, #6611)
- Projects filter only displays projects user has permission for. (PR #6706)

#### Genomic Browser
- In Profile and SNP screens, display subproject title instead of id. (PR #6633)
- In Profile and SNP screens, display cohort title instead of id. (PR #6633)

#### Survey
- Fix Notice error logs and infinite redirect. (PR #6644)
Expand Down
61 changes: 31 additions & 30 deletions SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,29 @@ CREATE TABLE `Project` (

INSERT INTO `Project` (Name,Alias) VALUES ('loris','LORI');

CREATE TABLE `subproject` (
`SubprojectID` int(10) unsigned NOT NULL auto_increment,
CREATE TABLE `cohort` (
`CohortID` int(10) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL,
`useEDC` boolean,
`WindowDifference` enum('optimal', 'battery'),
`RecruitmentTarget` int(10) unsigned,
PRIMARY KEY (SubprojectID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores Subprojects used in Loris';
PRIMARY KEY (CohortID),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores Cohorts used in Loris';


INSERT INTO subproject (title, useEDC, WindowDifference) VALUES
INSERT INTO cohort (title, useEDC, WindowDifference) VALUES
('Control', false, 'optimal'),
('Experimental', false, 'optimal');

CREATE TABLE `project_subproject_rel` (
`ProjectSubprojectRelID` int(10) unsigned NOT NULL AUTO_INCREMENT,
CREATE TABLE `project_cohort_rel` (
`ProjectCohortRelID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ProjectID` int(10) unsigned NOT NULL,
`SubprojectID` int(10) unsigned NOT NULL,
PRIMARY KEY (`ProjectSubprojectRelID`),
CONSTRAINT `UK_project_subproject_rel_ProjectID_SubprojectID` UNIQUE KEY (ProjectID, SubprojectID),
CONSTRAINT `FK_project_subproject_rel_ProjectID` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`) ON DELETE CASCADE,
CONSTRAINT `FK_project_subproject_rel_SubprojectID` FOREIGN KEY (`SubprojectID`) REFERENCES `subproject` (`SubprojectID`) ON DELETE CASCADE
`CohortID` int(10) unsigned NOT NULL,
PRIMARY KEY (`ProjectCohortRelID`),
CONSTRAINT `UK_project_cohort_rel_ProjectID_CohortID` UNIQUE KEY (ProjectID, CohortID),
CONSTRAINT `FK_project_cohort_rel_ProjectID` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`) ON DELETE CASCADE,
CONSTRAINT `FK_project_cohort_rel_CohortID` FOREIGN KEY (`CohortID`) REFERENCES `cohort` (`CohortID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `psc` (
Expand Down Expand Up @@ -185,7 +186,7 @@ CREATE TABLE `session` (
`ProjectID` int(10) unsigned NOT NULL,
`VisitNo` smallint(5) unsigned DEFAULT NULL,
`Visit_label` varchar(255) NOT NULL,
`SubprojectID` int(10) unsigned DEFAULT NULL,
`CohortID` int(10) unsigned DEFAULT NULL,
`Submitted` enum('Y','N') NOT NULL DEFAULT 'N',
`Current_stage` enum('Not Started','Screening','Visit','Approval','Subject','Recycling Bin') NOT NULL DEFAULT 'Not Started',
`Date_stage_change` date DEFAULT NULL,
Expand Down Expand Up @@ -216,11 +217,11 @@ CREATE TABLE `session` (
PRIMARY KEY (`ID`),
KEY `session_candVisit` (`CandID`,`VisitNo`),
KEY `FK_session_2` (`CenterID`),
KEY `SessionSubproject` (`SubprojectID`),
KEY `SessionCohort` (`CohortID`),
KEY `SessionActive` (`Active`),
CONSTRAINT `FK_session_1` FOREIGN KEY (`CandID`) REFERENCES `candidate` (`CandID`),
CONSTRAINT `FK_session_2` FOREIGN KEY (`CenterID`) REFERENCES `psc` (`CenterID`),
CONSTRAINT `FK_session_3` FOREIGN KEY (`SubprojectID`) REFERENCES `subproject` (`SubprojectID`),
CONSTRAINT `FK_session_3` FOREIGN KEY (`CohortID`) REFERENCES `cohort` (`CohortID`),
CONSTRAINT `FK_session_4` FOREIGN KEY (`languageID`) REFERENCES `language` (`language_id`),
CONSTRAINT `FK_session_ProjectID` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table holding session information';
Expand Down Expand Up @@ -318,7 +319,7 @@ CREATE TABLE `test_battery` (
`AgeMaxDays` int(10) unsigned default NULL,
`Active` enum('Y','N') NOT NULL default 'Y',
`Stage` varchar(255) default NULL,
`SubprojectID` int(11) default NULL,
`CohortID` int(11) default NULL,
`Visit_label` varchar(255) default NULL,
`CenterID` int(11) default NULL,
`firstVisit` enum('Y','N') default NULL,
Expand Down Expand Up @@ -672,15 +673,15 @@ CREATE TABLE `mri_protocol_group_target` (
`MriProtocolGroupTargetID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`MriProtocolGroupID` INT(4) UNSIGNED NOT NULL,
`ProjectID` INT(10) UNSIGNED DEFAULT NULL,
`SubprojectID` INT(10) UNSIGNED DEFAULT NULL,
`CohortID` INT(10) UNSIGNED DEFAULT NULL,
`Visit_label` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`MriProtocolGroupTargetID`),
CONSTRAINT `FK_mri_protocol_group_target_1` FOREIGN KEY (`MriProtocolGroupID`) REFERENCES `mri_protocol_group` (`MriProtocolGroupID`),
CONSTRAINT `FK_mri_protocol_group_target_2` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`),
CONSTRAINT `FK_mri_protocol_group_target_3` FOREIGN KEY (`SubprojectID`) REFERENCES `subproject` (`SubprojectID`)
CONSTRAINT `FK_mri_protocol_group_target_3` FOREIGN KEY (`CohortID`) REFERENCES `cohort` (`CohortID`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `mri_protocol_group_target` (`MriProtocolGroupID`, `ProjectID`, `SubprojectID`, `Visit_label`)
INSERT INTO `mri_protocol_group_target` (`MriProtocolGroupID`, `ProjectID`, `CohortID`, `Visit_label`)
VALUES((SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group'), NULL, NULL, NULL);


Expand Down Expand Up @@ -754,15 +755,15 @@ CREATE TABLE `mri_protocol_checks_group_target` (
`MriProtocolChecksGroupTargetID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`MriProtocolChecksGroupID` INT(4) UNSIGNED NOT NULL,
`ProjectID` INT(10) UNSIGNED DEFAULT NULL,
`SubprojectID` INT(10) UNSIGNED DEFAULT NULL,
`CohortID` INT(10) UNSIGNED DEFAULT NULL,
`Visit_label` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY(`MriProtocolChecksGroupTargetID`),
CONSTRAINT `FK_mri_protocol_checks_group_target_1` FOREIGN KEY (`MriProtocolChecksGroupID`) REFERENCES `mri_protocol_checks_group` (`MriProtocolChecksGroupID`),
CONSTRAINT `FK_mri_protocol_checks_group_target_2` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`),
CONSTRAINT `FK_mri_protocol_checks_group_target_3` FOREIGN KEY (`SubprojectID`) REFERENCES `subproject` (`SubprojectID`)
CONSTRAINT `FK_mri_protocol_checks_group_target_3` FOREIGN KEY (`CohortID`) REFERENCES `cohort` (`CohortID`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `mri_protocol_checks_group_target` (`MriProtocolChecksGroupID`, `ProjectID`, `SubprojectID`, `Visit_label`)
INSERT INTO `mri_protocol_checks_group_target` (`MriProtocolChecksGroupID`, `ProjectID`, `CohortID`, `Visit_label`)
VALUES((SELECT MriProtocolChecksGroupID FROM mri_protocol_checks_group WHERE Name='Default MRI protocol checks group'), NULL, NULL, NULL);


Expand Down Expand Up @@ -2292,16 +2293,16 @@ CREATE TABLE `visit` (
CONSTRAINT `UK_visit_name` UNIQUE KEY (`VisitName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `visit_project_subproject_rel` (
`VisitProjectSubprojectRelID` int(10) unsigned NOT NULL AUTO_INCREMENT,
CREATE TABLE `visit_project_cohort_rel` (
`VisitProjectCohortRelID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`VisitID` int(10) unsigned NOT NULL,
`ProjectSubprojectRelID` int(10) unsigned NOT NULL,
CONSTRAINT PK_visit_project_subproject_rel PRIMARY KEY (`VisitProjectSubprojectRelID`),
CONSTRAINT UK_visit_project_subproject_rel_VisitID_ProjectSubprojectRelID UNIQUE KEY (`VisitID`, `ProjectSubprojectRelID`),
CONSTRAINT FK_visit_project_subproject_rel_VisitID FOREIGN KEY (`VisitID`)
`ProjectCohortRelID` int(10) unsigned NOT NULL,
CONSTRAINT PK_visit_project_cohort_rel PRIMARY KEY (`VisitProjectCohortRelID`),
CONSTRAINT UK_visit_project_cohort_rel_VisitID_ProjectCohortRelID UNIQUE KEY (`VisitID`, `ProjectCohortRelID`),
CONSTRAINT FK_visit_project_cohort_rel_VisitID FOREIGN KEY (`VisitID`)
REFERENCES `visit`(`VisitID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_visit_project_subproject_rel_ProjectSubprojectRelID FOREIGN KEY (`ProjectSubprojectRelID`)
REFERENCES `project_subproject_rel`(`ProjectSubprojectRelID`) ON DELETE CASCADE ON UPDATE CASCADE
CONSTRAINT FK_visit_project_cohort_rel_ProjectCohortRelID FOREIGN KEY (`ProjectCohortRelID`)
REFERENCES `project_cohort_rel`(`ProjectCohortRelID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Publication Status
Expand Down
6 changes: 3 additions & 3 deletions SQL/9999-99-99-drop_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ DROP TABLE IF EXISTS `caveat_options`;
DROP TABLE IF EXISTS `users`;
DROP TABLE IF EXISTS `language`;
DROP TABLE IF EXISTS `psc`;
DROP TABLE IF EXISTS `visit_project_subproject_rel`;
DROP TABLE IF EXISTS `visit_project_cohort_rel`;
DROP TABLE IF EXISTS `visit`;
DROP TABLE IF EXISTS `project_subproject_rel`;
DROP TABLE IF EXISTS `project_cohort_rel`;
DROP TABLE IF EXISTS `consent_group`;
DROP TABLE IF EXISTS `Project`;
DROP TABLE IF EXISTS `subproject`;
DROP TABLE IF EXISTS `cohort`;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE subproject ADD UNIQUE (`title`);
32 changes: 32 additions & 0 deletions SQL/New_patches/2022-12-01-subprojects_no_more.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ALTER TABLE subproject RENAME TO cohort;
ALTER TABLE project_subproject_rel RENAME TO project_cohort_rel;
ALTER TABLE visit_project_subproject_rel RENAME TO visit_project_cohort_rel;

ALTER TABLE cohort CHANGE `SubprojectID` `CohortID` int(10) unsigned NOT NULL auto_increment;
ALTER TABLE project_cohort_rel CHANGE `ProjectSubprojectRelID` `ProjectCohortRelID` int(10) unsigned NOT NULL AUTO_INCREMENT;
ALTER TABLE project_cohort_rel CHANGE `SubprojectID` `CohortID` int(10) unsigned NOT NULL;
ALTER TABLE session CHANGE `SubprojectID` `CohortID` int(10) unsigned DEFAULT NULL;
ALTER TABLE test_battery CHANGE `SubprojectID` `CohortID` int(10) unsigned DEFAULT NULL;
ALTER TABLE mri_protocol_checks_group_target CHANGE `SubprojectID` `CohortID` int(10) unsigned DEFAULT NULL;
ALTER TABLE mri_protocol_group_target CHANGE `SubprojectID` `CohortID` int(10) unsigned DEFAULT NULL;
ALTER TABLE visit_project_cohort_rel CHANGE `VisitProjectSubprojectRelID` `VisitProjectCohortRelID` int(10) unsigned NOT NULL AUTO_INCREMENT;
ALTER TABLE visit_project_cohort_rel CHANGE `ProjectSubprojectRelID` `ProjectCohortRelID` int(10) unsigned NOT NULL;


/**
REVERT PATCH
ALTER TABLE cohort RENAME TO subproject;
ALTER TABLE project_cohort_rel RENAME TO project_subproject_rel;
ALTER TABLE visit_project_cohort_rel RENAME TO visit_project_subproject_rel;
ALTER TABLE cohort CHANGE `CohortID` `SubprojectID` int(10) unsigned NOT NULL auto_increment;
ALTER TABLE project_cohort_rel CHANGE `ProjectCohortRelID` `ProjectSubprojectRelID` int(10) unsigned NOT NULL AUTO_INCREMENT;
ALTER TABLE project_cohort_rel CHANGE `CohortID` `SubprojectID` int(10) unsigned NOT NULL;
ALTER TABLE session CHANGE `CohortID` `SubprojectID` int(10) unsigned DEFAULT NULL;
ALTER TABLE test_battery CHANGE `CohortID` `SubprojectID` int(10) unsigned DEFAULT NULL;
ALTER TABLE mri_protocol_checks_group_target CHANGE `CohortID` `SubprojectID` int(10) unsigned DEFAULT NULL;
ALTER TABLE mri_protocol_group_target CHANGE `CohortID` `SubprojectID` int(10) unsigned DEFAULT NULL;
ALTER TABLE visit_project_cohort_rel CHANGE `VisitProjectCohortRelID` `VisitProjectSubprojectRelID` int(10) unsigned NOT NULL AUTO_INCREMENT;
ALTER TABLE visit_project_cohort_rel CHANGE `ProjectCohortRelID` `ProjectSubprojectRelID` int(10) unsigned NOT NULL;
*/
8 changes: 4 additions & 4 deletions docs/notebooks/LORIS_API_Part2_Python-script.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@
" \"CandID\" : candid,\n",
" \"Project\" : \"Pumpernickel\",\n",
" \"Visit\" : visit,\n",
" \"Battery\": \"NameOfSubproject\"\n",
" \"Battery\": \"NameOfCohort\"\n",
" \"Stages\": {\n",
" \"Visit\": {\n",
" \"Date\": \"2017-03-26\",\n",
Expand All @@ -644,7 +644,7 @@
" - Every possible visit_labels for a project can be found using /projects/\\$projectname/visits. If a {visit} is in /projects/{project}/visits but not in /candidates/{candid}/ , it can be added with a **PUT** request to /candidates/\\$candid/\\$visit_label\n",
"\n",
"\n",
" - Battery (NameOfSubproject) must be guessed... \n",
" - Battery (NameOfCohort) must be guessed... \n",
" \n",
" "
]
Expand Down Expand Up @@ -718,7 +718,7 @@
" \"Meta\" : {\n",
" \"CandID\" : candid,\n",
" \"Visit\" : visit,\n",
" \"Battery\": \"NameOfSubproject\"\n",
" \"Battery\": \"NameOfCohort\"\n",
"}\n",
"```\n",
"\n",
Expand All @@ -728,7 +728,7 @@
" - Every possible {visit} labels for a project can be found using /projects/{project}/visits. If a {visit} label is in /projects/{project}/visits but not in /candidates/{candid}/ , it can be added using a **PUT** request to /candidates/{candid}/{visit}\n",
"\n",
"\n",
" - Battery (NameOfSubproject) must be guessed... "
" - Battery (NameOfCohort) must be guessed... "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Projects

## Overview
The **Project** represents a study in LORIS and can have different subprojects (see [Subproject setup](04_Subprojects.md) page) which, in turn, can be affiliated with different visits (see [Timepoints setup](05_Timepoints.md) page).
The **Project** represents a study in LORIS and can have different cohorts (see [Cohort setup](04_Cohorts.md) page) which, in turn, can be affiliated with different visits (see [Timepoints setup](05_Timepoints.md) page).

**Projects** are defined in the `Project` table of the database.

Expand Down
Loading

0 comments on commit c70e615

Please sign in to comment.