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