Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion modules/imaging_qc/php/imaging_qc.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Imaging_QC extends \NDB_Menu_Filter

$joins = " FROM flag f
JOIN session s ON (f.SessionID=s.ID)
JOIN test_names tn ON tn.ID = f.TestID
JOIN candidate c ON (s.CandID=c.CandID)
LEFT JOIN mri_parameter_form m ON (m.CommentID=f.CommentID)
LEFT JOIN tarchive t ON (t.SessionID=s.ID)
Expand All @@ -166,7 +167,7 @@ class Imaging_QC extends \NDB_Menu_Filter

$where = " WHERE 1=1
AND NOT f.CommentID LIKE 'DDE%'
AND f.Test_name='mri_parameter_form'
AND tn.Test_name='mri_parameter_form'
AND c.Active='Y'
AND s.Active='Y'
AND s.CenterID <> '1' ";
Expand Down
4 changes: 2 additions & 2 deletions modules/media/ajax/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ function getUploadFields()
// Select only candidates that have had visit at user's sites
$qparam = [];
$sessionQuery = "SELECT
c.PSCID, s.Visit_label, s.CenterID, f.Test_name, tn.Full_name
c.PSCID, s.Visit_label, s.CenterID, tn.Test_name, tn.Full_name
FROM candidate c
LEFT JOIN session s USING (CandID)
LEFT JOIN flag f ON (s.ID=f.SessionID)
LEFT JOIN test_names tn ON (f.Test_name=tn.Test_name)";
LEFT JOIN test_names tn ON (f.TestID=tn.ID)";

if (!$user->hasPermission('access_all_profiles')) {
$sessionQuery .= " WHERE FIND_IN_SET(s.CenterID, :cid) ORDER BY c.PSCID ASC";
Expand Down
8 changes: 5 additions & 3 deletions modules/statistics/php/statistics_mri_site.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ class Statistics_Mri_Site extends Statistics_Site
c.PSCID, s.ID as SessionID, s.CandID as CandID,
s.Visit_label
FROM flag f JOIN session s ON (f.SessionID=s.ID)
JOIN test_names tn ON tn.ID = f.TestID
LEFT JOIN mri_parameter_form m ON (m.CommentID=f.CommentID)
LEFT JOIN tarchive t ON (s.CandID=MID(t.PatientName, 9, 6)
AND MID(t.PatientName, 16, 7)=s.Visit_label)
LEFT JOIN candidate c ON (s.CandID=c.CandID)
$where
AND f.CommentID NOT LIKE 'DDE%'
AND f.Test_name='mri_parameter_form'
AND tn.Test_name='mri_parameter_form'
AND f.Administration <> 'None'
AND t.TarchiveID IS NULL
AND s.Active='Y'
Expand Down Expand Up @@ -171,8 +172,8 @@ class Statistics_Mri_Site extends Statistics_Site
s.Visit_label
FROM files LEFT JOIN session s ON (files.SessionID=s.ID)
LEFT JOIN flag f on
(f.SessionID=s.ID AND f.Test_name='mri_parameter_form'
AND f.CommentID NOT LIKE 'DDE%')
(f.SessionID=s.ID AND f.CommentID NOT LIKE 'DDE%')
LEFT JOIN test_names tn ON (tn.ID = f.TestID)
LEFT JOIN mri_parameter_form mpf
ON (mpf.CommentID=f.CommentID)
LEFT JOIN candidate c ON (c.CandID=s.CandID)
Expand All @@ -182,6 +183,7 @@ class Statistics_Mri_Site extends Statistics_Site
f.Data_entry <> 'Complete' OR
f.Data_entry IS NULL)
AND s.CenterID <> '1'
AND tn.Test_name = 'mri_parameter_form'
$this->query_criteria
ORDER BY c.PSCID";
break;
Expand Down
6 changes: 4 additions & 2 deletions modules/statistics/php/statistics_site.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class Statistics_Site extends \NDB_Menu
flag f
JOIN session s ON (s.ID=f.SessionID)
JOIN candidate c ON (c.CandID=s.CandID)
JOIN test_names tn ON tn.ID = f.TestID
WHERE
s.Active='Y' AND s.CenterID <> '1'
AND c.Active='Y'
Expand All @@ -205,7 +206,7 @@ class Statistics_Site extends \NDB_Menu
AND s.Current_stage <> 'Recycling Bin'
AND f.Administration='All'
AND f.CommentID NOT LIKE 'DDE%'
AND f.Test_name=:instrument",
AND tn.Test_name=:instrument",
['instrument' => $instrument, ...$this->query_vars]
);
return $count;
Expand Down Expand Up @@ -235,12 +236,13 @@ class Statistics_Site extends \NDB_Menu
s.Visit_label
FROM flag f
JOIN session s ON (s.ID=f.SessionID)
JOIN test_names tn ON tn.ID = f.TestID
JOIN candidate c ON (c.CandID=s.CandID)
WHERE s.Active='Y' AND c.Active='Y'
AND s.CenterID <> '1'
AND s.Current_stage <> 'Recycling Bin'
$this->query_criteria
AND f.Test_name=:instrument
AND tn.Test_name=:instrument
AND (f.Data_entry is NULL OR f.Data_entry<>'Complete')
AND f.CommentID NOT LIKE 'DDE%'
ORDER BY s.Visit_label, c.PSCID",
Expand Down
3 changes: 2 additions & 1 deletion modules/survey_accounts/ajax/ValidateEmailSubmitInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
}

$instrument_list = $db->pselect(
"SELECT f.Test_name FROM flag f
"SELECT tn.Test_name FROM flag f
JOIN session s on s.ID = f.SessionID
JOIN test_names tn ON tn.ID = f.TestID
WHERE s.CandID=:v_CandID
AND UPPER(s.Visit_label)=UPPER(:v_VL)
AND s.Active='Y'",
Expand Down
3 changes: 2 additions & 1 deletion modules/survey_accounts/php/addsurvey.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ class AddSurvey extends \NDB_Form
}

$instrument_list = $db->pselect(
"SELECT f.Test_name FROM flag f
"SELECT tn.Test_name FROM flag f
JOIN session s on s.ID = f.SessionID
JOIN test_names tn ON tn.ID = f.TestID
WHERE s.CandID=:v_CandID
AND UPPER(s.Visit_label)=UPPER(:v_VL)
AND s.Active='Y'",
Expand Down