public function flowSheetTemplateAction()
 {
     $personId = (int) $this->_getParam('personId');
     $patient = new Patient();
     $patient->personId = $personId;
     $patient->populate();
     $vitalSignIter = new VitalSignGroupsIterator();
     $vitalSignIter->setFilter(array("personId" => $personId));
     $xmlData = PdfController::toXML($patient, 'Patient', null);
     $xmlData .= "<VitalSignGroups>";
     $loop = 0;
     foreach ($vitalSignIter as $vitalGroup) {
         $xmlData .= PdfController::toXML($vitalGroup, 'VitalSignGroup', null);
         if ($loop > 5) {
             exit;
         }
         $loop++;
     }
     $xmlData .= "</VitalSignGroups>";
     //header('Content-type: text/xml;');
     //echo $xmlData;exit;
     $this->_forward('pdf-merge-attachment', 'pdf', null, array('attachmentReferenceId' => '5', 'xmlData' => $xmlData));
 }
 public function getPrescriptionPdfAction()
 {
     $medicationIds = explode(',', $this->_getParam('medicationId', ''));
     $xmlData = '';
     foreach ($medicationIds as $medicationId) {
         $medicationId = (int) $medicationId;
         if (!$medicationId > 0) {
             continue;
         }
         $medication = new Medication();
         $medication->medicationId = $medicationId;
         $medication->populate();
         $xmlData .= PdfController::toXML($medication, 'Medication', null);
     }
     //ff560b50-75d0-11de-8a39-0800200c9a66 is uuid for prescription PDF
     $this->_forward('pdf-merge-attachment', 'pdf', null, array('attachmentReferenceId' => 'ff560b50-75d0-11de-8a39-0800200c9a66', 'xmlData' => $xmlData));
 }