Difference between revisions of "Description AMC"

From OpenEMR Project Wiki
Line 1: Line 1:
== Patient(s) selection ==
== Patient(s) selection ==
The first thing that is done is the selection of patients if a physician is chosen for the calculations.
The first thing that is done is the selection of patients '''if a physician is chosen for the calculations'''.
:*Pertinent code from the library/clinical_rules.php file (test_rules_clinic() function)
:*Pertinent code from the library/clinical_rules.php file (test_rules_clinic() function)
<pre>
<pre>

Revision as of 09:22, 6 October 2011

Patient(s) selection

The first thing that is done is the selection of patients if a physician is chosen for the calculations.

  • Pertinent code from the library/clinical_rules.php file (test_rules_clinic() function)
  // 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;
      }
    }
  }