Skip to content

Commit e362016

Browse files
committed
Version 2.0.2
1 parent ad9847d commit e362016

14 files changed

Lines changed: 381 additions & 290 deletions

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 65 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,55 @@
11
# Triage Algorithm
2-
Contributors: Melvin Tan, Taylor Martin
3-
Tags: triage, algorithm, decision support, quiz, exam, test, questionnaire, survey
4-
Requires at least: 3.3
5-
Tested up to: 5.0
2+
Contributors: innershell
3+
Tags: triage, form, forms, custom form, form builder, survey, survey builder, questionnaire, questionnaire builder, quiz, quiz builder, exam, exam builder, test, test builder, planner, planning, screening
4+
Requires at least: 5.0
5+
Tested up to: 5.1.1
6+
Requires PHP: 7.2
67
Stable tag: trunk
7-
License: GPL2
8+
License: GPL2 or later
89

910
Create a triage algorithm that pre-screen a patient and generate a physician SOAP note for clinical decision support.
1011

11-
This program is free software: you can redistribute it and/or modify
12-
it under the terms of the GNU General Public License as published by
13-
the Free Software Foundation, either version 3 of the License, or
14-
(at your option) any later version.
15-
16-
This program is distributed in the hope that it will be useful,
17-
but WITHOUT ANY WARRANTY; without even the implied warranty of
18-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19-
GNU General Public License for more details.
20-
21-
You should have received a copy of the GNU General Public License
22-
along with this program. If not, see <http://www.gnu.org/licenses/>.
23-
2412
# Description
25-
This is an unique conditional logic plugin that lets you create set a questions whose answers generate a physician SOAP note.
13+
Design algorithms to screen and triage patients with chronic diseases at a medical facility. Questions are presented to the patient to gather information for their visit. The collected information are analyzed by the algorithm and presented to a clinician in the form of a medical assessment and/or treatment plan.
2614

2715
**To publish a triage algorithm, place its shortcode in a post or page.**
2816

2917
# Features
30-
#### Create unlimited number of triage algorithms
31-
This plugin has no limitations on the number of triage algorithms you can have.
18+
#### Create algorithms to ask questions
19+
- An unlimited number of algorithms and questions are supported.
20+
21+
#### Present questions in multiple formats
22+
- Generate user input forms by presenting single choice (radio buttons), multiple choice (checkboxes), single free text (textarea), or multiple free text (textarea) answers.
23+
24+
#### Decision tree modifies the algorithm in real-time
25+
- Define how the algorithm reacts based on intput to the question. Different paths are selected based on input received.
26+
27+
#### Analyze answers for clinical decision support
28+
- This is where the real magic happens. The algorithm processes answers for presentation to medical professionals in a clinical language and format. Provide the medical professional with an assessment of the patient and treatment plan for the patient.
29+
30+
#### Display dashboard of algorithm submissions
31+
- Present all submissions in a summary dashboard for presenter to review and provide feedback.
32+
33+
#### Export submission data to a CSV file
34+
- Extract raw data into an external file for a variety of offline uses.
3235

33-
#### Question types support: single-choice, multiple-choice, text
34-
The plugin will generate respectively a group of radio buttons, checkboxes, or a text area.
36+
# Installation
37+
1. Upload the plugin zip file to WordPress in the 'Plugins' section.
38+
..* Alternatively, unzip and upload the entire 'triage-algorithm' folder to the '/wp-content/plugins/' directory.
39+
2. Activate the plugin.
40+
3. Go to "Triage Algorithm" settings to manage the plugin and setup algorithms.
41+
4. Place the shortcode(s) in a post or page to publish the features.
42+
5. View the post or page to see the triage algorithm in action.
3543

36-
#### Define what to do when specific answer is chosen
37-
You can define to go to next question, go to a specific selected question, or finish the algorithm.
44+
**Attention Multi-Site (WP Network) Users!**
45+
- The plugin is perfectly compatible with multi-site installations but it should be activated as **blog admin** and NOT as superadmin.
3846

39-
#### Export user's answers to a CSV file - with or without details
40-
The CSV file can be used to analyze user results in Excel, import it in a database and so on.
47+
# Upgrading
48+
1. Backup your data.
49+
2. Deactivate the plugin.
50+
3. Delete the plugin (Note: Your data will NOT be deleted);
51+
4. Follow the installation steps above to install the new plugin.
52+
5. Make sure to activate the pluging.
4153

