Skip to content

Commit ef87bee

Browse files
committed
Fixed #4
1 parent 6eda58a commit ef87bee

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

models/basic.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static function install($update = false) {
5858
`quiz_id` INT UNSIGNED NOT NULL DEFAULT 0,
5959
`question_id` INT UNSIGNED NOT NULL DEFAULT 0,
6060
`choice` TEXT,
61+
`patient_note` TEXT,
6162
`provider_note` TEXT,
6263
`assessment` TEXT,
6364
`plan` TEXT,
@@ -151,6 +152,7 @@ static function install($update = false) {
151152
$wpdb->query("ALTER TABLE ".CHAINED_QUESTIONS." ADD COLUMN abort_enabled TINYINT NOT NULL DEFAULT 0 AFTER rank;");
152153
$wpdb->query("ALTER TABLE ".CHAINED_QUESTIONS." ADD COLUMN points_abort_min DECIMAL(8,2) NOT NULL DEFAULT '0.00' AFTER abort_enabled;");
153154
$wpdb->query("ALTER TABLE ".CHAINED_QUESTIONS." ADD COLUMN points_abort_max DECIMAL(8,2) NOT NULL DEFAULT '0.00' AFTER points_abort_min;");
155+
$wpdb->query("ALTER TABLE ".CHAINED_CHOICES." ADD COLUMN patient_note TEXT AFTER choice;");
154156
}
155157

156158
// Set the current plugin version number.

models/question.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ function save_choices($vars, $id) {
9898

9999
if(!current_user_can('unfiltered_html')) {
100100
$_POST['answer'.$choice->id] = strip_tags($_POST['answer'.$choice->id]);
101+
$_POST['patient_note'.$choice->id] = strip_tags($_POST['patient_note'.$choice->id]);
101102
$_POST['provider_note'.$choice->id] = strip_tags($_POST['provider_note'.$choice->id]);
102103
$_POST['assessment'.$choice->id] = strip_tags($_POST['assessment'.$choice->id]);
103104
$_POST['plan'.$choice->id] = strip_tags($_POST['plan'.$choice->id]);
@@ -108,9 +109,10 @@ function save_choices($vars, $id) {
108109

109110
// else update
110111
$wpdb->query($wpdb->prepare("UPDATE ".CHAINED_CHOICES." SET
111-
choice=%s, points=%s, provider_note=%s, assessment=%s, plan=%s, is_correct=%d, goto=%s WHERE id=%d",
112-
$_POST['answer'.$choice->id], $_POST['points'.$choice->id], $_POST['provider_note'.$choice->id], $_POST['assessment'.$choice->id], $_POST['plan'.$choice->id],
113-
intval(@$_POST['is_correct'.$choice->id]), $_POST['goto'.$choice->id], $choice->id));
112+
choice=%s, points=%s, patient_note=%s, provider_note=%s,
113+
assessment=%s, plan=%s, is_correct=%d, goto=%s WHERE id=%d",
114+
$_POST['answer'.$choice->id], $_POST['points'.$choice->id], $_POST['patient_note'.$choice->id], $_POST['provider_note'.$choice->id],
115+
$_POST['assessment'.$choice->id], $_POST['plan'.$choice->id], intval(@$_POST['is_correct'.$choice->id]), $_POST['goto'.$choice->id], $choice->id));
114116
}
115117

116118
// add new choices

views/choice.html.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
<div>
44
<div class="one-line">
55
<?php _e('Patient Answer:', 'chained')?><br>
6-
<textarea rows="3" cols="40" name="<?php echo empty($choice->id)?'answers[]':'answer'.$choice->id?>"><?php echo stripslashes(@$choice->choice)?></textarea>
6+
<textarea rows="1" cols="89" name="<?php echo empty($choice->id)?'answers[]':'answer'.$choice->id?>"><?php echo stripslashes(@$choice->choice)?></textarea>
7+
</div>
8+
</div>
9+
<div>
10+
<div class="one-line">
11+
<?php _e('Patient Note:', 'chained')?><br>
12+
<textarea rows="2" cols="40" name="<?php echo empty($choice->id)?'patient_notes[]':'patient_note'.$choice->id?>"><?php echo stripslashes(@$choice->patient_note)?></textarea>
713
</div>
814
<div class="one-line">
9-
<?php _e('Provider SOAP Note:', 'chained')?><br>
10-
<textarea rows="3" cols="40" name="<?php echo empty($choice->id)?'provider_notes[]':'provider_note'.$choice->id?>"><?php echo stripslashes(@$choice->provider_note)?></textarea>
15+
<?php _e('Provider Subject/Objective Note:', 'chained')?><br>
16+
<textarea rows="2" cols="40" name="<?php echo empty($choice->id)?'provider_notes[]':'provider_note'.$choice->id?>"><?php echo stripslashes(@$choice->provider_note)?></textarea>
1117
</div>
1218
</div>
1319
<div>

0 commit comments

Comments
 (0)