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>;.
21 * @link http://www.open-emr.org
25 //Initialization of QRDA Elements
27 $mainQrdaRaceCodeArr = array('amer_ind_or_alaska_native'=>'1002-5', 'Asian'=>'2028-9', 'black_or_afri_amer'=>'2054-5', 'native_hawai_or_pac_island'=>'2076-8', 'white'=>'2106-3', 'Asian_Pacific_Island'=>'2131-1', 'Black_not_of_Hispan'=>'2131-1', 'Hispanic'=>'2131-1', 'White_not_of_Hispan'=>'2131-1');
29 //QRDA Needed Ethnicity
30 $mainEthiCodeArr = array('not_hisp_or_latin'=>'2186-5', 'hisp_or_latin'=>'2135-2');
32 //QRDA Needed Payer Info
33 $mainQrdaPayerCodeSendArr = array();
34 $encCheckUniqId = array();
35 $mainQrdaPayerCodeSendArr['Medicare'] = "1";
36 $mainQrdaPayerCodeSendArr['Medicaid'] = "2";
37 $mainQrdaPayerCodeSendArr['Private Health Insurance'] = "5";
38 $mainQrdaPayerCodeSendArr['Other'] = "349";
41 $preDefinedUniqIDRules = array();
42 $preDefinedUniqIDRules['0101'] = '40280381-4555-E1C1-0145-672613970D15';
43 $preDefinedUniqIDRules['0043'] = '40280381-4555-E1C1-0145-762578A81C4C';
44 $preDefinedUniqIDRules['0421'] = '40280381-4555-E1C1-0145-D2B36DBB3FE6';
45 $preDefinedUniqIDRules['0038'] = '40280381-4555-E1C1-0145-D7C003364261';
46 $preDefinedUniqIDRules['0028'] = '40280381-4600-425F-0146-1F5867D40E82';
47 $preDefinedUniqIDRules['0384'] = '40280381-4600-425F-0146-1F620BDF0EB0';
48 $preDefinedUniqIDRules['0002'] = '40280381-4600-425F-0146-1F6E280C0F09';
49 $preDefinedUniqIDRules['0018'] = '40280381-4600-425F-0146-1F6F722B0F17';
50 $preDefinedUniqIDRules['0013'] = '40280381-4600-425F-0146-1F6F722B0F17';
51 $preDefinedUniqIDRules['0024'] = '40280381-4555-E1C1-0145-85C7311720F5';
53 $qrda_file_path = $GLOBALS['OE_SITE_DIR'] . "/documents/cqm_qrda/";
55 function getCombinePatients($dataSheet, $reportID) {
56 foreach( $dataSheet as $singleDataSheet ) {
57 //var_dump($singleDataSheet['cqm_nqf_code'],$singleDataSheet['init_patients']);
58 if ( count($cqmCodes) && in_array($singleDataSheet['cqm_nqf_code'],$cqmCodes) ) {
59 $initPatArr = collectItemizedPatientsCdrReport($reportID, $singleDataSheet['itemized_test_id'], "init_patients");
60 $fullPatArr = array();
61 foreach($initPatArr as $initPatInfo){
62 $fullPatArr[] = $initPatInfo['pid'];
64 $patients[$singleDataSheet['cqm_nqf_code']] = array_merge($patients[$singleDataSheet['cqm_nqf_code']], $fullPatArr);
65 $patients[$singleDataSheet['cqm_nqf_code']] = array_unique($patients[$singleDataSheet['cqm_nqf_code']]);
67 $cqmCodes[] = $singleDataSheet['cqm_nqf_code'];
68 $initPatArr = collectItemizedPatientsCdrReport($reportID, $singleDataSheet['itemized_test_id'], "init_patients");
69 $fullPatArr = array();
70 foreach($initPatArr as $initPatInfo){
71 $fullPatArr[] = $initPatInfo['pid'];
73 $patients[$singleDataSheet['cqm_nqf_code']] = $fullPatArr;