4254
# Getting Started
4355
Once activated the plugin go to Triage Algorithm -> Algorithms in your WP dashboard and create your first algorithm. After entering the algorithm title, description and other settings you will be redirected to create the algorithm results / outcomes.
@@ -48,29 +60,35 @@ After you create your results you will be redirected to creating the actual ques
4860

4961
Don't forget that the algorithm must be **published** before it becomes accessible. Publishing happens when you manually place the shortcode of the algorithm in a post or page or select the option "Automatically publish" when you save it.
5062

51-
**Attention Multi-Site (WP Network) Users!**
52-
The plugin is perfectly compatible with multi-site installations but it should be activated as **blog admin** and NOT as superadmin.
53-
54-
# Installation
55-
1. Unzip the contents and upload the entire `triage-algorithm` directory to the `/wp-content/plugins/` directory
56-
2. Activate the plugin through the 'Plugins' menu in WordPress
57-
3. Go to "Triage Algorithm" in your menu and manage the plugin
58-
4. To publish an algorithm place its shortcode in a post or page
59-
6063
# Frequently Asked Questions
6164
None yet.
6265

6366
# Screenshots
64-
1. The create / edit algorithm form lets you give a title and specify the dynamic end output
65-
2. Here is how the different choices can be connected to different outcomes (plus assigning points at the same time)
66-
3. And of course you can define different results depending on the results collected in the quiz
67+
1. Creating a triage algorithm question.
68+
2. How the triage algorithm is displayed.
69+
3. The SOAP note processed by the triage algorithm for clinical decision support.
70+
4. The submissions dashboard to capture feedback for machine learning.
6771

6872
# Changelog
69-
## Version 2.0.1
70-
- Bug fixes.
71-
72-
## Version 2.0
73-
- Added Dashboard functionality.
74-
75-
## Version 1.0
76-
- First public release of a triage algorithm.
73+
## 2.0.2 (Bug Fix)
74+
- Emails to Admin when submissions received not working.
75+
- Text fields not required allowing patients to submit blank answers.
76+
- Fixed plugin activation error.
77+
- Fixed plugin cannot be upgraded by deleting/uploading new ZIP file.
78+
79+
## 2.0.1 (Bug Fix)
80+
- Submissions dashboard had no clickable link to open SOAP note when user did not provide a Study ID.
81+
- SOAP note not saved properly. Submissions dashboard did not display SOAP note.
82+
- Submissions dashboard cannot filter results for specific triage algorithms.
83+
- Submissions (WordPress admin mode) did not display text answers. Displayed answer ID instead.
84+
85+
## 2.0 (Dashboard)
86+
- Dashboard to review triage algorithm submissions.
87+
- Use shortcodes to publish the submissions dashboard.
88+
89+
## 1.0 (Triage Algorithm)
90+
- Create triage algorithms with unlimited questions and answers.
91+
- Use shortcodes to publish algorithms.
92+
- Present algorithm questionnaires and save results.
93+
- Generate SOAP note for clinical decision support.
94+
- E-mail or fax SOAP notes to an external destination.

controllers/completed.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,16 @@ static function define_dir($col, $ob, $dir) {
274274

275275
// Captures feedback for a triage algorithm post-submission.
276276
static function feedback($comment) {
277-
$user_email = 'melvin@windwake.io';
277+
$admin_email = chained_admin_email();
278+
$sender_email = chained_sender_email();
278279
$subject = 'Triage Algorithm Feedback';
279280
$message = $comment;
280281
$headers = 'MIME-Version: 1.0' . "\r\n";
281282
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
282-
$headers .= 'From: ' . $user_email . "\r\n";
283+
$headers .= 'From: ' . $sender_email . "\r\n";
283284
$attachments = null;
284285

285-
wp_mail($user_email, $subject, $message, $headers, $attachments);
286+
wp_mail($admin_email, $subject, $message, $headers, $attachments);
286287
echo json_encode(array("abc"=>'Email succesful.'));
287288
}
288289
}

helpers/htmlhelper.php

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@ function chained_redirect($url) {
66
exit;
77
}
88

