Skip to content

Commit a3809ae

Browse files
Jkatdriusan
authored andcommitted
[Final Radiological Reivew] Error handling of 'radiology_review' instrument (aces#2694)
Add better error handling for radiology_review instrument being missing in the final_radiological_review module.
1 parent e7dfb8e commit a3809ae

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

modules/final_radiological_review/php/NDB_Form_final_radiological_review.class.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class NDB_Form_final_radiological_review extends NDB_Form
139139
* information from the final_radiological_review table for
140140
* smarty
141141
*
142+
* @throws LorisException
142143
* @return array defaults for smarty to use
143144
*/
144145
function _getDefaults()
@@ -171,6 +172,13 @@ class NDB_Form_final_radiological_review extends NDB_Form
171172
);
172173
}
173174

175+
if ($DB->tableExists('radiology_review') === false) {
176+
throw new LorisException(
177+
"Table 'radiology_review' does not exist."
178+
. " Please have this instrument set up in order to use this module properly."
179+
);
180+
}
181+
174182
$original_review = $DB->pselectRow(
175183
"SELECT r.Scan_done as Original_Scan_Done,
176184
r.review_results as Original_Review_Results,

modules/final_radiological_review/php/NDB_Menu_Filter_final_radiological_review.class.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ class NDB_Menu_Filter_final_radiological_review extends NDB_Menu_Filter
139139
WHEN r.PVS <> r.PVS2 THEN 'prim_second'
140140
ELSE 'false' END)";
141141

142+
$DB = Database::singleton();
143+
if ($DB->tableExists('radiology_review') === false) {
144+
throw new LorisException(
145+
"Table 'radiology_review' does not exist."
146+
. " Please have this instrument set up in order to use this module properly."
147+
);
148+
}
149+
142150
$this->query = " FROM radiology_review orig
143151
LEFT JOIN final_radiological_review r ON (r.CommentID=orig.CommentID)
144152
JOIN flag f ON (f.CommentID=orig.CommentID)

0 commit comments

Comments
 (0)