From 2f7b2534a332758f8835fcf47b5090b79f69a424 Mon Sep 17 00:00:00 2001 From: naina Date: Wed, 9 Jan 2013 12:20:49 +0530 Subject: [PATCH] Added 3 forms (Aftercare Plan, Transfer Summary, Treatment Plan) --- interface/forms/aftercare_plan/info.txt | 1 + interface/forms/aftercare_plan/new.php | 193 ++++++++++++++++++++++++++ interface/forms/aftercare_plan/report.php | 48 +++++++ interface/forms/aftercare_plan/save.php | 68 ++++++++++ interface/forms/aftercare_plan/table.sql | 27 ++++ interface/forms/aftercare_plan/view.php | 3 + interface/forms/transfer_summary/info.txt | 1 + interface/forms/transfer_summary/new.php | 161 ++++++++++++++++++++++ interface/forms/transfer_summary/report.php | 49 +++++++ interface/forms/transfer_summary/save.php | 66 +++++++++ interface/forms/transfer_summary/table.sql | 23 ++++ interface/forms/transfer_summary/view.php | 3 + interface/forms/treatment_plan/info.txt | 1 + interface/forms/treatment_plan/new.php | 202 ++++++++++++++++++++++++++++ interface/forms/treatment_plan/report.php | 48 +++++++ interface/forms/treatment_plan/save.php | 69 ++++++++++ interface/forms/treatment_plan/table.sql | 25 ++++ interface/forms/treatment_plan/view.php | 3 + 18 files changed, 991 insertions(+) create mode 100644 interface/forms/aftercare_plan/info.txt create mode 100644 interface/forms/aftercare_plan/new.php create mode 100644 interface/forms/aftercare_plan/report.php create mode 100644 interface/forms/aftercare_plan/save.php create mode 100644 interface/forms/aftercare_plan/table.sql create mode 100644 interface/forms/aftercare_plan/view.php create mode 100644 interface/forms/transfer_summary/info.txt create mode 100644 interface/forms/transfer_summary/new.php create mode 100644 interface/forms/transfer_summary/report.php create mode 100644 interface/forms/transfer_summary/save.php create mode 100644 interface/forms/transfer_summary/table.sql create mode 100644 interface/forms/transfer_summary/view.php create mode 100644 interface/forms/treatment_plan/info.txt create mode 100644 interface/forms/treatment_plan/new.php create mode 100644 interface/forms/treatment_plan/report.php create mode 100644 interface/forms/treatment_plan/save.php create mode 100644 interface/forms/treatment_plan/table.sql create mode 100644 interface/forms/treatment_plan/view.php diff --git a/interface/forms/aftercare_plan/info.txt b/interface/forms/aftercare_plan/info.txt new file mode 100644 index 000000000..6e482a24d --- /dev/null +++ b/interface/forms/aftercare_plan/info.txt @@ -0,0 +1 @@ +Aftercare Plan \ No newline at end of file diff --git a/interface/forms/aftercare_plan/new.php b/interface/forms/aftercare_plan/new.php new file mode 100644 index 000000000..960af034c --- /dev/null +++ b/interface/forms/aftercare_plan/new.php @@ -0,0 +1,193 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + +//SANITIZE ALL ESCAPES +$sanitize_all_escapes=true; + +//STOP FAKE REGISTER GLOBALS +$fake_register_globals=false; + +include_once("../../globals.php"); +include_once("$srcdir/api.inc"); +require_once("$srcdir/patient.inc"); +require_once("$srcdir/options.inc.php"); +require_once("$srcdir/htmlspecialchars.inc.php"); +formHeader("Form:AfterCare Planning"); +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +$formid = 0 + (isset($_GET['id']) ? $_GET['id'] : ''); +$obj = $formid ? formFetch("form_aftercare_plan", $formid) : array(); + +?> + + + + + + + + + + + + + + +

