public function listPatientVitalsAction() { $personId = (int) $this->_getParam('personId'); $rows = array(); if ($personId > 0) { foreach (VitalSignGroup::getMostRecentVitalsForPatientId($personId) as $row) { $value = $row['value']; $ussValue = $value; $metricValue = ''; $convertible = 0; if (strlen($row['units']) > 0) { if (strlen($ussValue) > 0) { $ussValue .= ' ' . $row['units']; } $ret = VitalSignValue::convertValues($row['vital'], $value, $row['units']); if ($ret !== false) { $ussValue = $ret['uss']; $metricValue = $ret['metric']; $convertible = 1; } } $tmp = array(); $tmp['id'] = $row['vitalSignValueId']; $tmp['data'][] = date('n/j/Y h:i:s A', strtotime($row['dateTime'])); $tmp['data'][] = $row['vital']; $tmp['data'][] = $ussValue; $tmp['data'][] = $metricValue; $tmp['data'][] = ''; // to be implemented $tmp['data'][] = $row['last_name'] . ',' . $row['first_name'] . ' ' . $row['middle_name']; $tmp['data'][] = $convertible; $rows[] = $tmp; } } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct(array('rows' => $rows)); }