Ejemplo n.º 1
0
 /**
  * Glycemic Control Algorithm Test bench
  * 
  * Creates algorithm object, sets algorithm parameters, runs algorithm and returns the algorithm object.
  *
  * @param $testNumber -
  * @param $a1c          - current a1c value
  * @param $a1clast      - last a1c value
  * @param $a1cTarget    - a1c target value
  * @param $symptoms     - Type II diabetes symptoms (true/false)
  * @param $allergies    - patient drug allergies
  * @param $med1			- previous medicine 1
  * @param $med2			- previous medicine 2
  * @param $med3			- previous medicine 3
  * @param $medhistory	- patient medical history
  */
 function algTest($testNumber, $a1c, $a1clast, $a1cTarget, $symptoms, $allergies, $med1, $med2, $med3, $medhistory)
 {
     echo "<br>";
     echo "Test Number ";
     echo $testNumber;
     echo "<br>";
     $alg1 = new algorithm();
     // set A1c values
     $alg1->setA1C($a1c);
     $alg1->setA1Clast($a1clast);
     $alg1->setA1CTarget($a1cTarget);
     $alg1->setSymptoms($symptoms);
     // Set allergies
     $alg1->setAllergies($allergies);
     // Set medicines
     $alg1->setMedicine1($med1);
     $alg1->setMedicine2($med2);
     $alg1->setMedicine3($med3);
     // set medical history
     $alg1->setMedhistory($medhistory);
     // print a1c values
     $alg1->printA1C();
     $alg1->printAllergies();
     echo "<br>";
     // run algorithm and print results
     $alg1->gcAlgorithm();
     echo "Results:";
     echo "<br>";
     $alg1->printResults();
     return $alg1;
 }