+
+\n"; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
: + + + : + + +
: + ; + value='' + title='' + onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' /> + [?]'> + : + ; + value='' + title='' + onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' /> + [?]'> +
: 
1.
2.
3.
: 
1.
2.
: 
1.
2.
' class="button-css">  +  + ' + onclick="top.restoreSession();location=''" />
+ + + diff --git a/interface/forms/aftercare_plan/report.php b/interface/forms/aftercare_plan/report.php new file mode 100644 index 000000000..0c0de1582 --- /dev/null +++ b/interface/forms/aftercare_plan/report.php @@ -0,0 +1,48 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + +include_once("../../globals.php"); +include_once($GLOBALS["srcdir"]."/api.inc"); +function aftercare_plan_report( $pid, $encounter, $cols, $id) { +$count = 0; +$data = formFetch("form_aftercare_plan", $id); +if ($data) { +print ""; +foreach($data as $key => $value) { +if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") { + continue; +} +if ($value == "on") { +$value = "yes"; +} +$key=ucwords(str_replace("_"," ",$key)); +print ""; +$count++; +if ($count == $cols) { +$count = 0; +print "\n"; +} +} +} +print "
".xlt($key). ": ".text($value)."
"; +} +?> diff --git a/interface/forms/aftercare_plan/save.php b/interface/forms/aftercare_plan/save.php new file mode 100644 index 000000000..b513009d4 --- /dev/null +++ b/interface/forms/aftercare_plan/save.php @@ -0,0 +1,68 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + //SANITIZE ALL ESCAPES + $sanitize_all_escapes=$_POST['true']; + + //STOP FAKE REGISTER GLOBALS + $fake_register_globals=$_POST['false']; + +include_once("../../globals.php"); +include_once("$srcdir/api.inc"); +include_once("$srcdir/forms.inc"); +require_once("$srcdir/htmlspecialchars.inc.php"); +require_once("$srcdir/formdata.inc.php"); + +if (! $encounter) { // comes from globals.php + die(xl("Internal error: we do not seem to be in an encounter!")); +} +$id = 0 + (isset($_GET['id']) ? $_GET['id'] : ''); + +$sets = "pid = {$_SESSION["pid"]}, + groupname = '" . $_SESSION["authProvider"] . "', + user = '" . $_SESSION["authUser"] . "', + authorized = $userauthorized, activity=1, date = NOW(), + provider = '" . add_escape_custom(formData("provider")) . "', + client_name = '" . add_escape_custom(formData("client_name")) . "', + admit_date = '" . add_escape_custom(formData("admit_date")) . "', + discharged = '" . add_escape_custom(formData("discharged")) . "', + goal_a_acute_intoxication = '" . add_escape_custom(formData("goal_a_acute_intoxication")) . "', + goal_a_acute_intoxication_I = '" . add_escape_custom(formData("goal_a_acute_intoxication_I")) . "', + goal_a_acute_intoxication_II = '" . add_escape_custom(formData("goal_a_acute_intoxication_II")) . "', + goal_b_emotional_behavioral_conditions = '" . add_escape_custom(formData("goal_b_emotional_behavioral_conditions")) . "', + goal_b_emotional_behavioral_conditions_I = '" . add_escape_custom(formData("goal_b_emotional_behavioral_conditions_I")) . "', + goal_c_relapse_potential = '" . add_escape_custom(formData("goal_c_relapse_potential")) . "', + goal_c_relapse_potential_I = '" . add_escape_custom(formData("goal_c_relapse_potential_I")) . "'"; + + + if (empty($id)) { + $newid = sqlInsert("INSERT INTO form_aftercare_plan SET $sets"); + addForm($encounter, "Aftercare Plan", $newid, "aftercare_plan", $pid, $userauthorized); +} +else { + sqlStatement("UPDATE form_aftercare_plan SET $sets WHERE id = '". add_escape_custom("$id"). "'"); +} + +$_SESSION["encounter"] = htmlspecialchars($encounter); +formHeader("Redirecting...."); +formJump(); +formFooter(); +?> diff --git a/interface/forms/aftercare_plan/table.sql b/interface/forms/aftercare_plan/table.sql new file mode 100644 index 000000000..4ce7ec16c --- /dev/null +++ b/interface/forms/aftercare_plan/table.sql @@ -0,0 +1,27 @@ +-- +-- Table structure for table `form_aftercare_plan` +-- + +CREATE TABLE IF NOT EXISTS `form_aftercare_plan` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `date` datetime DEFAULT NULL, + `pid` bigint(20) DEFAULT NULL, + `user` varchar(255) DEFAULT NULL, + `provider` varchar(255) DEFAULT NULL, + `groupname` varchar(255) DEFAULT NULL, + `authorized` tinyint(4) DEFAULT NULL, + `activity` tinyint(4) DEFAULT NULL, + `client_name` varchar(255) DEFAULT NULL, + `admit_date` date DEFAULT NULL, + `discharged` date DEFAULT NULL, + `goal_a_acute_intoxication` text, + `goal_a_acute_intoxication_I` text, + `goal_a_acute_intoxication_II` text, + `goal_b_emotional_behavioral_conditions` text, + `goal_b_emotional_behavioral_conditions_I` text, + `goal_c_relapse_potential` text, + `goal_c_relapse_potential_I` text, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + diff --git a/interface/forms/aftercare_plan/view.php b/interface/forms/aftercare_plan/view.php new file mode 100644 index 000000000..49270798a --- /dev/null +++ b/interface/forms/aftercare_plan/view.php @@ -0,0 +1,3 @@ + diff --git a/interface/forms/transfer_summary/info.txt b/interface/forms/transfer_summary/info.txt new file mode 100644 index 000000000..7997771b2 --- /dev/null +++ b/interface/forms/transfer_summary/info.txt @@ -0,0 +1 @@ +Transfer Summary \ No newline at end of file diff --git a/interface/forms/transfer_summary/new.php b/interface/forms/transfer_summary/new.php new file mode 100644 index 000000000..c1003541a --- /dev/null +++ b/interface/forms/transfer_summary/new.php @@ -0,0 +1,161 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + +//SANITIZE ALL ESCAPES + $sanitize_all_escapes=true; + + //STOP FAKE REGISTER GLOBALS + $fake_register_globals=false; + +include_once("../../globals.php"); +include_once("$srcdir/api.inc"); +require_once("$srcdir/patient.inc"); +require_once("$srcdir/options.inc.php"); +formHeader("Form:Transfer Summary"); +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +$formid = 0 + (isset($_GET['id']) ? $_GET['id'] : ''); +$obj = $formid ? formFetch("form_transfer_summary", $formid) : array(); + +?> + + + + + + + + + + + + + + + +

+
+\n"; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
: + + + : + + +
: + ">: + ; + value='' + title='' + onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' /> + [?]'> +
:
:
:
:
' class="button-css">  +   + ' + onclick="top.restoreSession();location=''" /> + +
+ + + + diff --git a/interface/forms/transfer_summary/report.php b/interface/forms/transfer_summary/report.php new file mode 100644 index 000000000..b9e9a5340 --- /dev/null +++ b/interface/forms/transfer_summary/report.php @@ -0,0 +1,49 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + + +include_once("../../globals.php"); +include_once($GLOBALS["srcdir"]."/api.inc"); +function transfer_summary_report( $pid, $encounter, $cols, $id) { +$count = 0; +$data = formFetch("form_transfer_summary", $id); +if ($data) { +print ""; +foreach($data as $key => $value) { +if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") { + continue; +} +if ($value == "on") { +$value = "yes"; +} +$key=ucwords(str_replace("_"," ",$key)); +print ""; +$count++; +if ($count == $cols) { +$count = 0; +print "\n"; +} +} +} +print "
".xlt($key). ": ".text($value)."
"; +} +?> diff --git a/interface/forms/transfer_summary/save.php b/interface/forms/transfer_summary/save.php new file mode 100644 index 000000000..4d18420f4 --- /dev/null +++ b/interface/forms/transfer_summary/save.php @@ -0,0 +1,66 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + //SANITIZE ALL ESCAPES + $sanitize_all_escapes=$_POST['true']; + + //STOP FAKE REGISTER GLOBALS + $fake_register_globals=$_POST['false']; + +include_once("../../globals.php"); +include_once("$srcdir/api.inc"); +include_once("$srcdir/forms.inc"); + +if (! $encounter) { // comes from globals.php + die(xl("Internal error: we do not seem to be in an encounter!")); +} + + +$id = 0 + (isset($_GET['id']) ? $_GET['id'] : ''); + +$sets = "pid = {$_SESSION["pid"]}, + groupname = '" . $_SESSION["authProvider"] . "', + user = '" . $_SESSION["authUser"] . "', + authorized = $userauthorized, activity=1, date = NOW(), + provider = '" . add_escape_custom(formData("provider")) . "', + client_name = '" . add_escape_custom(formData("client_name")) . "', + transfer_to = '" . add_escape_custom(formData("transfer_to")) . "', + transfer_date = '" . add_escape_custom(formData("transfer_date")) . "', + status_of_admission = '" . add_escape_custom(formData("status_of_admission")) . "', + diagnosis = '" . add_escape_custom(formData("diagnosis")) . "', + intervention_provided = '" . add_escape_custom(formData("intervention_provided")) . "', + overall_status_of_discharge = '" . add_escape_custom(formData("overall_status_of_discharge")) ."'"; + + + if (empty($id)) { + $newid = sqlInsert("INSERT INTO form_transfer_summary SET $sets"); + addForm($encounter, "Transfer Summary", $newid, "transfer_summary", $pid, $userauthorized); +} +else { + sqlStatement("UPDATE form_transfer_summary SET $sets WHERE id = '". add_escape_custom("$id"). "'"); +} + +$_SESSION["encounter"] = htmlspecialchars($encounter); +formHeader("Redirecting...."); +formJump(); +formFooter(); +?> + diff --git a/interface/forms/transfer_summary/table.sql b/interface/forms/transfer_summary/table.sql new file mode 100644 index 000000000..782f0c7f3 --- /dev/null +++ b/interface/forms/transfer_summary/table.sql @@ -0,0 +1,23 @@ +-- +-- Table structure for table `form_transfer_summary` +-- + +CREATE TABLE IF NOT EXISTS `form_transfer_summary` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `date` datetime DEFAULT NULL, + `pid` bigint(20) DEFAULT NULL, + `user` varchar(255) DEFAULT NULL, + `groupname` varchar(255) DEFAULT NULL, + `authorized` tinyint(4) DEFAULT NULL, + `activity` tinyint(4) DEFAULT NULL, + `client_name` varchar(255) DEFAULT NULL, + `provider` varchar(255) DEFAULT NULL, + `transfer_to` varchar(255) DEFAULT NULL, + `transfer_date` date DEFAULT NULL, + `status_of_admission` text, + `diagnosis` text, + `intervention_provided` text, + `overall_status_of_discharge` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + diff --git a/interface/forms/transfer_summary/view.php b/interface/forms/transfer_summary/view.php new file mode 100644 index 000000000..49270798a --- /dev/null +++ b/interface/forms/transfer_summary/view.php @@ -0,0 +1,3 @@ + diff --git a/interface/forms/treatment_plan/info.txt b/interface/forms/treatment_plan/info.txt new file mode 100644 index 000000000..2c754fef7 --- /dev/null +++ b/interface/forms/treatment_plan/info.txt @@ -0,0 +1 @@ +Treatment Plan \ No newline at end of file diff --git a/interface/forms/treatment_plan/new.php b/interface/forms/treatment_plan/new.php new file mode 100644 index 000000000..53a376355 --- /dev/null +++ b/interface/forms/treatment_plan/new.php @@ -0,0 +1,202 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + +//SANITIZE ALL ESCAPES + $sanitize_all_escapes=true; + + //STOP FAKE REGISTER GLOBALS + $fake_register_globals=false; + +include_once("../../globals.php"); +include_once("$srcdir/api.inc"); +require_once("$srcdir/patient.inc"); +require_once("$srcdir/options.inc.php"); +formHeader("Form:Treatment Planning"); +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +$formid = 0 + (isset($_GET['id']) ? $_GET['id'] : ''); +$obj = $formid ? formFetch("form_treatment_plan", $formid) : array(); + + +// Get the providers list. + $ures = sqlStatement("SELECT id, username, fname, lname FROM users WHERE " . + "authorized != 0 AND active = 1 ORDER BY lname, fname"); +?> + + + + + + + + + + + + + +

+
+\n"; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
: + + + : + + +
: + + + : + ; + value='' + title='' + onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' /> + [?]'> +
: + "; + while ($urow = sqlFetchArray($ures)) { + echo " \n"; + } + echo ""; +?> +
+   +
:
:
:
:
:
:
:
' class="button-css">  +   + ' + onclick="top.restoreSession();location=''" />
+ + + diff --git a/interface/forms/treatment_plan/report.php b/interface/forms/treatment_plan/report.php new file mode 100644 index 000000000..f77f5f2cb --- /dev/null +++ b/interface/forms/treatment_plan/report.php @@ -0,0 +1,48 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + +include_once("../../globals.php"); +include_once($GLOBALS["srcdir"]."/api.inc"); +function treatment_plan_report( $pid, $encounter, $cols, $id) { +$count = 0; +$data = formFetch("form_treatment_plan", $id); +if ($data) { +print ""; +foreach($data as $key => $value) { +if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") { + continue; +} +if ($value == "on") { +$value = "yes"; +} +$key=ucwords(str_replace("_"," ",$key)); +print ""; +$count++; +if ($count == $cols) { +$count = 0; +print "\n"; +} +} +} +print "
".xlt($key). ": ".text($value)."
"; +} +?> diff --git a/interface/forms/treatment_plan/save.php b/interface/forms/treatment_plan/save.php new file mode 100644 index 000000000..f615743c9 --- /dev/null +++ b/interface/forms/treatment_plan/save.php @@ -0,0 +1,69 @@ + CapMinds Technologies + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Naina Mohamed + * @link http://www.open-emr.org + */ + + //SANITIZE ALL ESCAPES + $sanitize_all_escapes=$_POST['true']; + + //STOP FAKE REGISTER GLOBALS + $fake_register_globals=$_POST['false']; + +include_once("../../globals.php"); +include_once("$srcdir/api.inc"); +include_once("$srcdir/forms.inc"); + +if (! $encounter) { // comes from globals.php + die(xl("Internal error: we do not seem to be in an encounter!")); +} + +$id = 0 + (isset($_GET['id']) ? $_GET['id'] : ''); + +$sets = "pid = {$_SESSION["pid"]}, + groupname = '" . $_SESSION["authProvider"] . "', + user = '" . $_SESSION["authUser"] . "', + authorized = $userauthorized, activity=1, date = NOW(), + provider = '" . add_escape_custom(formData("provider")) . "', + client_name = '" . add_escape_custom(formData("client_name")) . "', + client_number = '" . add_escape_custom(formData("client_number")) . "', + admit_date = '" . add_escape_custom(formData("admit_date")) . "', + presenting_issues = '" . add_escape_custom(formData("presenting_issues")) . "', + patient_history = '" . add_escape_custom(formData("patient_history")) . "', + medications = '" . add_escape_custom(formData("medications")) . "', + anyother_relevant_information = '" . add_escape_custom(formData("anyother_relevant_information")) . "', + diagnosis = '" . add_escape_custom(formData("diagnosis")) . "', + treatment_received = '" . add_escape_custom(formData("treatment_received")) . "', + recommendation_for_follow_up = '" . add_escape_custom(formData("recommendation_for_follow_up")) . "'"; + + + + if (empty($id)) { + $newid = sqlInsert("INSERT INTO form_treatment_plan SET $sets"); + addForm($encounter, "Treatment Plan", $newid, "treatment_plan", $pid, $userauthorized); +} +else { + sqlStatement("UPDATE form_treatment_plan SET $sets WHERE id = '". add_escape_custom("$id"). "'"); +} + +$_SESSION["encounter"] = htmlspecialchars($encounter); +formHeader("Redirecting...."); +formJump(); +formFooter(); +?> + diff --git a/interface/forms/treatment_plan/table.sql b/interface/forms/treatment_plan/table.sql new file mode 100644 index 000000000..f115a5896 --- /dev/null +++ b/interface/forms/treatment_plan/table.sql @@ -0,0 +1,25 @@ +-- +-- Table structure for table `form_treatment_plan` +-- + +CREATE TABLE IF NOT EXISTS `form_treatment_plan` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `date` datetime DEFAULT NULL, + `pid` bigint(20) DEFAULT NULL, + `user` varchar(255) DEFAULT NULL, + `groupname` varchar(255) DEFAULT NULL, + `authorized` tinyint(4) DEFAULT NULL, + `activity` tinyint(4) DEFAULT NULL, + `client_name` varchar(255) DEFAULT NULL, + `client_number` bigint(20) DEFAULT NULL, + `provider` varchar(255) DEFAULT NULL, + `admit_date` varchar(255) DEFAULT NULL, + `presenting_issues` text, + `patient_history` text, + `medications` text, + `anyother_relevant_information` text, + `diagnosis` text, + `treatment_received` text, + `recommendation_for_follow_up` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; diff --git a/interface/forms/treatment_plan/view.php b/interface/forms/treatment_plan/view.php new file mode 100644 index 000000000..49270798a --- /dev/null +++ b/interface/forms/treatment_plan/view.php @@ -0,0 +1,3 @@ + -- 2.11.4.GIT