public function addAction()
 {
     $personId = (int) $this->_getParam('personId');
     $this->_form = new WebVista_Form(array('name' => 'vs-add-form'));
     $this->_form->setWindow('windowAddVitalSignsId');
     $this->_form->setWindowAction(WebVista_Form::WINDOW_CLOSE);
     $vitalSignTemplate = new VitalSignTemplate();
     $vitalSignTemplate->vitalSignTemplateId = 1;
     $vitalSignTemplate->populate();
     $template = simplexml_load_string($vitalSignTemplate->template);
     $this->_form->setAction(Zend_Registry::get('baseUrl') . "vital-signs.raw/process-add");
     $this->_buildForm($template);
     $element = $this->_form->createElement("hidden", 'vitalSignTemplateId', array('value' => $vitalSignTemplate->vitalSignTemplateId));
     $element->setBelongsTo('vitalSignGroup');
     $this->_form->addElement($element);
     $element = $this->_form->createElement("hidden", 'personId', array('value' => $personId));
     $element->setBelongsTo('vitalSignGroup');
     $this->_form->addElement($element);
     $this->view->form = $this->_form;
     $this->view->jsCallback = $this->_getParam('jsCallback', '');
     $this->render();
 }
 protected function getVitalSignsTemplateKeyValue($vitalSignTemplateId = 1)
 {
     $vitalSignTemplate = new VitalSignTemplate();
     $vitalSignTemplate->vitalSignTemplateId = $vitalSignTemplateId;
     $vitalSignTemplate->populate();
     $template = simplexml_load_string($vitalSignTemplate->template);
     $vitals = array();
     foreach ($template as $vital) {
         $title = (string) $vital->attributes()->title;
         $vitals[$title] = (string) $vital->attributes()->label;
     }
     return $vitals;
 }