@@ -396,9 +396,8 @@ function answers_table($completion_id) {
396396 /**************************************************************************
397397 * FUNCTION: Builds a SOAP note using the user's answers and question config.
398398 **************************************************************************/
399- function soap_note ($ completion_id , $ _result ) {
399+ function soap_note ($ completion_id , $ result ) {
400400 global $ wpdb ;
401- $ result = $ _result ;
402401 $ _question = new ChainedQuizQuestion ();
403402 $ debug_mode = get_option ('chained_debug_mode ' );
404403 $ output = '' ;
@@ -455,7 +454,7 @@ function soap_note($completion_id, $_result) {
455454 }
456455
457456 // Add the description for the Algorithm Result.
458- if ($ result ->description ) {
457+ if (isset ( $ result ) && $ result ->description ) {
459458 $ output .= '<li> ' . $ result ->description . '</li> ' ;
460459 $ count ++;
461460 }
@@ -503,7 +502,7 @@ function soap_note($completion_id, $_result) {
503502 }
504503
505504 // Add the subjective note for the Algorithm Result.
506- if ($ result ->subjective ) {
505+ if (isset ( $ result ) && $ result ->subjective ) {
507506 $ output .= '<li> ' . $ result ->subjective . '</li> ' ;
508507 $ count ++;
509508 }
@@ -552,7 +551,7 @@ function soap_note($completion_id, $_result) {
552551 }
553552
554553 // Add the objective note for the Algorithm Result.
555- if ($ result ->objective ) {
554+ if (isset ( $ result ) && $ result ->objective ) {
556555 $ output .= '<li> ' . $ result ->objective . '</li> ' ;
557556 $ count ++;
558557 }
@@ -572,9 +571,11 @@ function soap_note($completion_id, $_result) {
572571 }
573572
574573 // Add the assessment and plan for the Algorithm Result.
575- if ($ result ->assessment || $ result ->plan ) {
576- $ user_answer .= '<tr><td width="50%"> ' .$ result ->assessment .'</td><td width="50%"> ' .$ result ->plan .'</td></tr> ' ;
577- $ count ++;
574+ if (isset ($ result )) {
575+ if ($ result ->assessment || $ result ->plan ) {
576+ $ user_answer .= '<tr><td width="50%"> ' .$ result ->assessment .'</td><td width="50%"> ' .$ result ->plan .'</td></tr> ' ;
577+ $ count ++;
578+ }
578579 }
579580
580581 $ output .= $ count == 0 ? '<tr><td width="50%">None (N/A)</td><td width="50%">None (N/A)</td></tr> ' : $ user_answer ;
0 commit comments