Highway to PSR2
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_302e / Numerator.php
blobbdb4c72e01b125c0dd589c2452bd2bd7a20a1600
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_302e_Numerator implements AmcFilterIF
13 public function getTitle()
15 return "AMC_302e Numerator";
18 public function test(AmcPatient $patient, $beginDate, $endDate)
20 // Have at least one entry or an indication that no problems are known for the
21 // patient recorded as structured data.
22 // (true if an entry in lists_touch or an active entry in lists)
23 $firstCheck = sqlQuery("SELECT * FROM `lists_touch` WHERE `pid`=? AND `type`=?", array($patient->id,'allergy'));
24 $secondCheck = sqlQuery("SELECT * FROM `lists` WHERE `activity`='1' AND `pid`=? AND `type`=?", array($patient->id,'allergy'));
25 if (!(empty($firstCheck)) || !(empty($secondCheck))) {
26 return true;
27 } else {
28 return false;