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