2 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
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.
9 class DiabetesDenominator
implements CqmFilterIF
11 public function getTitle()
16 public function test(CqmPatient
$patient, $beginDate, $endDate)
18 // TODO how to check for these medication types?
19 $beginMinus2Years = strtotime('-2 year', strtotime($beginDate));
20 if (Helper
::checkMed(Medication
::DISP_DIABETES
, $patient, $beginMinus2Years, $endDate) ||
21 Helper
::checkMed(Medication
::ORDER_DIABETES
, $patient, $beginMinus2Years, $endDate) ||
22 Helper
::checkMed(Medication
::ACTIVE_DIABETES
, $patient, $beginMinus2Years, $endDate) ||
23 ( Helper
::checkDiagActive(Diagnosis
::DIABETES
, $patient, $beginMinus2Years, $endDate) &&
24 ( Helper
::checkEncounter(Encounter
::ENC_ACUTE_INP_OR_ED
, $patient, $beginDate, $endDate) ||
25 Helper
::checkEncounter(Encounter
::ENC_NONAC_INP_OUT_OR_OPTH
, $patient, $beginDate, $endDate, array( Encounter
::OPTION_ENCOUNTER_COUNT
=> 2 )) ) ) ) {