From 89465782871025993e054babe907771c009cc75b Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Mon, 28 Nov 2005 20:33:11 +0000 Subject: [PATCH] added outcome and disposition to issues, removed from clinical notes --- contrib/forms/clinical_notes/new.php | 48 ++++++++----- contrib/forms/clinical_notes/report.php | 8 ++- contrib/forms/clinical_notes/table.sql | 6 +- contrib/forms/clinical_notes/view.php | 48 ++++++++----- interface/forms/newpatient/new.php | 2 +- interface/forms/newpatient/view.php | 2 +- interface/patient_file/problem_encounter.php | 2 +- interface/patient_file/summary/add_edit_issue.php | 88 +++++++++++++++++------ interface/patient_file/summary/stats_full.php | 2 +- sql/2_8_0-to-2_8_1_upgrade.sql | 7 ++ sql/database.sql | 32 +++++---- 11 files changed, 168 insertions(+), 77 deletions(-) diff --git a/contrib/forms/clinical_notes/new.php b/contrib/forms/clinical_notes/new.php index bdaa2a013..db6cdbb1c 100644 --- a/contrib/forms/clinical_notes/new.php +++ b/contrib/forms/clinical_notes/new.php @@ -77,10 +77,10 @@ if ($_POST['bn_save']) { "history = '" . $_POST['form_history'] . "', " . "examination = '" . $_POST['form_examination'] . "', " . "plan = '" . $_POST['form_plan'] . "', " . - "followup_required = " . cbvalue('fu_required') . ", " . - "followup_timing = '$fu_timing'" . ", " . - "outcome = " . rbvalue('outcome') . ", " . - "destination = " . rbvalue('destination') . " " . + "followup_required = " . rbvalue('fu_required') . ", " . + "followup_timing = '$fu_timing'" . " " . +// "outcome = " . rbvalue('outcome') . ", " . +// "destination = " . rbvalue('destination') . " " . "WHERE id = '$formid'"; sqlStatement($query); } @@ -89,16 +89,16 @@ if ($_POST['bn_save']) { // else { $query = "INSERT INTO form_clinical_notes ( " . - "history, examination, plan, followup_required, followup_timing, " . - "outcome, destination " . + "history, examination, plan, followup_required, followup_timing " . +// ",outcome, destination " . ") VALUES ( " . "'" . $_POST['form_history'] . "', " . "'" . $_POST['form_examination'] . "', " . "'" . $_POST['form_plan'] . "', " . - cbvalue('fu_required') . ", " . - "'$fu_timing'" . ", " . - rbvalue('outcome') . ", " . - rbvalue('destination') . " " . + rbvalue('fu_required') . ", " . + "'$fu_timing'" . " " . +// rbvalue('outcome') . ", " . +// rbvalue('destination') . " " . ")"; $newid = sqlInsert($query); addForm($encounter, "Clinical Notes", $newid, "clinical_notes", $pid, $userauthorized); @@ -162,7 +162,7 @@ if ($formid) { + + + + + +
- Required on:  + ' />
+ +
+ +
+ +

diff --git a/contrib/forms/clinical_notes/report.php b/contrib/forms/clinical_notes/report.php index 3b0db3bbd..a139aea39 100644 --- a/contrib/forms/clinical_notes/report.php +++ b/contrib/forms/clinical_notes/report.php @@ -25,8 +25,13 @@ function clinical_notes_report($pid, $encounter, $cols, $id) { } if ($key == 'followup_required') { - $value = 'Yes'; + switch ($value) { + case '1': $value = 'Yes'; break; + case '2': $value = 'Pending investigation'; break; + } } + + /**** else if ($key == 'outcome') { switch ($value) { case '1': $value = 'Resolved' ; break; @@ -41,6 +46,7 @@ function clinical_notes_report($pid, $encounter, $cols, $id) { case '2': $value = 'Hospital Specialist'; break; } } + ****/ $key=ucwords(str_replace("_"," ",$key)); print "$key: $value  \n"; diff --git a/contrib/forms/clinical_notes/table.sql b/contrib/forms/clinical_notes/table.sql index f823b8b86..175849fb6 100644 --- a/contrib/forms/clinical_notes/table.sql +++ b/contrib/forms/clinical_notes/table.sql @@ -6,14 +6,14 @@ CREATE TABLE IF NOT EXISTS form_clinical_notes ( examination text NOT NULL DEFAULT '', plan text NOT NULL DEFAULT '', - followup_required tinyint(1) NOT NULL DEFAULT 0, -- checkbox + followup_required int(11) NOT NULL DEFAULT 0, -- radio followup_timing varchar(255) NOT NULL DEFAULT '', -- resolved, improved, status quo, worse: - outcome int(11) NOT NULL DEFAULT 0, -- radio + -- outcome int(11) NOT NULL DEFAULT 0, -- radio -- gp, hospital specialist: - destination int(11) NOT NULL DEFAULT 0, -- radio + -- destination int(11) NOT NULL DEFAULT 0, -- radio PRIMARY KEY (id) ) TYPE=MyISAM; diff --git a/contrib/forms/clinical_notes/view.php b/contrib/forms/clinical_notes/view.php index bdaa2a013..db6cdbb1c 100644 --- a/contrib/forms/clinical_notes/view.php +++ b/contrib/forms/clinical_notes/view.php @@ -77,10 +77,10 @@ if ($_POST['bn_save']) { "history = '" . $_POST['form_history'] . "', " . "examination = '" . $_POST['form_examination'] . "', " . "plan = '" . $_POST['form_plan'] . "', " . - "followup_required = " . cbvalue('fu_required') . ", " . - "followup_timing = '$fu_timing'" . ", " . - "outcome = " . rbvalue('outcome') . ", " . - "destination = " . rbvalue('destination') . " " . + "followup_required = " . rbvalue('fu_required') . ", " . + "followup_timing = '$fu_timing'" . " " . +// "outcome = " . rbvalue('outcome') . ", " . +// "destination = " . rbvalue('destination') . " " . "WHERE id = '$formid'"; sqlStatement($query); } @@ -89,16 +89,16 @@ if ($_POST['bn_save']) { // else { $query = "INSERT INTO form_clinical_notes ( " . - "history, examination, plan, followup_required, followup_timing, " . - "outcome, destination " . + "history, examination, plan, followup_required, followup_timing " . +// ",outcome, destination " . ") VALUES ( " . "'" . $_POST['form_history'] . "', " . "'" . $_POST['form_examination'] . "', " . "'" . $_POST['form_plan'] . "', " . - cbvalue('fu_required') . ", " . - "'$fu_timing'" . ", " . - rbvalue('outcome') . ", " . - rbvalue('destination') . " " . + rbvalue('fu_required') . ", " . + "'$fu_timing'" . " " . +// rbvalue('outcome') . ", " . +// rbvalue('destination') . " " . ")"; $newid = sqlInsert($query); addForm($encounter, "Clinical Notes", $newid, "clinical_notes", $pid, $userauthorized); @@ -162,7 +162,7 @@ if ($formid) { + + + + + +
- Required on:  + ' />
+ +
+ +
+ +

diff --git a/interface/forms/newpatient/new.php b/interface/forms/newpatient/new.php index 56c784728..9a7028f1d 100644 --- a/interface/forms/newpatient/new.php +++ b/interface/forms/newpatient/new.php @@ -49,7 +49,7 @@ // Process click on issue title. function newissue() { - dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 500, 450); + dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 600, 475); return false; } diff --git a/interface/forms/newpatient/view.php b/interface/forms/newpatient/view.php index 0dae27061..7688e00d9 100644 --- a/interface/forms/newpatient/view.php +++ b/interface/forms/newpatient/view.php @@ -52,7 +52,7 @@ // Process click on issue title. function newissue() { - dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 500, 450); + dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 600, 475); return false; } diff --git a/interface/patient_file/problem_encounter.php b/interface/patient_file/problem_encounter.php index e6ebce921..92e648cb1 100644 --- a/interface/patient_file/problem_encounter.php +++ b/interface/patient_file/problem_encounter.php @@ -108,7 +108,7 @@ function refreshIssue(issue, title) { function newIssue() { var f = document.forms[0]; var tmp = (keyid && f.form_key[1].checked) ? ('?enclink=' + keyid) : ''; - dlgopen('summary/add_edit_issue.php' + tmp, '_blank', 500, 450); + dlgopen('summary/add_edit_issue.php' + tmp, '_blank', 600, 475); } // New Encounter button is clicked. diff --git a/interface/patient_file/summary/add_edit_issue.php b/interface/patient_file/summary/add_edit_issue.php index 6d9d6b212..12953ad03 100644 --- a/interface/patient_file/summary/add_edit_issue.php +++ b/interface/patient_file/summary/add_edit_issue.php @@ -1,4 +1,4 @@ - // // This program is free software; you can redistribute it and/or @@ -36,6 +36,20 @@ return "NULL"; } + function rbinput($name, $value, $desc, $colname) { + global $irow; + $ret = " @@ -56,7 +70,7 @@ td { font-size:10pt; } var mypcc = ''; var aopts = new Array(); - > - Type: - - $value) { echo "

diff --git a/interface/patient_file/summary/stats_full.php b/interface/patient_file/summary/stats_full.php index c57ea2c61..a699b48f6 100644 --- a/interface/patient_file/summary/stats_full.php +++ b/interface/patient_file/summary/stats_full.php @@ -55,7 +55,7 @@ function refreshIssue(issue, title) { // Process click on issue title. function dopclick(id) { - dlgopen('add_edit_issue.php?issue=' + id, '_blank', 500, 450); + dlgopen('add_edit_issue.php?issue=' + id, '_blank', 600, 475); } // Process click on number of encounters. diff --git a/sql/2_8_0-to-2_8_1_upgrade.sql b/sql/2_8_0-to-2_8_1_upgrade.sql index 50f80dba3..a3788797c 100644 --- a/sql/2_8_0-to-2_8_1_upgrade.sql +++ b/sql/2_8_0-to-2_8_1_upgrade.sql @@ -55,3 +55,10 @@ CREATE TABLE IF NOT EXISTS `lang_languages` ( INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES (1, 'en', 'English'); INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES (2, 'se', 'Swedish'); INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES (3, 'es', 'Spanish'); + +ALTER TABLE lists + ADD outcome int(11) NOT NULL DEFAULT 0, + ADD destination varchar(255) DEFAULT NULL; + +ALTER TABLE form_clinical_notes + MODIFY followup_required int(11) NOT NULL DEFAULT 0; diff --git a/sql/database.sql b/sql/database.sql index fb2b112d4..6ea39c3c8 100644 --- a/sql/database.sql +++ b/sql/database.sql @@ -26947,21 +26947,23 @@ CREATE TABLE `integration_mapping` ( DROP TABLE IF EXISTS `lists`; CREATE TABLE `lists` ( - `id` bigint(20) NOT NULL auto_increment, - `date` datetime default NULL, - `type` varchar(255) default NULL, - `title` varchar(255) default NULL, - begdate date DEFAULT NULL, - enddate date DEFAULT NULL, - occurrence int(11) DEFAULT 0, - referredby varchar(255) DEFAULT NULL, - extrainfo varchar(255) DEFAULT NULL, - diagnosis varchar(255) NOT NULL DEFAULT '', - `activity` tinyint(4) default NULL, - `comments` longtext , - `pid` bigint(20) default NULL, - `user` varchar(255) default NULL, - `groupname` varchar(255) default NULL, + `id` bigint(20) NOT NULL auto_increment, + `date` datetime DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + begdate date DEFAULT NULL, + enddate date DEFAULT NULL, + occurrence int(11) DEFAULT 0, + referredby varchar(255) DEFAULT NULL, + extrainfo varchar(255) DEFAULT NULL, + diagnosis varchar(255) NOT NULL DEFAULT '', + `activity` tinyint(4) DEFAULT NULL, + `comments` longtext , + `pid` bigint(20) DEFAULT NULL, + `user` varchar(255) DEFAULT NULL, + `groupname` varchar(255) DEFAULT NULL, + `outcome` int(11) NOT NULL DEFAULT 0, + `destination` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ; -- 2.11.4.GIT