public function filterDemographicsAction()
 {
     $psd = new PatientStatisticsDefinition();
     $psdIterator = $psd->getAllActive();
     $demographics = array('age' => array('name' => 'Age', 'type' => ''), 'gender' => array('name' => 'Gender', 'type' => PatientStatisticsDefinition::TYPE_ENUM, 'options' => Enumeration::getEnumArray('Gender', 'key')), 'marital_status' => array('name' => 'Marital Status', 'type' => PatientStatisticsDefinition::TYPE_ENUM, 'options' => Enumeration::getEnumArray('Marital Status', 'key')));
     foreach ($psdIterator as $row) {
         $tmp = array();
         $tmp['name'] = GrowthChartBase::prettyName($row->name);
         $options = array();
         if ($row->type == PatientStatisticsDefinition::TYPE_ENUM) {
             $enumerationClosure = new EnumerationClosure();
             $options = $enumerationClosure->generatePathsKeyName($row->value);
         }
         $tmp['type'] = $row->type;
         asort($options);
         $tmp['options'] = $options;
         $demographics[$row->name] = $tmp;
     }
     $this->view->demographics = $demographics;
     $this->view->filters = $this->_session->filters['demographics'];
     $operators = array('' => '');
     foreach (Claim::balanceOperators() as $key => $value) {
         $operators[$key] = $value;
     }
     $this->view->operators = $operators;
     $this->render();
 }
예제 #2
0
 public function listStatsAction()
 {
     $statisticsStoreKeyAsValue = (string) Zend_Registry::get('config')->statisticsStoreKeyAsValue == 'true' ? true : false;
     $personId = (int) $this->_getParam('personId');
     $psd = new PatientStatisticsDefinition();
     $stats = PatientStatisticsDefinition::getPatientStatistics($personId);
     $psdIterator = $psd->getAllActive();
     $rows = array();
     foreach ($psdIterator as $row) {
         $tmp = array();
         $tmp['id'] = $row->name;
         $tmp['data'] = array();
         $tmp['data'][] = GrowthChartBase::prettyName($row->name);
         $val = isset($stats[$row->name]) ? $stats[$row->name] : '';
         $tmp['userdata']['value'] = $val;
         $options = array();
         if ($row->type == PatientStatisticsDefinition::TYPE_ENUM) {
             $enumerationClosure = new EnumerationClosure();
             $paths = $enumerationClosure->generatePathsKeyName($row->value);
             foreach ($paths as $id => $name) {
                 if ($statisticsStoreKeyAsValue && $val == $id) {
                     $val = $name;
                 }
                 $options[] = array('key' => $id, 'value' => $name);
             }
         }
         $tmp['data'][] = $val;
         $tmp['userdata']['type'] = $row->type;
         $tmp['userdata']['options'] = $options;
         $rows[] = $tmp;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows));
 }