Highway to PSR2
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_304f / Numerator.php
blob070ce1717311b8f97b744be68e2a2de2047eeaec
1 <?php
2 // Copyright (C) 2011 Brady Miller <brady.g.miller@gmail.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
11 class AMC_304f_Numerator implements AmcFilterIF
13 public function getTitle()
15 return "AMC_304f Numerator";
18 public function test(AmcPatient $patient, $beginDate, $endDate)
20 // For all record request need to be completed within three business days
21 $amcResults = sqlStatement("SELECT * FROM `amc_misc_data` WHERE `amc_id`=? AND `pid`=? AND `date_created`>=? AND `date_created`<=?", array('provide_rec_pat_amc',$patient->id,$beginDate,$endDate));
23 while ($res = sqlFetchArray($amcResults)) {
24 if (empty($res['date_completed'])) {
25 // Records requested but not given
26 return false;
29 $businessDaysDifference = businessDaysDifference(date("Y-m-d", strtotime($res['date_created'])), date("Y-m-d", strtotime($res['date_completed'])));
30 if ($businessDaysDifference > 3) {
31 // Records not given within 3 business days of request
32 return false;
36 // All requested records for patient were given within 3 business days
37 return true;