4 * aftercare_plan save.php
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 goal_a_acute_intoxication = ?,
42 goal_a_acute_intoxication_I = ?,
43 goal_a_acute_intoxication_II = ?,
44 goal_b_emotional_behavioral_conditions = ?,
45 goal_b_emotional_behavioral_conditions_I = ?,
46 goal_c_relapse_potential = ?,
47 goal_c_relapse_potential_I = ?";
52 "INSERT INTO form_aftercare_plan SET $sets",
55 $_SESSION["authProvider"],
56 $_SESSION["authUser"],
59 $_POST["client_name"],
62 $_POST["goal_a_acute_intoxication"],
63 $_POST["goal_a_acute_intoxication_I"],
64 $_POST["goal_a_acute_intoxication_II"],
65 $_POST["goal_b_emotional_behavioral_conditions"],
66 $_POST["goal_b_emotional_behavioral_conditions_I"],
67 $_POST["goal_c_relapse_potential"],
68 $_POST["goal_c_relapse_potential_I"]
72 addForm($encounter, "Aftercare Plan", $newid, "aftercare_plan", $pid, $userauthorized);
75 "UPDATE form_aftercare_plan SET $sets WHERE id = ?;",
78 $_SESSION["authProvider"],
79 $_SESSION["authUser"],
82 $_POST["client_name"],
85 $_POST["goal_a_acute_intoxication"],
86 $_POST["goal_a_acute_intoxication_I"],
87 $_POST["goal_a_acute_intoxication_II"],
88 $_POST["goal_b_emotional_behavioral_conditions"],
89 $_POST["goal_b_emotional_behavioral_conditions_I"],
90 $_POST["goal_c_relapse_potential"],
91 $_POST["goal_c_relapse_potential_I"],
97 formHeader("Redirecting....");