From a02c6bbd06143d4a74727985ea25fac20ffcc162 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Thu, 12 May 2011 01:18:11 -0700 Subject: [PATCH] Added 3 AMC rulesets: -170.302(c) Maintain an up-to-date problem list of current and active diagnoses. -170.302(d) Maintain active medication list. -170.302(e) Maintain active medication allergy list. --- library/classes/rulesets/Amc/reports/AMC_302c.php | 31 +++++++++++++++++++ .../rulesets/Amc/reports/AMC_302c/Denominator.php | 32 +++++++++++++++++++ .../rulesets/Amc/reports/AMC_302c/Numerator.php | 36 ++++++++++++++++++++++ library/classes/rulesets/Amc/reports/AMC_302d.php | 31 +++++++++++++++++++ .../rulesets/Amc/reports/AMC_302d/Denominator.php | 32 +++++++++++++++++++ .../rulesets/Amc/reports/AMC_302d/Numerator.php | 36 ++++++++++++++++++++++ library/classes/rulesets/Amc/reports/AMC_302e.php | 31 +++++++++++++++++++ .../rulesets/Amc/reports/AMC_302e/Denominator.php | 32 +++++++++++++++++++ .../rulesets/Amc/reports/AMC_302e/Numerator.php | 36 ++++++++++++++++++++++ .../classes/rulesets/Amc/reports/ProblemList.php | 18 ----------- .../Amc/reports/ProblemList/Denominator.php | 14 --------- .../rulesets/Amc/reports/ProblemList/Numerator.php | 15 --------- library/classes/rulesets/ReportTypes.php | 6 ++-- 13 files changed, 300 insertions(+), 50 deletions(-) create mode 100644 library/classes/rulesets/Amc/reports/AMC_302c.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302c/Denominator.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302c/Numerator.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302d.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302d/Denominator.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302d/Numerator.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302e.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302e/Denominator.php create mode 100644 library/classes/rulesets/Amc/reports/AMC_302e/Numerator.php delete mode 100644 library/classes/rulesets/Amc/reports/ProblemList.php delete mode 100644 library/classes/rulesets/Amc/reports/ProblemList/Denominator.php delete mode 100644 library/classes/rulesets/Amc/reports/ProblemList/Numerator.php diff --git a/library/classes/rulesets/Amc/reports/AMC_302c.php b/library/classes/rulesets/Amc/reports/AMC_302c.php new file mode 100644 index 000000000..1ede0a1fa --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302c.php @@ -0,0 +1,31 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + + +class AMC_302c extends AbstractAmcReport +{ + public function getTitle() + { + return "AMC_302c"; + } + + public function createDenominator() + { + return new AMC_302c_Denominator(); + } + + public function createNumerator() + { + return new AMC_302c_Numerator(); + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302c/Denominator.php b/library/classes/rulesets/Amc/reports/AMC_302c/Denominator.php new file mode 100644 index 000000000..ec1fdd7da --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302c/Denominator.php @@ -0,0 +1,32 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + +class AMC_302c_Denominator implements AmcFilterIF +{ + public function getTitle() + { + return "AMC_302c Denominator"; + } + + public function test( AmcPatient $patient, $dateBegin, $dateEnd ) + { + // Seen by the EP or admitted to the eligible hospitals or CAHs inpatient or emergency department (POS 21 or 23) + // (basically needs an encounter before the end date) + if (Helper::checkAnyEncounter($patient, $dateBegin, $dateEnd, 1)) { + return true; + } + else { + return false; + } + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302c/Numerator.php b/library/classes/rulesets/Amc/reports/AMC_302c/Numerator.php new file mode 100644 index 000000000..ad63b66db --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302c/Numerator.php @@ -0,0 +1,36 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + + +class AMC_302c_Numerator implements AmcFilterIF +{ + public function getTitle() + { + return "AMC_302c Numerator"; + } + + public function test( AmcPatient $patient, $dateBegin, $dateEnd ) + { + // Have at least one entry or an indication that no problems are known for the + // patient recorded as structured data. + // (true if an entry in lists_touch or an active entry in lists preceding the date-end) + $firstCheck = sqlQuery("SELECT * FROM `lists_touch` WHERE `pid`=? AND `type`=? AND `date`<=?", array($patient->id,'medical_problem',$dateEnd) ); + $secondCheck = sqlQuery("SELECT * FROM `lists` WHERE `activity`='1' AND `pid`=? AND `type`=? AND `date`<=?", array($patient->id,'medical_problem',$dateEnd) ); + if ( !(empty($firstCheck)) || !(empty($secondCheck)) ) { + return true; + } + else { + return false; + } + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302d.php b/library/classes/rulesets/Amc/reports/AMC_302d.php new file mode 100644 index 000000000..9245d98a0 --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302d.php @@ -0,0 +1,31 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + + +class AMC_302d extends AbstractAmcReport +{ + public function getTitle() + { + return "AMC_302d"; + } + + public function createDenominator() + { + return new AMC_302d_Denominator(); + } + + public function createNumerator() + { + return new AMC_302d_Numerator(); + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302d/Denominator.php b/library/classes/rulesets/Amc/reports/AMC_302d/Denominator.php new file mode 100644 index 000000000..8a0aa2338 --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302d/Denominator.php @@ -0,0 +1,32 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + +class AMC_302d_Denominator implements AmcFilterIF +{ + public function getTitle() + { + return "AMC_302d Denominator"; + } + + public function test( AmcPatient $patient, $dateBegin, $dateEnd ) + { + // Seen by the EP or admitted to the eligible hospitals or CAHs inpatient or emergency department (POS 21 or 23) + // (basically needs an encounter before the end date) + if (Helper::checkAnyEncounter($patient, $dateBegin, $dateEnd, 1)) { + return true; + } + else { + return false; + } + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302d/Numerator.php b/library/classes/rulesets/Amc/reports/AMC_302d/Numerator.php new file mode 100644 index 000000000..da9d17a4c --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302d/Numerator.php @@ -0,0 +1,36 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + + +class AMC_302d_Numerator implements AmcFilterIF +{ + public function getTitle() + { + return "AMC_302d Numerator"; + } + + public function test( AmcPatient $patient, $dateBegin, $dateEnd ) + { + // Have at least one entry or an indication that no medications are known for the + // patient recorded as structured data. + // (true if an entry in lists_touch or an active entry in lists preceding the date-end) + $firstCheck = sqlQuery("SELECT * FROM `lists_touch` WHERE `pid`=? AND `type`=? AND `date`<=?", array($patient->id,'medication',$dateEnd) ); + $secondCheck = sqlQuery("SELECT * FROM `lists` WHERE `activity`='1' AND `pid`=? AND `type`=? AND `date`<=?", array($patient->id,'medication',$dateEnd) ); + if ( !(empty($firstCheck)) || !(empty($secondCheck)) ) { + return true; + } + else { + return false; + } + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302e.php b/library/classes/rulesets/Amc/reports/AMC_302e.php new file mode 100644 index 000000000..eeedd7cbf --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302e.php @@ -0,0 +1,31 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + + +class AMC_302e extends AbstractAmcReport +{ + public function getTitle() + { + return "AMC_302e"; + } + + public function createDenominator() + { + return new AMC_302e_Denominator(); + } + + public function createNumerator() + { + return new AMC_302e_Numerator(); + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302e/Denominator.php b/library/classes/rulesets/Amc/reports/AMC_302e/Denominator.php new file mode 100644 index 000000000..bacaf11b3 --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302e/Denominator.php @@ -0,0 +1,32 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + +class AMC_302e_Denominator implements AmcFilterIF +{ + public function getTitle() + { + return "AMC_302e Denominator"; + } + + public function test( AmcPatient $patient, $dateBegin, $dateEnd ) + { + // Seen by the EP or admitted to the eligible hospitals or CAHs inpatient or emergency department (POS 21 or 23) + // (basically needs an before the end date) + if (Helper::checkAnyEncounter($patient, $dateBegin, $dateEnd, 1)) { + return true; + } + else { + return false; + } + } +} diff --git a/library/classes/rulesets/Amc/reports/AMC_302e/Numerator.php b/library/classes/rulesets/Amc/reports/AMC_302e/Numerator.php new file mode 100644 index 000000000..844a67d36 --- /dev/null +++ b/library/classes/rulesets/Amc/reports/AMC_302e/Numerator.php @@ -0,0 +1,36 @@ + +// +// 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. +// +// +// This file contains a function to keep track of which issues +// types get modified. +// + + +class AMC_302e_Numerator implements AmcFilterIF +{ + public function getTitle() + { + return "AMC_302e Numerator"; + } + + public function test( AmcPatient $patient, $dateBegin, $dateEnd ) + { + // Have at least one entry or an indication that no problems are known for the + // patient recorded as structured data. + // (true if an entry in lists_touch or an active entry in lists preceding the date-end) + $firstCheck = sqlQuery("SELECT * FROM `lists_touch` WHERE `pid`=? AND `type`=? AND `date`<=?", array($patient->id,'allergy',$dateEnd) ); + $secondCheck = sqlQuery("SELECT * FROM `lists` WHERE `activity`='1' AND `pid`=? AND `type`=? AND `date`<=?", array($patient->id,'allergy',$dateEnd) ); + if ( !(empty($firstCheck)) || !(empty($secondCheck)) ) { + return true; + } + else { + return false; + } + } +} diff --git a/library/classes/rulesets/Amc/reports/ProblemList.php b/library/classes/rulesets/Amc/reports/ProblemList.php deleted file mode 100644 index f8d7cf85b..000000000 --- a/library/classes/rulesets/Amc/reports/ProblemList.php +++ /dev/null @@ -1,18 +0,0 @@ - array( ReportTypes::CQM, "NFQ_Unimplemented" ), "rule_dm_a1c_cqm" => array( ReportTypes::CQM, "NFQ_Unimplemented" ), "rule_dm_ldl_cqm" => array( ReportTypes::CQM, "NFQ_Unimplemented" ), - "problem_list_amc" => array( ReportTypes::AMC, "ProblemList" ), - "med_list_amc" => array( ReportTypes::AMC, "AMC_Unimplemented" ), - "med_allergy_list_amc" => array( ReportTypes::AMC, "AMC_Unimplemented" ), + "problem_list_amc" => array( ReportTypes::AMC, "AMC_302c" ), + "med_list_amc" => array( ReportTypes::AMC, "AMC_302d" ), + "med_allergy_list_amc" => array( ReportTypes::AMC, "AMC_302e" ), "record_vitals_amc" => array( ReportTypes::AMC, "AMC_Unimplemented" ), "record_smoke_amc" => array( ReportTypes::AMC, "AMC_Unimplemented" ), "lab_result_amc" => array( ReportTypes::AMC, "AMC_Unimplemented" ), -- 2.11.4.GIT