Openemr fix 5641 erx javascript (#5642)
[openemr.git] / library / ajax / amc_misc_data.php
blob2ca16d64b72373b3a5dbfdc4a4ba939c122a6b3e
1 <?php
3 /**
4 * This file contains functions to manage some AMC items.
6 * @package OpenEMR
7 * @link https://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2011-2018 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once(dirname(__FILE__) . "/../../interface/globals.php");
14 require_once(dirname(__FILE__) . "/../amc.php");
16 use OpenEMR\Common\Csrf\CsrfUtils;
18 if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
19 CsrfUtils::csrfNotVerified();
22 // If all items are valid(ie. not empty) (note object_category and object_id and date_created can be empty), then proceed.
23 if (
24 !(empty($_POST['amc_id'])) &&
25 !(empty($_POST['complete'])) &&
26 !(empty($_POST['mode'])) &&
27 !(empty($_POST['patient_id']))
28 ) {
29 processAmcCall($_POST['amc_id'], $_POST['complete'], $_POST['mode'], $_POST['patient_id'], ($_POST['object_category'] ?? null), ($_POST['object_id'] ?? null), ($_POST['date_created'] ?? null));