Highway to PSR2
[openemr.git] / library / classes / rulesets / Cqm / reports / NFQ_0101 / Numerator.php
blob084a6105c24909db77dd3a8389627a1775750e87
1 <?php
2 /**
4 * CQM NQF 0101 Numerator
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
25 class NFQ_0101_Numerator implements CqmFilterIF
27 public function getTitle()
29 return "Numerator";
32 public function test(CqmPatient $patient, $beginDate, $endDate)
34 $riskCatAssessQry = "SELECT count(*) as cnt FROM form_encounter fe ".
35 "INNER JOIN openemr_postcalendar_categories opc ON fe.pc_catid = opc.pc_catid ".
36 "INNER JOIN procedure_order pr ON fe.encounter = pr.encounter_id ".
37 "INNER JOIN procedure_order_code prc ON pr.procedure_order_id = prc.procedure_order_id ".
38 "WHERE opc.pc_catname = 'Office Visit' ".
39 "AND (fe.date BETWEEN ? AND ?) ".
40 "AND fe.pid = ? ".
41 "AND ( prc.procedure_code = '73830-2' OR prc.procedure_code = '57254-5' ) ".
42 "AND prc.procedure_order_title = 'Risk Category Assessment'";
44 $check = sqlQuery($riskCatAssessQry, array($beginDate, $endDate, $patient->id));
45 if ($check['cnt'] > 0) {
46 return true;
47 } else {
48 return false;