AMC reporting for multi doctor specialty

tmccormi wrote on Thursday, July 26, 2012:

I think that the AMC calculation is assuming that there is a single provider assigned to each patient.  Which is fine in a primary care office but not in a specialty radiology office (or any place where a patient is routinely seen by different doctors).  The ONC rules allow the doctors to share a patient and have it be counted.  

So… we need option called “Patients Shared for AMC” in globals, and we need to modify the AMC report to count unique patients that have encounters assigned to a Provider for the calculation if the option is checked.  

We are working on a proposed solution, I will submit this change to the public for review when I get it.  

Tony

bradymiller wrote on Thursday, July 26, 2012:

Hi Tony,

Rather than a global, more straightforward to make this an option in the report:
1. Add option to report (ie. a select menu):
reports/cqm.php
2. Add a new parameter to test_rules_clinic (maybe $pat_prov_rel) in library/clinical_rules.php to bring this option into function.
3. Use the new parameter in the test_rules_clinic function at:

  // Collect all patient ids
  $patientData = array();
  if (!empty($patient_id)) {
    // only look at the selected patient
    $patientData[0]['pid'] = $patient_id;
  }
  else {
    if (empty($provider)) {
      // Look at entire practice
      $rez = sqlStatement("SELECT `pid` FROM `patient_data`");
      for($iter=0; $row=sqlFetchArray($rez); $iter++) {
       $patientData[$iter]=$row;
      } 
    }
    else {
      // Look at one provider
      $rez = sqlStatement("SELECT `pid` FROM `patient_data` " .
        "WHERE providerID=?", array($provider) );
      for($iter=0; $row=sqlFetchArray($rez); $iter++) {
       $patientData[$iter]=$row;
      }
    }
  }

Doing this is much better than a global, because then it won’t muck up the other stuff that uses this engine (also gives practices easy way to play around with them and choose the one that works best). Also then can be used in CQM and standard CDR reports too (without any additional work).

-brady
OpenEMR

tmccormi wrote on Wednesday, August 15, 2012:

Brady… This was posted 13 days ago, it a change to meet you desired model.  Please take a look at it.
https://github.com/anilnakkani/openemr/commit/32c18a28b87276ec8ce60f321ed236457e4242b5
-Tony

bradymiller wrote on Thursday, August 16, 2012:

Hi Tony,
Will review it over the weekend (looks good, but I may slightly modify it, so that it will be an option for all of the reports (standard,AMC,CQM).
-brady

bradymiller wrote on Friday, August 17, 2012:

Hi Tony and Ensoftek,

Placed a heavily modified version of this code here:
http://github.com/bradymiller/openemr/commits/amc-prov-rel_1
(it allows choosing ‘Primary’ or ‘Encounter’ which are described when hover over the selection in all of the reports(standard,AMC,CQM))

It is testing well and plan to commit to both master and rel-411 branches (not having this option has been considered a bug by some, which is why placing in rel-411).

-brady
OpenEMR

tmccormi wrote on Saturday, August 18, 2012:

Excellent - Thanks man!
-Tony

bradymiller wrote on Saturday, August 18, 2012:

Hi,

Just committed this, but realized probably makes sense to check the supervisor_id column in form_encounter also for the provider id (this will be an extremely simple thing to add). Will plan to add this over the weekend, so let me know before then if there are any potential issues with doing that. Note with the current mechanism, also easy to add additional selections (for example, if want a minimum number of encounters or want providers that either are in an encounter or assigned as providers, etc.).

-brady
OpenEMR

bradymiller wrote on Saturday, August 18, 2012:

Hi,
Just committed the supervisor_id fix to sourceforge(both master and rel-411).
-brady
OpenEMR