7 * @link http://www.open-emr.org
8 * @author Naina Mohamed <naina@capminds.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2012-2013 Naina Mohamed <naina@capminds.com> CapMinds Technologies
11 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once(__DIR__
. "/../../globals.php");
16 require_once("$srcdir/api.inc.php");
17 require_once("$srcdir/forms.inc.php");
19 use OpenEMR\Common\Csrf\CsrfUtils
;
21 if (!CsrfUtils
::verifyCsrfToken($_POST["csrf_token_form"])) {
22 CsrfUtils
::csrfNotVerified();
25 if (!$encounter) { // comes from globals.php
26 die(xlt("Internal error: we do not seem to be in an encounter!"));
29 $id = (int) (isset($_GET['id']) ?
$_GET['id'] : '');
41 presenting_issues = ?,
44 anyother_relevant_information = ?,
46 treatment_received = ?,
47 recommendation_for_follow_up = ?";
51 "INSERT INTO form_treatment_plan SET $sets",
54 $_SESSION["authProvider"],
55 $_SESSION["authUser"],
58 $_POST["client_name"],
59 $_POST["client_number"],
61 $_POST["presenting_issues"],
62 $_POST["patient_history"],
63 $_POST["medications"],
64 $_POST["anyother_relevant_information"],
66 $_POST["treatment_received"],
67 $_POST["recommendation_for_follow_up"]
71 addForm($encounter, "Treatment Plan", $newid, "treatment_plan", $pid, $userauthorized);
74 "UPDATE form_treatment_plan SET $sets WHERE id = ?",
77 $_SESSION["authProvider"],
78 $_SESSION["authUser"],
81 $_POST["client_name"],
82 $_POST["client_number"],
84 $_POST["presenting_issues"],
85 $_POST["patient_history"],
86 $_POST["medications"],
87 $_POST["anyother_relevant_information"],
89 $_POST["treatment_received"],
90 $_POST["recommendation_for_follow_up"],
96 formHeader("Redirecting....");