Skip to content

Commit

Permalink
Merge branch 'main' into 2024_01_30_hed_tag_support
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersoncasimir authored Feb 27, 2024
2 parents ba0809a + 1112e1a commit 4d1bd11
Show file tree
Hide file tree
Showing 78 changed files with 1,679 additions and 533 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/loristest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']
apiversion: ['v0.0.3', 'v0.0.4-dev']
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -167,9 +167,8 @@ jobs:
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-03-ConfigTables.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-04-Help.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-05-ElectrophysiologyTables.sql
find raisinbread/instruments/instrument_sql -name *.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
find raisinbread/instruments/instrument_sql -name *.sql -not -name 9999-99-99-drop_instrument_tables.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
find raisinbread/RB_files/ -name *.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
- name: Source instrument schemas
run: |
find raisinbread/instruments/instrument_sql -name 0000-*.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
Expand Down Expand Up @@ -210,7 +209,7 @@ jobs:
fail-fast: false
matrix:
testsuite: ['integration']
php: ['8.1','8.2']
php: ['8.1','8.2', '8.3']
ci_node_index: [0,1,2,3]

include:
Expand All @@ -221,10 +220,14 @@ jobs:
php: '8.1'
- testsuite: 'static'
php: '8.2'
- testsuite: 'static'
php: '8.3'
- testsuite: 'unit'
php: '8.1'
- testsuite: 'unit'
php: '8.2'
- testsuite: 'unit'
php: '8.3'

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"php",
"htdocs",
"modules",
"src",
"src",
"vendor",
"test"
],
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ changes in the following format: PR #1234***
#### Features
- Add OpenID Connect authorization support to LORIS (PR #8255)

#### Updates and Improvements
- Create new `sex` table to hold candidate sex options, and change Sex and ProbandSex columns of `candidate` table to a varchar(255) datatype that is restricted by the `sex` table (PR #9025)

#### Bug Fixes
- Fix examiner site display (PR #8967)
- bvl_feedback updates in real-time (PR #8966)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.test.db
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mysql:5.7
FROM mariadb:10.5

ARG BASE_DIR

Expand Down
17 changes: 14 additions & 3 deletions SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ CREATE TABLE `language` (
INSERT INTO language (language_code, language_label) VALUES
('en-CA', 'English');

CREATE TABLE `sex` (
`Name` varchar(255) NOT NULL,
PRIMARY KEY `Name` (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores sex options available for candidates in LORIS';

INSERT INTO sex (Name) VALUES ('Male'), ('Female'), ('Other');

CREATE TABLE `users` (
`ID` int(10) unsigned NOT NULL auto_increment,
`UserID` varchar(255) NOT NULL default '',
Expand Down Expand Up @@ -151,7 +158,7 @@ CREATE TABLE `candidate` (
`DoB` date DEFAULT NULL,
`DoD` date DEFAULT NULL,
`EDC` date DEFAULT NULL,
`Sex` enum('Male','Female','Other') DEFAULT NULL,
`Sex` varchar(255) DEFAULT NULL,
`RegistrationCenterID` integer unsigned NOT NULL DEFAULT '0',
`RegistrationProjectID` int(10) unsigned NOT NULL,
`Ethnicity` varchar(255) DEFAULT NULL,
Expand All @@ -166,7 +173,7 @@ CREATE TABLE `candidate` (
`flagged_other_status` enum('not_answered') DEFAULT NULL,
`Testdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Entity_type` enum('Human','Scanner') NOT NULL DEFAULT 'Human',
`ProbandSex` enum('Male','Female','Other') DEFAULT NULL,
`ProbandSex` varchar(255) DEFAULT NULL,
`ProbandDoB` date DEFAULT NULL,
PRIMARY KEY (`CandID`),
UNIQUE KEY `ID` (`ID`),
Expand All @@ -175,9 +182,13 @@ CREATE TABLE `candidate` (
KEY `CandidateActive` (`Active`),
KEY `FK_candidate_2_idx` (`flagged_reason`),
KEY `PSCID` (`PSCID`),
KEY `FK_candidate_sex_1` (`Sex`),
KEY `FK_candidate_sex_2` (`ProbandSex`),
CONSTRAINT `FK_candidate_1` FOREIGN KEY (`RegistrationCenterID`) REFERENCES `psc` (`CenterID`),
CONSTRAINT `FK_candidate_2` FOREIGN KEY (`flagged_reason`) REFERENCES `caveat_options` (`ID`) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT `FK_candidate_RegistrationProjectID` FOREIGN KEY (`RegistrationProjectID`) REFERENCES `Project` (`ProjectID`) ON UPDATE CASCADE
CONSTRAINT `FK_candidate_RegistrationProjectID` FOREIGN KEY (`RegistrationProjectID`) REFERENCES `Project` (`ProjectID`) ON UPDATE CASCADE,
CONSTRAINT `FK_candidate_sex_1` FOREIGN KEY (`Sex`) REFERENCES `sex` (`Name`) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT `FK_candidate_sex_2` FOREIGN KEY (`ProbandSex`) REFERENCES `sex` (`Name`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `session` (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ DROP TABLE physiological_annotation_label;
DROP TABLE physiological_annotation_file;
DROP TABLE physiological_annotation_file_type;

-- Event files are always associated to Projects, sometimes exclusively (dataset-scope events.json files)
-- Add ProjectID and make PhysiologicalFileID DEFAULT NULL (ProjectID should ideally not be NULLable)
ALTER TABLE `physiological_event_file`
CHANGE `PhysiologicalFileID` `PhysiologicalFileID` int(10) unsigned DEFAULT NULL,
ADD COLUMN `ProjectID` int(10) unsigned DEFAULT NULL AFTER `PhysiologicalFileID`,
ADD KEY `FK_physiological_event_file_project_id` (`ProjectID`),
ADD CONSTRAINT `FK_physiological_event_file_project_id`
FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`);
14 changes: 14 additions & 0 deletions SQL/New_patches/2024-01-29-create-sex-table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE `sex` (
`Name` varchar(255) NOT NULL,
PRIMARY KEY `Name` (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores sex options available for candidates in LORIS';

INSERT INTO sex (Name) VALUES ('Male'), ('Female'), ('Other');

ALTER TABLE candidate
MODIFY COLUMN sex varchar(255) DEFAULT NULL,
MODIFY COLUMN ProbandSex varchar(255) DEFAULT NULL,
ADD KEY `FK_candidate_sex_1` (`Sex`),
ADD KEY `FK_candidate_sex_2` (`ProbandSex`),
ADD CONSTRAINT `FK_candidate_sex_1` FOREIGN KEY (`Sex`) REFERENCES `sex` (`Name`) ON DELETE RESTRICT ON UPDATE CASCADE,
ADD CONSTRAINT `FK_candidate_sex_2` FOREIGN KEY (`ProbandSex`) REFERENCES `sex` (`Name`) ON DELETE RESTRICT ON UPDATE CASCADE;
66 changes: 34 additions & 32 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions jsx/Filter.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, {useEffect} from 'react';
import PropTypes from 'prop-types';
import {
SelectElement,
CheckboxElement,
DateElement,
TextboxElement,
FormElement,
FieldsetElement,
CheckboxElement,
FormElement,
NumericElement,
SelectElement,
TextboxElement,
} from 'jsx/Form';

/**
Expand Down
7 changes: 7 additions & 0 deletions modules/battery_manager/jsx/batteryManagerForm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {
ButtonElement,
FormElement,
StaticElement,
SelectElement,
NumericElement,
} from 'jsx/Form';

/**
* Battery Manager Form
Expand Down
1 change: 1 addition & 0 deletions modules/battery_manager/jsx/batteryManagerIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Loader from 'Loader';
import FilterableDataTable from 'FilterableDataTable';
import Modal from 'Modal';
import swal from 'sweetalert2';
import {CTA} from 'jsx/Form';

import BatteryManagerForm from './batteryManagerForm';

Expand Down
6 changes: 1 addition & 5 deletions modules/candidate_list/jsx/candidateListIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,7 @@ class CandidateListIndex extends Component {
name: 'sex',
type: 'select',
hide: this.state.hideFilter,
options: {
'Male': 'Male',
'Female': 'Female',
'Other': 'Other',
},
options: options.Sex,
},
},
{
Expand Down
1 change: 1 addition & 0 deletions modules/candidate_list/php/candidate_list.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Candidate_List extends \DataFrameworkMenu
'cohort' => $cohort_options,
'participantstatus' => $participant_status_options,
'useedc' => $config->getSetting("useEDC"),
'Sex' => \Utility::getSexList(),
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/candidate_parameters/ajax/getData.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function getProbandInfoFields()
'ageDifference' => $ageDifference,
'extra_parameters' => $extra_parameters,
'parameter_values' => $parameter_values,
'sexOptions' => \Utility::getSexList(),
];

return $result;
Expand Down
Loading

0 comments on commit 4d1bd11

Please sign in to comment.