* @author Brady Miller * @author Daniel Ehrlich * @copyright Copyright (c) 2005 Rod Roark * @copyright Copyright (c) 2018-2021 Brady Miller * @copyright Copyright (c) 2018 Daniel Ehrlich * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once("../../globals.php"); require_once("$srcdir/api.inc"); require_once("$srcdir/forms.inc"); use OpenEMR\Common\Csrf\CsrfUtils; use OpenEMR\Core\Header; $row = array(); if (! $encounter) { // comes from globals.php die("Internal error: we do not seem to be in an encounter!"); } function rbvalue($rbname) { $tmp = $_POST[$rbname]; if (! $tmp) { $tmp = '0'; } return "$tmp"; } function cbvalue($cbname) { return $_POST[$cbname] ? '1' : '0'; } function rbinput($name, $value, $desc, $colname) { global $row; $ret = "" . rbinput($name, $value, $desc, $colname) . "\n"; } function cbinput($name, $colname) { global $row; $ret = "" . cbinput($name, $colname) . text($desc) . "\n"; } $formid = $_GET['id']; // If Save was clicked, save the info. // if (!empty($_POST['bn_save'])) { $fu_timing = $_POST['fu_timing']; if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) { CsrfUtils::csrfNotVerified(); } // If updating an existing form... // if ($formid) { $query = "UPDATE form_clinic_note SET history = ?, examination = ?, plan = ?, followup_required = ?, followup_timing = ? WHERE id = ?"; sqlStatement($query, array($_POST['form_history'], $_POST['form_examination'], $_POST['form_plan'], rbvalue('fu_required'), $fu_timing, $formid)); } else { // If adding a new form... $query = "INSERT INTO form_clinic_note ( " . "history, examination, plan, followup_required, followup_timing ) VALUES ( ?, ?, ?, ?, ? )"; $newid = sqlInsert($query, array($_POST['form_history'], $_POST['form_examination'], $_POST['form_plan'], rbvalue('fu_required'), $fu_timing)); addForm($encounter, "Clinic Note", $newid, "clinic_note", $pid, $userauthorized); } formHeader("Redirecting...."); formJump(); formFooter(); exit; } if ($formid) { $row = sqlQuery("SELECT * FROM form_clinic_note WHERE " . "id = ? AND activity = '1'", array($formid)) ; } ?> topmargin="0" rightmargin="0" leftmargin="2" bottommargin="0" marginwidth="2" marginheight="0">

' />