4 * AMC 314g_1_2_20 STAGE1 Numerator
6 * Copyright (C) 2015 Ensoftek, Inc
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @link http://www.open-emr.org
24 class AMC_314g_1_2_20_Numerator
implements AmcFilterIF
29 // 1. Remove the $patArr stuff.
31 public $patArr = array();
32 public function getTitle()
34 return "AMC_314g_1_2_20 Numerator";
37 public function test(AmcPatient
$patient, $beginDate, $endDate)
39 if (!in_array($patient->id
, $this->patArr
)) {
40 $this->patArr
[] = $patient->id
;
44 // These mechanism seems really odd. Will need to research this a bit.
46 $docLabQry = "SELECT count(*) as cnt FROM documents d ".
47 "INNER JOIN categories_to_documents cd ON d.id = cd.document_id ".
48 "INNER JOIN categories dlc ON cd.category_id = dlc.id AND dlc.name = 'Lab Report' ".
49 "INNER JOIN patient_data pd ON pd.pid = d.foreign_id ".
50 "WHERE d.foreign_id = ? AND (d.date BETWEEN ? AND ?) ";
51 $check = sqlQuery($docLabQry, array($patient->id
, $beginDate, $endDate));
52 if ($check['cnt'] > 0) {