fix: set default x12 partner for item in billing manager (#7513)
[openemr.git] / library / classes / rulesets / Amc / reports / AMC_314g_1_2_20 / Numerator.php
blob326d3b4a40d9a8572c028a042de70801b0a08855
1 <?php
3 /**
5 * AMC 314g_1_2_20 STAGE1 Numerator
7 * Copyright (C) 2015 Ensoftek, Inc
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Ensoftek
22 * @link http://www.open-emr.org
25 class AMC_314g_1_2_20_Numerator implements AmcFilterIF
27 // Still TODO
28 // AMC MU2 TODO :
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;
42 // Still TODO
43 // AMC MU2 TODO :
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) {
53 return true;
54 } else {
55 return false;