fixing substr warning on fldtype, take 2.
[openemr.git] / custom / qrda_download.php
blob289368407e4cb602843a2596214d9d1e5bd8ccab
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 //SANITIZE ALL ESCAPES
27 $sanitize_all_escapes=true;
29 //STOP FAKE REGISTER GLOBALS
30 $fake_register_globals=false;
32 require_once("../interface/globals.php");
34 $qrda_fname = $_GET['qrda_fname'];
35 check_file_dir_name($qrda_fname);
36 if($qrda_fname != ""){
37 $qrda_file_path = $GLOBALS['OE_SITE_DIR'] . "/documents/cqm_qrda/";
38 $xmlurl = $qrda_file_path.$qrda_fname;
40 header("Pragma: public"); // required
41 header("Expires: 0");
42 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
43 header("Cache-Control: private",false); // required for certain browsers
44 header('Content-type: application/xml');
45 header("Content-Disposition: attachment; filename=\"".basename($xmlurl)."\";" );
46 header("Content-Transfer-Encoding: binary");
47 header("Content-Length: ". filesize($xmlurl));
48 ob_clean();
49 flush();
50 readfile( $xmlurl );
51 }else{
52 echo xlt("File path not found.");