AMC fails

cverk wrote on Sunday, November 20, 2011:

The AMC calculator seems to fail under windows. The linux online demo seems to work, so it seems to either be windows or a large database problem like the reminders issue. It runs a pretty long time and then comes up blank without even showing the various categories that are supposed to be calculated.

cverk wrote on Sunday, November 20, 2011:

I ran the same database under Ubuntu, (~8000 patients), and I got the same result.  I t runs a long time and then gives an empty screen for results.  It seems like it must time out.

yehster wrote on Sunday, November 20, 2011:

Can you try adding
set_time_limit(0) to the beginning of your cqm.php file?
located here:
interface/reports/cqm.php

It may let the report run to completion as per the info here:
http://php.net/manual/en/function.set-time-limit.php

I suspect that just as with patient reminders, a different approach will be needed. 
-Kevin Yeh

cverk wrote on Monday, November 21, 2011:

I added it here and it did run. I took about 30 minutes on an I7 processor with 4 GB of ram. So luckily this isn’t something that has to be done daily.

<?php html_header_show(); set_time_limit(0)?>

cverk wrote on Monday, November 21, 2011:

Oops, I forgot to say thank you! That helps me know where I am at .

yehster wrote on Monday, November 21, 2011:

Glad it worked, how do your numbers look?  Does Meaningful Use in 2011 still seem realistic for you?

Adding progress update/feedback to the ACM/CQM code that reassures the user that the process is still running like what is being worked on for patient reminders is something for the “to do list.”

A tangential thought is that if one were using replication to publish data to have an offsite patient portal.  That separate server instance could be used for analysis purposes so as to not bog down your “working server.”
An even slicker solution would be to create a transient instance “in the cloud” (on Amazon EC2, Rackspace or the like) transfer a database dump, generate the statistics then shutdown the instance. 
On demand resources for compute intensive, but “short lived” processes has always been one of the “selling points” for cloud computing.

tmccormi wrote on Tuesday, November 22, 2011:

I am a big proponent  of creating a ‘Reporting Server’ like yester suggests.   We do a lot of that using a copy of the production data and Pentaho reporting tools to make really nice reports offline.

Tony
www.mi-squared.com / @tonymi2
oemr.org / @OEMR_org

cverk wrote on Tuesday, November 22, 2011:

   I look to be pretty close to making most of what I need for meaningful use. The real trick was offering to split up a portion of any incentives we may get with my office staff. That goes a long way towards all the extra work it takes to build problem lists etc, even though it may not be a bunch with a limited medicare population.
   I am still thinking of how to best secure the patient portal.  My current area of study is a ubuntu VM in a cloud server set to read only with data replication from my main in-office server of just the data needed for the portal. I think that is feasible, but I have a lot of study to do first. It seems you can shortcut a lot of steps with turnkey core,virtualbox and the ubuntu installer managed by webmin. I think it would allow me to keep my production server behind firewalls and harder to reach with replication performing backup at the same time.

cverk wrote on Tuesday, November 22, 2011:

I found what appears to be a glitch in the AMC calculation.  The visits that are marked for “provided education resources” do not show as counted for providing education resources (AMC:170.302(m) ).  I can’t see anywhere else you would mark for having done so. It also appears that if you mark the patient record request button under patient/client records it shows as a denominator under 304(f) , but as a numerator under 304(g)

cverk wrote on Thursday, November 24, 2011:

I tried it again to confirm.  The main encounter clickable entry for patient education resources does not seem to get counted under the AMC calculation.

bradymiller wrote on Saturday, November 26, 2011:

Hi cverk,

Check out this wiki page to see how the AMC specific tracking elements work:
http://www.open-emr.org/wiki/index.php/Description_AMC#AMC_Measures_Tracking_Mechanisms

