Exemplo n.º 1
0
 function testGetWards()
 {
     $wards = WardCRUD::getWardsArray();
     $this->assertTrue(count($wards) > 0);
     $ward = (object) $wards[0];
     $this->assertEquals($ward->getName(), "Oddział Anestezjologii i Intensywnej Terapii");
 }
Exemplo n.º 2
0
 public static function getWardsArray()
 {
     if (WardCRUD::$wardsArray == null) {
         $entityManager = (object) DoctrineBootstrap::getEntityManager();
         $query = $entityManager->createQuery('select w FROM Hospitalplugin\\Entities\\Ward w ORDER BY w.name');
         $wards = $query->getResult();
         WardCRUD::$wardsArray = $wards;
     }
     return WardCRUD::$wardsArray;
 }
Exemplo n.º 3
0
 public static function load($yaml, $class, $dir)
 {
     try {
         $em = DoctrineBootstrap::getEntityManager();
         $userId = $userId = wp_get_current_user()->ID;
         $ward = WardCRUD::getWardForUser($userId);
         $user = $em->find("\\Hospitalplugin\\Entities\\User", $userId);
         if (!empty($_POST)) {
             $args = $_POST;
             $i = new $class($args);
             $i->setWard($ward);
             $i->setUser($user);
             $em->persist($i);
             $em->flush();
         } else {
             $object = \Hospitalplugin\utils\YAML2Object::getObject($yaml);
             echo PLTwig::load($dir)->render('form.twig', array('infections' => $object));
         }
     } catch (Exception $e) {
         echo "ERR: " . $e;
     }
 }
 static function fillData($objPHPExcel)
 {
     // no time limit for this script
     set_time_limit(0);
     $time_start = microtime(true);
     // remove first default sheet
     $objPHPExcel->removeSheetByIndex(0);
     // get wards
     $wards = WardCRUD::getWardsArray();
     foreach ($wards as $ward) {
         ExcelExport::newSheet($objPHPExcel);
         $wardName = $ward->name . " (" . $ward->getTypOddzialu() . ")";
         ExcelExport::printTitle($objPHPExcel, $wardName);
         $data = ExcelExportPunction::getData($ward->id, $ward->getTypOddzialu());
         $cols = PatientRaport::getColumns($ward->getTypOddzialu());
         ExcelExportPunction::printHeaders($objPHPExcel, $cols);
         ExcelExportPunction::printData($objPHPExcel, $data, $ward->getTypOddzialu());
         ExcelExport::styleActiveSheet($objPHPExcel);
     }
     ExcelExportPunction::fillSummary($objPHPExcel);
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 100, "summary " . ($time_start - microtime(true)) . " s");
 }