9-
// function to conditionally add DB fields
10-
function chainedquiz_add_db_fields($fields, $table) {
11-
global $wpdb;
12-
13-
// check fields
14-
$table_fields = $wpdb->get_results("SHOW COLUMNS FROM `$table`");
15-
$table_field_names = array();
16-
foreach($table_fields as $f) $table_field_names[] = $f->Field;
17-
$fields_to_add=array();
18-
19-
foreach($fields as $field) {
20-
if(!in_array($field['name'], $table_field_names)) {
21-
$fields_to_add[] = $field;
22-
}
23-
}
24-
25-
// now if there are fields to add, run the query
26-
if(!empty($fields_to_add)) {
27-
$sql = "ALTER TABLE `$table` ";
28-
29-
foreach($fields_to_add as $cnt => $field) {
30-
if($cnt > 0) $sql .= ", ";
31-
$sql .= "ADD $field[name] $field[type]";
32-
}
33-
34-
$wpdb->query($sql);
35-
}
9+
// function to conditionally add DB fields
10+
function chainedquiz_add_db_fields($fields, $table) {
11+
global $wpdb;
12+
13+
// check fields
14+
$table_fields = $wpdb->get_results("SHOW COLUMNS FROM `$table`");
15+
$table_field_names = array();
16+
foreach($table_fields as $f) $table_field_names[] = $f->Field;
17+
$fields_to_add=array();
18+
19+
foreach($fields as $field) {
20+
if(!in_array($field['name'], $table_field_names)) {
21+
$fields_to_add[] = $field;
22+
}
23+
}
24+
25+
// now if there are fields to add, run the query
26+
if(!empty($fields_to_add)) {
27+
$sql = "ALTER TABLE `$table` ";
28+
29+
foreach($fields_to_add as $cnt => $field) {
30+
if($cnt > 0) $sql .= ", ";
31+
$sql .= "ADD $field[name] $field[type]";
32+
}
33+
34+
$wpdb->query($sql);
35+
}
3636
}
3737

3838
// define new line for CSVs
@@ -77,13 +77,21 @@ function kiboko_get_mime_type() {
7777
}
7878
}
7979

80-
// get admin email. This overwrites the global setting with the watupro's setting.
80+
// Get admin email. If not setup, use WordPress admin email.
8181
function chained_admin_email() {
82-
$admin_email = stripslashes(get_option('chained_sender_name')) . ' <' . get_option('chained_sender_email') . '>';
83-
82+
$admin_email = stripslashes(get_option('chained_admin_emails'));
83+
if ($admin_email == '') {
84+
$admin_email = 'WordPress Admin <' . stripslashes(get_option('admin_email')) . '>';
85+
}
8486
return $admin_email;
8587
}
8688

89+
// Get sender email. If not setup, use WordPress admin email.
90+
function chained_sender_email() {
91+
$sender_email = stripslashes(get_option('chained_sender_name')) . ' <' . get_option('chained_sender_email') . '>';
92+
return $sender_email;
93+
}
94+
8795
function chained_strip_tags($content) {
8896
if(!current_user_can('unfiltered_html') and WATUPRO_UNFILTERED_HTML != 1) {
8997
$content = strip_tags($content, '<b><i><em><u><a><p><br><div><span><hr><font><img><strong>');

js/common.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@ chainedQuiz.goon = function(quizID, url) {
2121
}
2222

2323
// is textarea filled?
24-
if((qType == 'text') && jQuery('#chained-quiz-form-' + quizID + ' textarea[name=answer_text]').val() == '') {
24+
25+
/* THIS WAS THE ORIGINAL JAVASCRIPT CODE TO VALIDATE EMPTY TEXT FIELDS. */
26+
/* if((qType == 'text') && jQuery('#chained-quiz-form-' + quizID + ' textarea[name=answer_texts]').val() == '') {
27+
alert(chained_i18n.please_answer);
28+
jQuery('#chained-quiz-action-' + quizID).removeAttr('disabled');
29+
return false;
30+
} */
31+
32+
var noText = false;
33+
jQuery('#chained-quiz-form-' + quizID + ' textarea').each(function() {
34+
if (this.value == '') noText = true; // If there is ANY blank text field, reject.
35+
});
36+
if(noText && qType == 'text') {
2537
alert(chained_i18n.please_answer);
2638
jQuery('#chained-quiz-action-' + quizID).removeAttr('disabled');
2739
return false;

0 commit comments

Comments
 (0)