And can even get more specifics on the rules within the code. For example, “provided education resources” (170.302(m) can be found here:
http://github.com/openemr/openemr/blob/master/library/classes/rulesets/Amc/reports/AMC_302m.php (only useful thing is what objects it is counted, which in this case is “patients”)
http://github.com/openemr/openemr/blob/master/library/classes/rulesets/Amc/reports/AMC_302m/Denominator.php (to get in denominator, the patient basically just needs an encounter within the report dates)
http://github.com/openemr/openemr/blob/master/library/classes/rulesets/Amc/reports/AMC_302m/Numerator.php (to count, basically need the “provided education resources” toggle clicked in an encounter within the report dates) (note the ‘amc_misc_data’ keeps ‘track’ of all these special amc elements)

I tested the provider “education resources toggle”(in encounter screen) on the online demo and it is working ok (both on the 4.1.0 and the 4.1.1-dev demos). Note this AMC rule is counting patients, not encounters (what is counted, actually depends on the specific AMC rule), so as long as the patient has this clicked in one of their encounters within the report dates, then it gets counted as one in the numerator (even if the patient has 10 encounters within the report date that got toggled as getting patient education, it still only counts as one in the numerator).

Here’s all the documentation regarding the CDR engine (and AMC rules) on the wiki:
http://www.open-emr.org/wiki/index.php/CDR_Engine

Let us know if still continue to have bugs.

thanks,
-brady
OpenEMR Project

cverk wrote on Monday, November 28, 2011:

I can find them logged in under the database, so the education toggle does seem to record them into the database.  They just don’t seem to show up when you run the AMC report on a large database. I can also find where the 304f and g issue seems to not place an end date in the database and thus doesn’t get counted.  I am going to add all the new patches and try and run it again in case there was something changed in one of those files, but it takes a long time to run this report so it is hard to play around with making changes and seeing what happens.

cverk wrote on Monday, November 28, 2011:

That didn’t work either, so it doesn’t appear to be anything I may have changed.  I manually counted 48 instances of patient_edu_amc in the database and yet my numerator on AMC reporting comes up as 1.  The one is very weird, because I can not find one in the database that looks any different than any of the others.  I think for meaningful use I can just count them manually, but maybe I can help narrow it down to get this to work for others.

yehster wrote on Monday, November 28, 2011:

Cverk,
You are correct and do not have to use the numbers generated by AMC from OpenEMR when attesting.  It makes sense, since a combination of certified and non-certified workflows (e.g. hand written prescriptions) can be used to achieve MU.  So it also seems that while it would make your numbers for AMC in OpenEMR incorrect, if you don’t enter the prescriptions you generate in Allscripts back into OpenEMR, as long as you have a way of tracking the numerator and denominator for the ePrescribing metric, you are ok.

Running SQL queries or other methods of inspection for generating numbers for attestation is valid for everything except CQM according to CMS.

https://questions.cms.hhs.gov/app/answers/detail/a_id/10589/~/%5Behr-incentive-program%5D-to-what-attestation-statements-must-an-ep,-agree-in
Excerpt:
By definition, for each meaningful use objective with a percentage-based measure, certified EHR technology must include the capability to electronically record the numerator and denominator and generate a report including the numerator, denominator, and resulting percentage for these measures. However, with the exception of CQMs, meaningful use measures do not specify that this capability must be used to calculate the numerators and denominators. EPs, eligible hospitals, and CAHs **can use a separate, uncertified system **to calculate numerators and denominators and to generate reports on all measures of the core and menu set meaningful use objectives except CQMs.

-Kevin Yeh
kevin.y@intergralemr.com

cverk wrote on Monday, December 05, 2011:

With my sons help, attached is a sql query to count the numerators for patient_edu_amc for the last 3 months of the year.

SELECT Count(AM.pid) as CountPatients FROM `amc_misc_data` AM inner join `form_encounter` FE on FE.pid = AM.pid and FE.encounter=AM.map_id  WHERE FE.date >= ‘2011-10-01’ and FE.date < ‘2012-01-01’ and AM.amc_id = ‘patient_edu_amc’

It appears the current AMC report is running a seperate query for each patient in the database, which gives the timing out problem and causes the calculation to run forever. I don’t know how you would code this type of query into php for the AMC302m numerator to make it work . It seems a series of these type of querys might run all the calculations that are timing out, much more quickly. It does appear that with a large patient database that the current code only counts patient education events that are outside the dates specified as a numerator. So perhaps there is an error in how the date range is calculated?
  I am only postulating, but maybe this basic idea would help the patient reminder and CQM calculations as well.

toddjones wrote on Tuesday, February 28, 2012:

is there an easy way to integrate Pentahoe.  We would like to use it on the back end.  I found this http://www.open-emr.org/wiki/index.php/Mapping_OpenEMR_Data_for_CCD/CCR_and_CQM but looks like it was not completed.

rpl121 wrote on Friday, November 15, 2013:

My fairly recent version of OpenEMR still has the scoring bug for AMC_302m (the patient education measure.) I found a fix:

Go to /openemr/library/classes/rulesets/AMC/reports/AMC_302m folder and edit the Numerator.php so that the SQL query does not include a pid restriction. Here is the diff file. With this fix it works great.

24c24

                     "WHERE enc.pid = amc.pid " .

< "WHERE enc.pid = amc.pid = ? " .

Ronald Leemhuis MD

bradymiller wrote on Sunday, November 17, 2013:

Hi,

What is your OpenEMR version. This should of fixed it here:

Which is in 4.1.2 and should be in most recent 4.1.1 patch.

-brady
OpenEMR