fixes: CDR engine fixes for duplicate use of actions across rules in addition to...
[openemr.git] / custom / qrda_download.php
blobe6737dd3dc442c57c46b9782a58479e15b67cbb6
1 <?php
3 /**
5 * QRDA Download
7 * Copyright (C) 2015 Ensoftek, Inc
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Ensoftek
22 * @link http://www.open-emr.org
25 // This program exports(Download) to QRDA Category III XML.
27 require_once("../interface/globals.php");
29 use OpenEMR\Common\Csrf\CsrfUtils;
31 if (!CsrfUtils::verifyCsrfToken($_GET["csrf_token_form"])) {
32 CsrfUtils::csrfNotVerified();
35 $qrda_fname = $_GET['qrda_fname'];
36 check_file_dir_name($qrda_fname);
38 if ($qrda_fname != "") {
39 $qrda_file_path = $GLOBALS['OE_SITE_DIR'] . "/documents/cqm_qrda/";
40 $xmlurl = $qrda_file_path . $qrda_fname;
42 header("Pragma: public"); // required
43 header("Expires: 0");
44 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
45 header("Cache-Control: private", false); // required for certain browsers
46 header('Content-type: application/xml');
47 header("Content-Disposition: attachment; filename=\"" . basename($xmlurl) . "\";");
48 header("Content-Transfer-Encoding: binary");
49 header("Content-Length: " . filesize($xmlurl));
50 ob_clean();
51 flush();
52 readfile($xmlurl);
53 } else {
54 echo xlt("File path not found.");