Bug fix for AMC rule 302m contributed by Ronald Leemhuis
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_302m / Numerator.php
blob39f09cb10b4c5012b2d622ee949abe1074577daf
1 <?php
2 // Copyright (C) 2011 Brady Miller <brady@sparmy.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_302m_Numerator implements AmcFilterIF
13 public function getTitle()
15 return "AMC_302m Numerator";
18 public function test( AmcPatient $patient, $beginDate, $endDate )
20 // Is patient provided patient specific education during the report period.
22 // Check for any patient specific education instances.
23 $item = sqlQuery("SELECT * FROM `amc_misc_data` as amc, `form_encounter` as enc " .
24 "WHERE enc.pid = amc.pid AND enc.pid = ? " .
25 "AND amc.map_category = 'form_encounter' " .
26 "AND enc.encounter = amc.map_id " .
27 "AND `amc_id` = 'patient_edu_amc' " .
28 "AND enc.date >= ? " .
29 "AND enc.date <= ?", array($patient->id,$beginDate,$endDate) );
31 if ( !(empty($item)) ) {
32 return true;
34 else {
35 return false;