Skip to content

Commit 0f5c4c0

Browse files
committed
Version 3.0
1 parent e362016 commit 0f5c4c0

File tree

7 files changed

+24
-7
lines changed

7 files changed

+24
-7
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ None yet.
7070
4. The submissions dashboard to capture feedback for machine learning.
7171

7272
# Changelog
73+
## 3.0 (Algorithm Billing Codes)
74+
- Each algorithm can be given a billing code by free text to the email output portion of the algorithm setup.
75+
7376
## 2.0.2 (Bug Fix)
7477
- Emails to Admin when submissions received not working.
7578
- Text fields not required allowing patients to submit blank answers.

models/basic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static function install($update = false) {
178178
}
179179

180180
// Set the current plugin version number.
181-
update_option('chained_version', "2.2");
181+
update_option('chained_version', "3.0");
182182
// exit;
183183
}
184184

@@ -210,7 +210,7 @@ static function scripts() {
210210
'chained-common',
211211
CHAINED_URL.'js/common.js',
212212
false,
213-
'2.2',
213+
'3.0',
214214
false
215215
);
216216
wp_enqueue_script("chained-common");

models/quiz.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,31 @@ function finalize($quiz, $points) {
8888

8989
$_result = new ChainedQuizResult();
9090
// calculate result
91-
$result = $_result->calculate($quiz, $points);
91+
$result = $_result->calculate($output, $points);
9292

9393
// get final screen and replace vars
9494
$snapshot = ''; // The SOAP note data to be saved in the submission record snapshot.
9595
$output = stripslashes($quiz->output);
9696
$email_output = $quiz->set_email_output ? stripslashes($quiz->email_output) : $output;
9797

98+
/** THIS MAY BE REMOVED BECAUSE THE EMAIL OUTPUT IS USED FOR SNAPSHOT INSTEAD */
9899
$output = str_replace('{{result-title}}', @$result->title, $output);
99100
$output = str_replace('{{result-text}}', stripslashes(@$result->description), $output);
100101
$output = str_replace('{{points}}', $points, $output);
101102
$output = str_replace('{{questions}}', $_POST['total_questions'], $output);
102103

104+
// Find the first occurrence of the shortcode and replace with the HTML answers table.
103105
if(strstr($output, '{{answers-table}}')) {
104106
$snapshot = $this->answers_table($completion_id);
105107
$output = str_replace('{{answers-table}}', $snapshot, $output);
106108
}
107109

110+
// If there is now HTML answers table, then substitute it for the soap note instead.
108111
if ($snapshot == '') {
109112
$snapshot = $this->soap_note($completion_id);
110113
}
111114

115+
// Find the first occurrence of the shortcode and replace with the HTML SOAP note.
112116
if(strstr($output, '{{soap-note}}')) {
113117
$output = str_replace('{{soap-note}}', $snapshot, $output);
114118
}
@@ -118,10 +122,17 @@ function finalize($quiz, $points) {
118122
$email_output = str_replace('{{points}}', $points, $email_output);
119123
$email_output = str_replace('{{questions}}', $_POST['total_questions'], $email_output);
120124

125+
// Find the first occurrence of the shortcode and replace with the HTML answers table.
121126
if(strstr($email_output, '{{answers-table}}')) {
122127
$email_output = str_replace('{{answers-table}}', $this->answers_table($completion_id), $email_output);
123128
}
124129

130+
// If there is now HTML answers table, then substitute it for the soap note instead.
131+
if ($snapshot == '') {
132+
$snapshot = $this->soap_note($completion_id);
133+
}
134+
135+
// Find the first occurrence of the shortcode and replace with the HTML SOAP note.
125136
if(strstr($email_output, '{{soap-note}}')) {
126137
$email_output = str_replace('{{soap-note}}', $this->soap_note($completion_id), $email_output);
127138
}
@@ -169,7 +180,7 @@ function finalize($quiz, $points) {
169180
$wpdb->query( $wpdb->prepare("UPDATE ".CHAINED_COMPLETED." SET
170181
quiz_id = %d, points = %f, result_id = %d, datetime = NOW(), ip = %s, user_id = %d,
171182
snapshot = %s, source_url=%s, email=%s WHERE id=%d",
172-
$quiz->id, $points, @$result->id, $_SERVER['REMOTE_ADDR'], $user_id, $snapshot,
183+
$quiz->id, $points, @$result->id, $_SERVER['REMOTE_ADDR'], $user_id, $email_output,
173184
$source_url, $user_email, intval($_SESSION['chained_completion_id'])));
174185
$taking_id = $_SESSION['chained_completion_id'];
175186
unset($_SESSION['chained_completion_id']);
@@ -179,7 +190,7 @@ function finalize($quiz, $points) {
179190
$wpdb->query( $wpdb->prepare("INSERT INTO ".CHAINED_COMPLETED." SET
180191
quiz_id = %d, points = %f, result_id = %d, datetime = NOW(), ip = %s, user_id = %d, snapshot = %s,
181192
source_url=%s, email=%s",
182-
$quiz->id, $points, @$result->id, $_SERVER['REMOTE_ADDR'], $user_id, $snapshot, $source_url, $user_email));
193+
$quiz->id, $points, @$result->id, $_SERVER['REMOTE_ADDR'], $user_id, $email_output, $source_url, $user_email));
183194
$taking_id = $wpdb->insert_id;
184195
}
185196

readme upgrade to 2.2.txt renamed to readme upgrade to 3.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// These are the changes that need to be done when upgrading the plugin from 2.0.0 to 2.0.1.
1+
// These are the changes that need to be done when upgrading the plugin from 2.2 to 3.0.
22

33
Backup the chained_quiz plugin tables.
44

readme.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ None yet.
6363
1. The submissions dashboard to capture feedback for machine learning.
6464

6565
== Changelog ==
66+
= 3.0 (Algorithm Billing Codes) =
67+
- Each algorithm can be given a billing code by free text to the email output portion of the algorithm setup.
6668

6769
= 2.0.2 (Bug Fix) =
6870
- Emails to Admin when submissions received not working.

triage-algorithm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin URI: http://windwake.io
55
Description: Create a triage algorithm where questions are asked and answers translated into clinical decision support information.
66
Author: WindWake Healthcare Technologies LLC
7-
Version: 2.2
7+
Version: 3.0
88
Author URI: http://windwake.io
99
License: GPLv2 or later
1010
Text domain: chained

views/sidebar.html.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<p><?php _e('Version: 2.0 introduces a Submissions Dashboard.', 'chained');?> </p>
55
<p><?php _e('Version: 2.1 fixed bugs.', 'chained');?> </p>
66
<p><?php _e('Version: 2.2 fixed bugs.', 'chained');?> </p>
7+
<p><?php _e('Version: 3.0 introduces billing codes.', 'chained');?> </p>
78
</div>
89

910

0 commit comments

Comments
 (0)