Third step in refactoring/integrating the amc rules for MU2.
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_304b_2_STG2 / Denominator.php
blobdda659aea4153a8a13c245da71e792d6a49859ce
1 <?php
2 /**
4 * AMC 304b 2 STAGE2 Denominator
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
23 // Denominator:
24 // Reporting period start and end date
25 // Prescription written for drugs requiring a prescription in order to be dispensed
26 // Denominator exclusion:
27 // Prescription written for controlled substance
28 // Generate and transmit permissible prescriptions electronically (other than controlled substances) queried for drug formulary).( AMC-2014:170.314(g)(1)/(2)–8 )
30 class AMC_304b_2_STG2_Denominator implements AmcFilterIF
32 public function getTitle()
34 return "AMC_304b_2_STG2 Denominator";
37 public function test( AmcPatient $patient, $beginDate, $endDate )
39 // Check if prescription is for a controlled substance
40 $controlledSubstanceCheck = amcCollect('e_prescribe_cont_subst_amc',$patient->id,'prescriptions',$patient->object['id']);
41 // Exclude controlled substances
42 if (empty($controlledSubstanceCheck)) {
43 // Not a controlled substance, so include in denominator.
44 return true;
46 else {
47 // Is a controlled substance, so exclude from denominator.
48 return false;