forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First step in refactoring/integrating the amc rules for MU2, take 2.
- Loading branch information
1 parent
dd34aef
commit 34db4df
Showing
29 changed files
with
198 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
<?php | ||
// Copyright (C) 2011 Ken Chapple <[email protected]> | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
// | ||
/** | ||
* AbstractAmcReport class | ||
* | ||
* Copyright (C) 2011 Ken Chapple <[email protected]> | ||
* Copyright (C) 2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://opensource.org/licenses/gpl-license.php>;. | ||
* | ||
* @package OpenEMR | ||
* @author Ken Chapple <[email protected]> | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
require_once( 'AmcFilterIF.php' ); | ||
require_once( dirname(__FILE__)."/../../../../clinical_rules.php" ); | ||
require_once( dirname(__FILE__)."/../../../../amc.php" ); | ||
|
@@ -216,6 +232,14 @@ private function collectObjects ($patient,$object_label,$begin,$end) { | |
"AND `date` >= ? AND `date` <= ?"; | ||
array_push($sqlBindArray, $patient->id, $begin, $end); | ||
break; | ||
case "encounters_office_visit": | ||
$sql = "SELECT * " . | ||
"FROM `form_encounter` LEFT JOIN `enc_category_map` ON (form_encounter.pc_catid = enc_category_map.main_cat_id) " . | ||
"WHERE enc_category_map.rule_enc_id = 'enc_off_vis' " . | ||
"AND `pid` = ? " . | ||
"AND `date` >= ? AND `date` <= ?"; | ||
array_push($sqlBindArray, $patient->id, $begin, $end); | ||
break; | ||
case "prescriptions": | ||
$sql = "SELECT * " . | ||
"FROM `prescriptions` " . | ||
|
@@ -259,6 +283,9 @@ private function collectObjects ($patient,$object_label,$begin,$end) { | |
break; | ||
|
||
case "med_orders": | ||
// AMC MU2 TODO : | ||
// Note the cpoe_flag and functionality does not exist in OpenEMR official codebase. | ||
// | ||
$sql = "SELECT cpoe_flag as cpoe_stat " . | ||
"FROM `prescriptions` " . | ||
"WHERE `patient_id` = ? " . | ||
|
@@ -286,22 +313,16 @@ private function collectObjects ($patient,$object_label,$begin,$end) { | |
break; | ||
|
||
case "pres_non_substance": | ||
// AMC MU2 TODO : | ||
// Note the cpoe_flag, eTransmit, and formulary functionality does not exist in OpenEMR official codebase. | ||
// Note that this was to be used in the AMC_304b rules (but is currently not being used yet, though). | ||
// | ||
$sql = "SELECT formulary, cpoe_flag as transmit_stat, eTransmit " . | ||
"FROM `prescriptions` " . | ||
"WHERE controlledsubstance = 'no' " . | ||
"AND `patient_id` = ? ". | ||
"AND `date_added` BETWEEN ? AND ?"; | ||
array_push($sqlBindArray, $patient->id, $begin, $end); | ||
break; | ||
|
||
case "encounters_office_vist": | ||
$sql = "SELECT * " . | ||
"FROM `form_encounter` fe " . | ||
"INNER JOIN openemr_postcalendar_categories opc ON fe.pc_catid = opc.pc_catid ". | ||
"WHERE opc.pc_catname = 'Office Visit' ". | ||
"AND`pid` = ? " . | ||
"AND `date` >= ? AND `date` <= ?"; | ||
array_push($sqlBindArray, $patient->id, $begin, $end); | ||
break; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
<?php | ||
// Copyright (C) 2011 Brady Miller <[email protected]> | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
// | ||
|
||
/** | ||
* class AMC_304h_Numerator | ||
* | ||
* Copyright (C) 2011-2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://opensource.org/licenses/gpl-license.php>;. | ||
* | ||
* @package OpenEMR | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
class AMC_304h_Numerator implements AmcFilterIF | ||
{ | ||
|
@@ -21,7 +33,6 @@ public function test( AmcPatient $patient, $beginDate, $endDate ) | |
$amcElement = amcCollect('provide_sum_pat_amc',$patient->id,'form_encounter',$patient->object['encounter']); | ||
if (!(empty($amcElement))) { | ||
$daysDifference = businessDaysDifference( date("Y-m-d",strtotime($patient->object['date'])) , date("Y-m-d",strtotime($amcElement['date_completed'])) ); | ||
error_log("DEBUG: ".$daysDifference,0); | ||
if ($daysDifference < 4) { | ||
return true; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* AMC 304h STAGE2 | ||
* | ||
* Copyright (C) 2015 Ensoftek, Inc | ||
* Copyright (C) 2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -18,6 +19,7 @@ | |
* | ||
* @package OpenEMR | ||
* @author Ensoftek | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
|
@@ -30,7 +32,7 @@ public function getTitle() | |
|
||
public function getObjectToCount() | ||
{ | ||
return "encounters_office_vist"; | ||
return "encounters_office_visit"; | ||
} | ||
|
||
public function createDenominator() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* AMC 314g 1 2 14 STAGE1 | ||
* | ||
* Copyright (C) 2015 Ensoftek, Inc | ||
* Copyright (C) 2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -18,6 +19,7 @@ | |
* | ||
* @package OpenEMR | ||
* @author Ensoftek | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
|
@@ -30,7 +32,7 @@ public function getTitle() | |
|
||
public function getObjectToCount() | ||
{ | ||
return "encounters"; | ||
return "patients"; | ||
} | ||
|
||
public function createDenominator() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* AMC 314g_1_2_14 STAGE1 Denominator | ||
* | ||
* Copyright (C) 2015 Ensoftek, Inc | ||
* Copyright (C) 2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -18,24 +19,27 @@ | |
* | ||
* @package OpenEMR | ||
* @author Ensoftek | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
class AMC_314g_1_2_14_Denominator implements AmcFilterIF | ||
{ | ||
public $patArr = array(); | ||
public function getTitle() | ||
{ | ||
return "AMC_314g_1_2_14 Denominator"; | ||
} | ||
|
||
public function test( AmcPatient $patient, $beginDate, $endDate ) | ||
{ | ||
if(!in_array($patient->id, $this->patArr)){ | ||
$this->patArr[] = $patient->id; | ||
return true; | ||
} | ||
else | ||
return false; | ||
// Seen by the EP | ||
// (basically needs an encounter within the report dates) | ||
$options = array( Encounter::OPTION_ENCOUNTER_COUNT => 1 ); | ||
if (Helper::checkAnyEncounter($patient, $beginDate, $endDate, $options)) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* AMC 314g_1_2_14 STAGE2 | ||
* | ||
* Copyright (C) 2015 Ensoftek, Inc | ||
* Copyright (C) 2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -18,6 +19,7 @@ | |
* | ||
* @package OpenEMR | ||
* @author Ensoftek | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
|
@@ -31,7 +33,7 @@ public function getTitle() | |
|
||
public function getObjectToCount() | ||
{ | ||
return "encounters"; | ||
return "patients"; | ||
} | ||
|
||
public function createDenominator() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* AMC 314g_1_2_14 STAGE2 Denominator | ||
* | ||
* Copyright (C) 2015 Ensoftek, Inc | ||
* Copyright (C) 2015 Brady Miller <[email protected]> | ||
* | ||
* LICENSE: This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -18,24 +19,27 @@ | |
* | ||
* @package OpenEMR | ||
* @author Ensoftek | ||
* @author Brady Miller <[email protected]> | ||
* @link https://www.open-emr.org | ||
*/ | ||
|
||
class AMC_314g_1_2_14_STG2_Denominator implements AmcFilterIF | ||
{ | ||
public $patArr = array(); | ||
public function getTitle() | ||
{ | ||
return "AMC_314g_1_2_14_STG2 Denominator"; | ||
} | ||
|
||
public function test( AmcPatient $patient, $beginDate, $endDate ) | ||
{ | ||
if(!in_array($patient->id, $this->patArr)){ | ||
$this->patArr[] = $patient->id; | ||
return true; | ||
} | ||
else | ||
return false; | ||
// Seen by the EP | ||
// (basically needs an encounter within the report dates) | ||
$options = array( Encounter::OPTION_ENCOUNTER_COUNT => 1 ); | ||
if (Helper::checkAnyEncounter($patient, $beginDate, $endDate, $options)) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
} |
Oops, something went wrong.