Highway to PSR2
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_302f_4_STG1 / Numerator.php
blob6f56cbfa6a30d16cf9898bd1978464d4c8b31625
1 <?php
2 /**
4 * AMC 302f 4 STAGE1 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
24 class AMC_302f_4_STG1_Numerator implements AmcFilterIF
26 public function getTitle()
28 return "AMC_302f_4_STG1 Numerator";
31 public function test(AmcPatient $patient, $beginDate, $endDate)
33 //If height/length, weight, and blood pressure (all) within scope of practice (Optional 2013; Required effective 2014):
34 //Patients 3 years of age or older in the denominator for whom Height/length, weight, and blood pressure are recorded
35 //Patients younger than 3 years of age in the denominator for whom height/length and weight are recorded
36 if (( ($patient->calculateAgeOnDate($endDate) >= 3) &&
37 (exist_database_item($patient->id, 'form_vitals', 'bps', 'gt', '0', 'ge', 1, '', '', $endDate)) &&
38 (exist_database_item($patient->id, 'form_vitals', 'bpd', 'gt', '0', 'ge', 1, '', '', $endDate)) &&
39 (exist_database_item($patient->id, 'form_vitals', 'height', 'gt', '0', 'ge', 1, '', '', $endDate)) &&
40 (exist_database_item($patient->id, 'form_vitals', 'weight', 'gt', '0', 'ge', 1, '', '', $endDate))
43 ( ($patient->calculateAgeOnDate($endDate) < 3) &&
44 (exist_database_item($patient->id, 'form_vitals', 'height', 'gt', '0', 'ge', 1, '', '', $endDate)) &&
45 (exist_database_item($patient->id, 'form_vitals', 'weight', 'gt', '0', 'ge', 1, '', '', $endDate))
46 ) ) {
47 return true;
48 } else {
49 return false;