3 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 class CqmResult
implements RsResultIF
13 public $numeratorLabel;
14 public $populationLabel;
16 public $totalPatients; // Total number of patients considered
17 public $ipp; // Number of patients that pass filter (Initial patient populaton)
18 public $denominator; // Number of patients passes after denominator condition
19 public $denom_exclusion; // Number of patients that are excluded
20 public $denom_exception; // Number of patients that added into exception
21 public $numerator; // Number of patients that pass target
22 public $percentage; // Calculated percentage
24 public $itemized_test_id;
26 public function __construct($rowRule, $numeratorLabel, $populationLabel, $totalPatients, $denominator, $denom_exclusion, $numerator, $percentage, $ipp, $denom_exception)
28 $this->rule
= $rowRule;
29 $this->numeratorLabel
= $numeratorLabel;
30 $this->populationLabel
= $populationLabel;
31 $this->totalPatients
= $totalPatients;
32 $this->denominator
= $denominator;
34 $this->denom_exclusion
= $denom_exclusion;
35 $this->denom_exception
= $denom_exception;
36 $this->numerator
= $numerator;
37 $this->percentage
= $percentage;
39 // If itemization is turned on, then record the itemized_test_id
40 if ($GLOBALS['report_itemizing_temp_flag_and_id']) {
41 $this->itemized_test_id
= array('itemized_test_id' => $GLOBALS['report_itemized_test_id_iterator']);
45 public function format()
47 $concatenated_label = '';
48 if ($this->numeratorLabel
!= "Numerator") {
49 if ($this->populationLabel
!= "Population Criteria") {
50 $concatenated_label = $this->populationLabel
. ", " . $this->numeratorLabel
;
52 $concatenated_label = $this->numeratorLabel
;
55 if ($this->populationLabel
!= "Population Criteria") {
56 $concatenated_label = $this->populationLabel
;
61 'is_main' => true, // TO DO: figure out way to do this when multiple groups.
62 'population_label' => $this->populationLabel
,
63 'numerator_label' => $this->numeratorLabel
,
64 'concatenated_label' => $concatenated_label,
65 'total_patients' => $this->totalPatients
,
66 'excluded' => $this->denom_exclusion
,
67 'pass_filter' => $this->denominator
,
68 'pass_target' => $this->numerator
,
69 'percentage' => $this->percentage
,
70 'initial_population' => $this->ipp
,
71 'exception' => $this->denom_exception
);
72 $rowFormat = array_merge($rowFormat, $this->rule
);
74 // If itemization is turned on, then record the itemized_test_id
75 if ($GLOBALS['report_itemizing_temp_flag_and_id']) {
76 $rowFormat = array_merge($rowFormat, $this->itemized_test_id
);