Highway to PSR2
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_304h / Numerator.php
blob4b942afb61cdb74ae5e0437d4950eb8f83a3514e
1 <?php
2 /**
3 * class AMC_304h_Numerator
5 * Copyright (C) 2011-2015 Brady Miller <brady.g.miller@gmail.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Brady Miller <brady.g.miller@gmail.com>
20 * @link http://www.open-emr.org
23 class AMC_304h_Numerator implements AmcFilterIF
25 public function getTitle()
27 return "AMC_304h Numerator";
30 public function test(AmcPatient $patient, $beginDate, $endDate)
32 // Need patient summary given/sent to patient within 3 business days of each encounter.
33 $amcElement = amcCollect('provide_sum_pat_amc', $patient->id, 'form_encounter', $patient->object['encounter']);
34 if (!(empty($amcElement))) {
35 $daysDifference = businessDaysDifference(date("Y-m-d", strtotime($patient->object['date'])), date("Y-m-d", strtotime($amcElement['date_completed'])));
36 if ($daysDifference < 4) {
37 return true;
41 return false;