Highway to PSR2
[openemr.git] / library / classes / rulesets / Cqm / reports / NFQ_0421 / InitialPatientPopulation.php
blobe0e481ee6aa050f99d87cc8362cb2814e8926a3c
1 <?php
2 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.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 //
9 class NFQ_0421_InitialPatientPopulation implements CqmFilterIF
11 public function getTitle()
13 return "Initial Patient Population";
16 public function test(CqmPatient $patient, $beginDate, $endDate)
18 $age = intval($patient->calculateAgeOnDate($beginDate));
19 if ($age >= 18 && $age <= 64) {
20 $oneEncounter = array( Encounter::OPTION_ENCOUNTER_COUNT => 1 );
21 if (Helper::check(ClinicalType::ENCOUNTER, Encounter::ENC_OUTPATIENT, $patient, $beginDate, $endDate, $oneEncounter)) {
22 return true;
26 return false;