forked from aces/Loris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 2024_10_28_instrument_data_parser
- Loading branch information
Showing
268 changed files
with
25,340 additions
and
23,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(DISTINCT c.CandID) AS count | ||
FROM candidate c | ||
JOIN Project ON c.RegistrationProjectID = Project.ProjectID | ||
WHERE Project.showSummaryOnLogin = 1 | ||
AND c.Sex = 'Female' | ||
AND Entity_type = 'Human' | ||
GROUP BY Project.Name WITH ROLLUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(DISTINCT c.CandID) AS count | ||
FROM candidate c | ||
JOIN Project ON c.RegistrationProjectID = Project.ProjectID | ||
WHERE Project.showSummaryOnLogin = 1 | ||
AND c.Sex = 'Male' | ||
AND Entity_type = 'Human' | ||
GROUP BY Project.Name WITH ROLLUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(DISTINCT psc.CenterID) AS count | ||
FROM psc | ||
JOIN session s ON s.CenterID = psc.CenterID | ||
JOIN Project ON s.ProjectID = Project.ProjectID | ||
WHERE Project.showSummaryOnLogin = 1 | ||
GROUP BY Project.Name WITH ROLLUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(s.ID) AS count | ||
FROM session s | ||
JOIN Project ON (s.ProjectID = Project.ProjectID) | ||
WHERE Project.showSummaryOnLogin = 1 | ||
GROUP BY Project.Name WITH ROLLUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(DISTINCT TestID) AS count | ||
FROM flag f | ||
JOIN session s ON s.ID = f.SessionID | ||
JOIN Project ON s.ProjectID = Project.ProjectID | ||
WHERE Project.showSummaryOnLogin = 1 | ||
GROUP BY Project.Name WITH ROLLUP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(FileID) AS count | ||
FROM files f | ||
JOIN session s ON s.ID = f.SessionID | ||
JOIN Project ON s.ProjectID = Project.ProjectID | ||
WHERE Project.showSummaryOnLogin = 1 | ||
GROUP BY Project.Name WITH ROLLUP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SELECT | ||
IFNULL(Project.Name, 'All Projects') as ProjectName, | ||
COUNT(PhysiologicalFileID) AS count | ||
FROM physiological_parameter_file ppf | ||
LEFT JOIN physiological_file USING (PhysiologicalFileID) | ||
LEFT JOIN physiological_output_type USING (PhysiologicalOutputTypeID) | ||
LEFT JOIN Project ON ppf.ProjectID = Project.ProjectID | ||
WHERE ( | ||
ParameterTypeID = ( | ||
SELECT ParameterTypeID | ||
FROM parameter_type | ||
WHERE Name = 'RecordingDuration' | ||
) | ||
) | ||
-- AND OutputTypeName = 'raw' | ||
AND Project.showSummaryOnLogin = 1 | ||
GROUP BY Project.Name WITH ROLLUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
INSERT INTO notification_modules (module_name, operation_type, as_admin, template_file, description) VALUES | ||
('issue_tracker', 'create/edit', 'N', 'issue_change.tpl', 'Notify for all issues created or edited'); | ||
|
||
INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES | ||
((SELECT id FROM notification_modules WHERE module_name='issue_tracker' AND operation_type='create/edit'), (SELECT id FROM notification_services WHERE service='email_text')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE Login_Summary_Statistics ( | ||
Title VARCHAR(255), | ||
Project VARCHAR(255), | ||
Value INT, | ||
QueryOrder INT, | ||
PRIMARY KEY (Title, Project) | ||
); | ||
|
||
ALTER TABLE dataquery_study_queries_rel | ||
MODIFY COLUMN PinType enum('topquery','dashboard', 'loginpage') DEFAULT NULL; | ||
|
||
ALTER TABLE Project | ||
ADD COLUMN showSummaryOnLogin BOOLEAN DEFAULT TRUE; |
9 changes: 9 additions & 0 deletions
9
SQL/New_patches/2025-02-07_update_add_issue_tracker_permissions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
UPDATE permissions SET code = 'issue_tracker_own_issue', description = 'See/Edit/Comment and Close on Own Issues' | ||
WHERE code = 'issue_tracker_reporter'; | ||
UPDATE permissions SET code = 'issue_tracker_all_issue', description = 'See/Edit/Comment on all Issues' | ||
WHERE code = 'issue_tracker_developer'; | ||
|
||
INSERT INTO permissions (code, description, moduleID, categoryID) VALUES | ||
('issue_tracker_site_issue','See/Edit/Comment on Own Site Issues',(SELECT ID FROM modules WHERE Name = 'issue_tracker'),2), | ||
('issue_tracker_close_site_issue','Close Own Site Issues',(SELECT ID FROM modules WHERE Name = 'issue_tracker'),2), | ||
('issue_tracker_close_all_issue','Close all Issues',(SELECT ID FROM modules WHERE Name = 'issue_tracker'),2); |
3 changes: 3 additions & 0 deletions
3
SQL/New_patches/2025_02_03_permissions_Modifies_issue_tracker_reporter_description.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
UPDATE permissions | ||
SET description = 'Create/Edit/Close Own Issues and Comment on All Issues' | ||
WHERE code = 'issue_tracker_reporter'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
-- Change FKs from CandID to CandidateID which is now candidate.ID | ||
ALTER TABLE CNV DROP constraint CNV_ibfk_3; | ||
UPDATE CNV SET CandID=(SELECT ID from candidate c WHERE c.CandID=CNV.CandID); | ||
ALTER TABLE CNV CHANGE CandID CandidateID int(10) unsigned DEFAULT NULL; | ||
ALTER TABLE CNV ADD CONSTRAINT CNV_ibfk_3 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE candidate_consent_rel DROP CONSTRAINT `FK_candidate_consent_rel_CandidateID`; | ||
UPDATE candidate_consent_rel SET CandidateID=(SELECT ID from candidate c WHERE c.CandID=candidate_consent_rel.CandidateID); | ||
ALTER TABLE candidate_consent_rel CHANGE CandidateID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE candidate_consent_rel ADD CONSTRAINT FK_candidate_consent_rel_CandidateID FOREIGN KEY (CandidateID) REFERENCES candidate(ID) ON DELETE RESTRICT ON UPDATE RESTRICT; | ||
|
||
ALTER TABLE participant_status DROP CONSTRAINT `fk_participant_status_3`; | ||
UPDATE participant_status SET CandID=(SELECT ID from candidate c WHERE c.CandID=participant_status.CandID); | ||
ALTER TABLE participant_status CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE participant_status ADD CONSTRAINT FK_participant_status_3 FOREIGN KEY (CandidateID) REFERENCES candidate(ID) ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
ALTER TABLE dataquery_run_results DROP CONSTRAINT `dataquery_run_results_ibfk_1`; | ||
UPDATE dataquery_run_results SET CandID=(SELECT ID from candidate c WHERE c.CandID=dataquery_run_results.CandID); | ||
ALTER TABLE dataquery_run_results CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE dataquery_run_results ADD CONSTRAINT dataquery_run_results_ibfk_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE issues DROP CONSTRAINT `fk_issues_3`; | ||
UPDATE issues SET CandID=(SELECT ID from candidate c WHERE c.CandID=issues.CandID); | ||
ALTER TABLE issues CHANGE CandID CandidateID int(10) unsigned DEFAULT NULL; | ||
ALTER TABLE issues ADD CONSTRAINT fk_issues_3 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE session DROP CONSTRAINT `fk_session_1`; | ||
UPDATE session SET CandID=(SELECT ID from candidate c WHERE c.CandID=session.CandID); | ||
ALTER TABLE session CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE session ADD CONSTRAINT fk_session_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE genomic_candidate_files_rel DROP CONSTRAINT `genomic_candidate_files_rel_ibfk_1`; | ||
UPDATE genomic_candidate_files_rel SET CandID=(SELECT ID from candidate c WHERE c.CandID=genomic_candidate_files_rel.CandID); | ||
ALTER TABLE genomic_candidate_files_rel CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE genomic_candidate_files_rel ADD CONSTRAINT genomic_candidate_files_rel_ibfk_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE mri_scanner DROP CONSTRAINT `FK_mri_scanner_1`; | ||
UPDATE mri_scanner SET CandID=(SELECT ID from candidate c WHERE c.CandID=mri_scanner.CandID); | ||
ALTER TABLE mri_scanner CHANGE CandID CandidateID int(10) unsigned DEFAULT NULL; | ||
ALTER TABLE mri_scanner ADD CONSTRAINT FK_mri_scanner_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE genomic_sample_candidate_rel DROP CONSTRAINT `genomic_sample_candidate_rel_ibfk_1`; | ||
UPDATE genomic_sample_candidate_rel SET CandID=(SELECT ID from candidate c WHERE c.CandID=genomic_sample_candidate_rel.CandID); | ||
ALTER TABLE genomic_sample_candidate_rel CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE genomic_sample_candidate_rel ADD CONSTRAINT `genomic_sample_candidate_rel_ibfk_1` FOREIGN KEY (CandidateID) REFERENCES `candidate`(`ID`); | ||
|
||
ALTER TABLE SNP_candidate_rel DROP CONSTRAINT `fk_SNP_candidate_rel_2`; | ||
UPDATE SNP_candidate_rel SET CandID=(SELECT ID from candidate c WHERE c.CandID=SNP_candidate_rel.CandID); | ||
ALTER TABLE SNP_candidate_rel CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE SNP_candidate_rel ADD CONSTRAINT `fk_SNP_candidate_rel_2` FOREIGN KEY (CandidateID) REFERENCES candidate(ID) ON DELETE NO ACTION ON UPDATE NO ACTION; | ||
|
||
ALTER TABLE parameter_candidate DROP CONSTRAINT `FK_parameter_candidate_2`; | ||
UPDATE parameter_candidate SET CandID=(SELECT ID from candidate c WHERE c.CandID=parameter_candidate.CandID); | ||
ALTER TABLE parameter_candidate CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE parameter_candidate ADD CONSTRAINT FK_parameter_candidate_2 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
ALTER TABLE candidate_diagnosis_evolution_rel DROP CONSTRAINT `PK_candidate_diagnosis_evolution_rel`; | ||
ALTER TABLE candidate_diagnosis_evolution_rel DROP CONSTRAINT `FK_candidate_diagnosis_evolution_rel_CandID`; | ||
UPDATE candidate_diagnosis_evolution_rel SET CandID=(SELECT ID from candidate c WHERE c.CandID=candidate_diagnosis_evolution_rel.CandID); | ||
ALTER TABLE candidate_diagnosis_evolution_rel CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE candidate_diagnosis_evolution_rel ADD CONSTRAINT PK_candidate_diagnosis_evolution_rel PRIMARY KEY (CandidateID, DxEvolutionID); | ||
ALTER TABLE candidate_diagnosis_evolution_rel ADD CONSTRAINT FK_candidate_diagnosis_evolution_rel_CandID FOREIGN KEY (CandidateID) REFERENCES candidate(ID) ON DELETE RESTRICT ON UPDATE RESTRICT; | ||
|
||
|
||
-- Changes references to candidate.CandID that were NOT FK. Add FK | ||
UPDATE feedback_bvl_thread SET CandID=(SELECT ID from candidate c WHERE c.CandID=feedback_bvl_thread.CandID); | ||
ALTER TABLE feedback_bvl_thread CHANGE CandID CandidateID int(10) unsigned DEFAULT NULL; | ||
ALTER TABLE feedback_bvl_thread ADD CONSTRAINT FK_feedback_bvl_thread_candidate_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
UPDATE mri_violations_log SET CandID=(SELECT ID from candidate c WHERE c.CandID=mri_violations_log.CandID); | ||
ALTER TABLE mri_violations_log CHANGE CandID CandidateID int(10) unsigned DEFAULT NULL; | ||
ALTER TABLE mri_violations_log ADD CONSTRAINT FK_mri_violations_log_candidate_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
UPDATE mri_protocol_violated_scans SET CandID=(SELECT ID from candidate c WHERE c.CandID=mri_protocol_violated_scans.CandID); | ||
ALTER TABLE mri_protocol_violated_scans CHANGE CandID CandidateID int(10) unsigned; | ||
ALTER TABLE mri_protocol_violated_scans ADD CONSTRAINT FK_mri_protocol_violated_scans_candidate_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
UPDATE participant_status_history SET CandID=(SELECT ID from candidate c WHERE c.CandID=participant_status_history.CandID); | ||
ALTER TABLE participant_status_history CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE participant_status_history ADD CONSTRAINT FK_participant_status_history_candidate_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
UPDATE family SET CandID=(SELECT ID from candidate c WHERE c.CandID=family.CandID); | ||
ALTER TABLE family CHANGE CandID CandidateID int(10) unsigned NOT NULL; | ||
ALTER TABLE family ADD CONSTRAINT FK_family_candidate_1 FOREIGN KEY (CandidateID) REFERENCES candidate(ID); | ||
|
||
|
||
-- Change candidate's PK to ID | ||
ALTER TABLE candidate DROP PRIMARY KEY, ADD PRIMARY KEY(ID); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.