@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public $edukacjaIWsparciePsychiczne; |
| 82 | 82 | // |
| 83 | 83 | /** |
| 84 | - * @return aktywnoscFizyczna |
|
| 84 | + * @return integer |
|
| 85 | 85 | */ |
| 86 | 86 | public function getAktywnoscFizyczna() |
| 87 | 87 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * @return higiena |
|
| 102 | + * @return integer |
|
| 103 | 103 | */ |
| 104 | 104 | public function getHigiena() |
| 105 | 105 | { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | - * @return odzywianie |
|
| 120 | + * @return integer |
|
| 121 | 121 | */ |
| 122 | 122 | public function getOdzywianie() |
| 123 | 123 | { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | - * @return wydalanie |
|
| 138 | + * @return integer |
|
| 139 | 139 | */ |
| 140 | 140 | public function getWydalanie() |
| 141 | 141 | { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * @return pomiarObjawowZyciowych |
|
| 156 | + * @return integer |
|
| 157 | 157 | */ |
| 158 | 158 | public function getPomiarObjawowZyciowych() |
| 159 | 159 | { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * @return leczenie |
|
| 174 | + * @return integer |
|
| 175 | 175 | */ |
| 176 | 176 | public function getLeczenie() |
| 177 | 177 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | - * @return edukacjaIWsparciePsychiczne |
|
| 192 | + * @return integer |
|
| 193 | 193 | */ |
| 194 | 194 | public function getEdukacjaIWsparciePsychiczne() |
| 195 | 195 | { |
@@ -17,6 +17,7 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | /** |
| 19 | 19 | * |
| 20 | + * @param integer $num |
|
| 20 | 21 | */ |
| 21 | 22 | public static function getColumnLetter($num) { |
| 22 | 23 | return chr ( 65 + $num ); |
@@ -38,6 +39,8 @@ discard block |
||
| 38 | 39 | ExcelExport::downloadExcel ( $objPHPExcel, $dataSetName . '.xlsx' ); |
| 39 | 40 | } |
| 40 | 41 | /** |
| 42 | + * @param string $cells |
|
| 43 | + * @param string $color |
|
| 41 | 44 | */ |
| 42 | 45 | static function cellColor($objPHPExcel, $cells, $color) { |
| 43 | 46 | $objPHPExcel->getActiveSheet ()->getStyle ( $cells )->getFill ()->applyFromArray ( array ( |
@@ -69,7 +72,8 @@ discard block |
||
| 69 | 72 | } |
| 70 | 73 | /** |
| 71 | 74 | * |
| 72 | - * @param unknown $objPHPExcel |
|
| 75 | + * @param \PHPExcel $objPHPExcel |
|
| 76 | + * @param string $filename |
|
| 73 | 77 | */ |
| 74 | 78 | private static function downloadExcel($objPHPExcel, $filename) { |
| 75 | 79 | ob_end_clean (); |
@@ -89,7 +93,8 @@ discard block |
||
| 89 | 93 | } |
| 90 | 94 | /** |
| 91 | 95 | * remove special chars and words from string |
| 92 | - * @param unknown $string |
|
| 96 | + * @param unknown $string |
|
| 97 | + * @param string[] $removeWords |
|
| 93 | 98 | */ |
| 94 | 99 | private static function clearName($string, $removeWords) { |
| 95 | 100 | $string = str_replace ( ' ', '-', $string ); |
@@ -102,7 +107,7 @@ discard block |
||
| 102 | 107 | } |
| 103 | 108 | /** |
| 104 | 109 | * @param unknown $objPHPExcel |
| 105 | - * @param unknown $title |
|
| 110 | + * @param string $title |
|
| 106 | 111 | */ |
| 107 | 112 | static function printTitle($objPHPExcel, $title) { |
| 108 | 113 | $objPHPExcel->getActiveSheet ()->setTitle ( ExcelExport::clearName ( $title, array('ddzia') ), true ); |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Hospitalplugin\utils; |
| 4 | 4 | |
| 5 | -use Hospitalplugin\Entities\InfectionsCRUD; |
|
| 6 | 5 | use Hospitalplugin\Entities\Infections; |
| 7 | 6 | |
| 8 | 7 | class ExcelExport { |
@@ -7,119 +7,119 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ExcelExport { |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - */ |
|
| 12 | - public static function init() { |
|
| 13 | - add_action ( 'admin_init', array ( |
|
| 14 | - 'Hospitalplugin\utils\ExcelExport', |
|
| 15 | - 'excel_export' |
|
| 16 | - ), 1 ); |
|
| 17 | - } |
|
| 18 | - /** |
|
| 19 | - * |
|
| 20 | - */ |
|
| 21 | - public static function getColumnLetter($num) { |
|
| 22 | - return chr ( 65 + $num ); |
|
| 23 | - } |
|
| 24 | - /** |
|
| 25 | - */ |
|
| 26 | - static function excel_export() { |
|
| 27 | - if (! isset ( $_POST ['excel'] )) { |
|
| 28 | - return; |
|
| 29 | - } else { |
|
| 30 | - // dataSetName: Infections, Punction |
|
| 31 | - $dataSetName = $_POST ['dataSetName']; |
|
| 32 | - $classname = '\Hospitalplugin\utils\ExcelExport' . $dataSetName; |
|
| 33 | - } |
|
| 10 | + /** |
|
| 11 | + */ |
|
| 12 | + public static function init() { |
|
| 13 | + add_action ( 'admin_init', array ( |
|
| 14 | + 'Hospitalplugin\utils\ExcelExport', |
|
| 15 | + 'excel_export' |
|
| 16 | + ), 1 ); |
|
| 17 | + } |
|
| 18 | + /** |
|
| 19 | + * |
|
| 20 | + */ |
|
| 21 | + public static function getColumnLetter($num) { |
|
| 22 | + return chr ( 65 + $num ); |
|
| 23 | + } |
|
| 24 | + /** |
|
| 25 | + */ |
|
| 26 | + static function excel_export() { |
|
| 27 | + if (! isset ( $_POST ['excel'] )) { |
|
| 28 | + return; |
|
| 29 | + } else { |
|
| 30 | + // dataSetName: Infections, Punction |
|
| 31 | + $dataSetName = $_POST ['dataSetName']; |
|
| 32 | + $classname = '\Hospitalplugin\utils\ExcelExport' . $dataSetName; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - $objPHPExcel = new \PHPExcel (); |
|
| 36 | - $classname::fillData ( $objPHPExcel ); |
|
| 35 | + $objPHPExcel = new \PHPExcel (); |
|
| 36 | + $classname::fillData ( $objPHPExcel ); |
|
| 37 | 37 | |
| 38 | - ExcelExport::downloadExcel ( $objPHPExcel, $dataSetName . '.xlsx' ); |
|
| 39 | - } |
|
| 40 | - /** |
|
| 41 | - */ |
|
| 42 | - static function cellColor($objPHPExcel, $cells, $color) { |
|
| 43 | - $objPHPExcel->getActiveSheet ()->getStyle ( $cells )->getFill ()->applyFromArray ( array ( |
|
| 44 | - 'type' => \PHPExcel_Style_Fill::FILL_SOLID, |
|
| 45 | - 'startcolor' => array ( |
|
| 46 | - 'rgb' => $color |
|
| 47 | - ) |
|
| 48 | - ) ); |
|
| 49 | - } |
|
| 50 | - /** |
|
| 51 | - */ |
|
| 52 | - static function styleActiveSheet($objPHPExcel) { |
|
| 53 | - $objPHPExcel->getActiveSheet ()->getDefaultStyle ()->getFont ()->setName ( 'Arial' )->setSize ( 8 )->setBold ( false ); |
|
| 54 | - $objPHPExcel->getActiveSheet ()->getDefaultStyle ()->getNumberFormat ()->setFormatCode ( \PHPExcel_Style_NumberFormat::FORMAT_TEXT ); |
|
| 55 | - $objPHPExcel->getActiveSheet ()->freezePane ( 'A3' ); |
|
| 56 | - $style = array ( |
|
| 57 | - 'alignment' => array ( |
|
| 58 | - 'horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, |
|
| 59 | - 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER |
|
| 60 | - ) |
|
| 61 | - ); |
|
| 62 | - $objWorksheet = $objPHPExcel->getActiveSheet (); |
|
| 63 | - $objWorksheet->getDefaultStyle ()->applyFromArray ( $style ); |
|
| 64 | - $objWorksheet->getStyle ( 'A1:AA2' )->getFont ()->setBold ( true ); |
|
| 65 | - for($col = ord ( 'a' ); $col <= ord ( 'z' ); $col ++) { |
|
| 66 | - $objWorksheet->getColumnDimension ( chr ( $col ) )->setAutoSize ( true ); |
|
| 67 | - } |
|
| 68 | - return $objPHPExcel; |
|
| 69 | - } |
|
| 70 | - /** |
|
| 71 | - * |
|
| 72 | - * @param unknown $objPHPExcel |
|
| 73 | - */ |
|
| 74 | - private static function downloadExcel($objPHPExcel, $filename) { |
|
| 75 | - ob_end_clean (); |
|
| 76 | - ob_start (); |
|
| 77 | - header ( "Content-type: application/vnd.ms-excel; charset=utf-8" ); |
|
| 78 | - header ( "Content-Transfer-Encoding: binary" ); |
|
| 79 | - header ( "Content-Description: File Transfer" ); |
|
| 80 | - header ( "Content-Disposition: attachment; filename=\"" . $filename . "\"" ); |
|
| 81 | - header ( "Cache-Control: max-age=0" ); |
|
| 82 | - header ( "Expires: 0" ); |
|
| 83 | - header ( "Pragma: no-cache" ); |
|
| 38 | + ExcelExport::downloadExcel ( $objPHPExcel, $dataSetName . '.xlsx' ); |
|
| 39 | + } |
|
| 40 | + /** |
|
| 41 | + */ |
|
| 42 | + static function cellColor($objPHPExcel, $cells, $color) { |
|
| 43 | + $objPHPExcel->getActiveSheet ()->getStyle ( $cells )->getFill ()->applyFromArray ( array ( |
|
| 44 | + 'type' => \PHPExcel_Style_Fill::FILL_SOLID, |
|
| 45 | + 'startcolor' => array ( |
|
| 46 | + 'rgb' => $color |
|
| 47 | + ) |
|
| 48 | + ) ); |
|
| 49 | + } |
|
| 50 | + /** |
|
| 51 | + */ |
|
| 52 | + static function styleActiveSheet($objPHPExcel) { |
|
| 53 | + $objPHPExcel->getActiveSheet ()->getDefaultStyle ()->getFont ()->setName ( 'Arial' )->setSize ( 8 )->setBold ( false ); |
|
| 54 | + $objPHPExcel->getActiveSheet ()->getDefaultStyle ()->getNumberFormat ()->setFormatCode ( \PHPExcel_Style_NumberFormat::FORMAT_TEXT ); |
|
| 55 | + $objPHPExcel->getActiveSheet ()->freezePane ( 'A3' ); |
|
| 56 | + $style = array ( |
|
| 57 | + 'alignment' => array ( |
|
| 58 | + 'horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, |
|
| 59 | + 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER |
|
| 60 | + ) |
|
| 61 | + ); |
|
| 62 | + $objWorksheet = $objPHPExcel->getActiveSheet (); |
|
| 63 | + $objWorksheet->getDefaultStyle ()->applyFromArray ( $style ); |
|
| 64 | + $objWorksheet->getStyle ( 'A1:AA2' )->getFont ()->setBold ( true ); |
|
| 65 | + for($col = ord ( 'a' ); $col <= ord ( 'z' ); $col ++) { |
|
| 66 | + $objWorksheet->getColumnDimension ( chr ( $col ) )->setAutoSize ( true ); |
|
| 67 | + } |
|
| 68 | + return $objPHPExcel; |
|
| 69 | + } |
|
| 70 | + /** |
|
| 71 | + * |
|
| 72 | + * @param unknown $objPHPExcel |
|
| 73 | + */ |
|
| 74 | + private static function downloadExcel($objPHPExcel, $filename) { |
|
| 75 | + ob_end_clean (); |
|
| 76 | + ob_start (); |
|
| 77 | + header ( "Content-type: application/vnd.ms-excel; charset=utf-8" ); |
|
| 78 | + header ( "Content-Transfer-Encoding: binary" ); |
|
| 79 | + header ( "Content-Description: File Transfer" ); |
|
| 80 | + header ( "Content-Disposition: attachment; filename=\"" . $filename . "\"" ); |
|
| 81 | + header ( "Cache-Control: max-age=0" ); |
|
| 82 | + header ( "Expires: 0" ); |
|
| 83 | + header ( "Pragma: no-cache" ); |
|
| 84 | 84 | |
| 85 | - $objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' ); |
|
| 86 | - $objWriter->setPreCalculateFormulas ( true ); |
|
| 87 | - $objWriter->save ( 'php://output' ); |
|
| 88 | - exit (); |
|
| 89 | - } |
|
| 90 | - /** |
|
| 91 | - * remove special chars and words from string |
|
| 92 | - * @param unknown $string |
|
| 93 | - */ |
|
| 94 | - private static function clearName($string, $removeWords) { |
|
| 95 | - $string = str_replace ( ' ', '-', $string ); |
|
| 96 | - $string = preg_replace ( '/[^A-Za-z0-9\-]/', '', $string ); |
|
| 97 | - foreach ( $removeWords as $word ) { |
|
| 98 | - $string = str_replace ( $word, '', $string ); |
|
| 99 | - } |
|
| 100 | - $string = substr ( $string, 0, 29 ); |
|
| 101 | - return $string; |
|
| 102 | - } |
|
| 103 | - /** |
|
| 104 | - * @param unknown $objPHPExcel |
|
| 105 | - * @param unknown $title |
|
| 106 | - */ |
|
| 107 | - static function printTitle($objPHPExcel, $title) { |
|
| 108 | - $objPHPExcel->getActiveSheet ()->setTitle ( ExcelExport::clearName ( $title, array('ddzia') ), true ); |
|
| 109 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
|
| 110 | - } |
|
| 111 | - /** |
|
| 112 | - * |
|
| 113 | - * @param unknown $objPHPExcel |
|
| 114 | - */ |
|
| 115 | - static function newSheet($objPHPExcel, $index = -1) { |
|
| 116 | - if ($index < 0) { |
|
| 117 | - $index = $objPHPExcel->getSheetCount (); |
|
| 118 | - } |
|
| 119 | - $objPHPExcel->createSheet ( $index ); |
|
| 120 | - $objPHPExcel->setActiveSheetIndex ( $index ); |
|
| 121 | - $sheet = $objPHPExcel->getActiveSheet (); |
|
| 122 | - return $sheet; |
|
| 123 | - } |
|
| 85 | + $objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' ); |
|
| 86 | + $objWriter->setPreCalculateFormulas ( true ); |
|
| 87 | + $objWriter->save ( 'php://output' ); |
|
| 88 | + exit (); |
|
| 89 | + } |
|
| 90 | + /** |
|
| 91 | + * remove special chars and words from string |
|
| 92 | + * @param unknown $string |
|
| 93 | + */ |
|
| 94 | + private static function clearName($string, $removeWords) { |
|
| 95 | + $string = str_replace ( ' ', '-', $string ); |
|
| 96 | + $string = preg_replace ( '/[^A-Za-z0-9\-]/', '', $string ); |
|
| 97 | + foreach ( $removeWords as $word ) { |
|
| 98 | + $string = str_replace ( $word, '', $string ); |
|
| 99 | + } |
|
| 100 | + $string = substr ( $string, 0, 29 ); |
|
| 101 | + return $string; |
|
| 102 | + } |
|
| 103 | + /** |
|
| 104 | + * @param unknown $objPHPExcel |
|
| 105 | + * @param unknown $title |
|
| 106 | + */ |
|
| 107 | + static function printTitle($objPHPExcel, $title) { |
|
| 108 | + $objPHPExcel->getActiveSheet ()->setTitle ( ExcelExport::clearName ( $title, array('ddzia') ), true ); |
|
| 109 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
|
| 110 | + } |
|
| 111 | + /** |
|
| 112 | + * |
|
| 113 | + * @param unknown $objPHPExcel |
|
| 114 | + */ |
|
| 115 | + static function newSheet($objPHPExcel, $index = -1) { |
|
| 116 | + if ($index < 0) { |
|
| 117 | + $index = $objPHPExcel->getSheetCount (); |
|
| 118 | + } |
|
| 119 | + $objPHPExcel->createSheet ( $index ); |
|
| 120 | + $objPHPExcel->setActiveSheetIndex ( $index ); |
|
| 121 | + $sheet = $objPHPExcel->getActiveSheet (); |
|
| 122 | + return $sheet; |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | \ No newline at end of file |
@@ -10,60 +10,60 @@ discard block |
||
| 10 | 10 | /** |
| 11 | 11 | */ |
| 12 | 12 | public static function init() { |
| 13 | - add_action ( 'admin_init', array ( |
|
| 13 | + add_action('admin_init', array( |
|
| 14 | 14 | 'Hospitalplugin\utils\ExcelExport', |
| 15 | 15 | 'excel_export' |
| 16 | - ), 1 ); |
|
| 16 | + ), 1); |
|
| 17 | 17 | } |
| 18 | 18 | /** |
| 19 | 19 | * |
| 20 | 20 | */ |
| 21 | 21 | public static function getColumnLetter($num) { |
| 22 | - return chr ( 65 + $num ); |
|
| 22 | + return chr(65 + $num); |
|
| 23 | 23 | } |
| 24 | 24 | /** |
| 25 | 25 | */ |
| 26 | 26 | static function excel_export() { |
| 27 | - if (! isset ( $_POST ['excel'] )) { |
|
| 27 | + if (!isset ($_POST ['excel'])) { |
|
| 28 | 28 | return; |
| 29 | 29 | } else { |
| 30 | 30 | // dataSetName: Infections, Punction |
| 31 | 31 | $dataSetName = $_POST ['dataSetName']; |
| 32 | - $classname = '\Hospitalplugin\utils\ExcelExport' . $dataSetName; |
|
| 32 | + $classname = '\Hospitalplugin\utils\ExcelExport'.$dataSetName; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - $objPHPExcel = new \PHPExcel (); |
|
| 36 | - $classname::fillData ( $objPHPExcel ); |
|
| 35 | + $objPHPExcel = new \PHPExcel(); |
|
| 36 | + $classname::fillData($objPHPExcel); |
|
| 37 | 37 | |
| 38 | - ExcelExport::downloadExcel ( $objPHPExcel, $dataSetName . '.xlsx' ); |
|
| 38 | + ExcelExport::downloadExcel($objPHPExcel, $dataSetName.'.xlsx'); |
|
| 39 | 39 | } |
| 40 | 40 | /** |
| 41 | 41 | */ |
| 42 | 42 | static function cellColor($objPHPExcel, $cells, $color) { |
| 43 | - $objPHPExcel->getActiveSheet ()->getStyle ( $cells )->getFill ()->applyFromArray ( array ( |
|
| 43 | + $objPHPExcel->getActiveSheet()->getStyle($cells)->getFill()->applyFromArray(array( |
|
| 44 | 44 | 'type' => \PHPExcel_Style_Fill::FILL_SOLID, |
| 45 | - 'startcolor' => array ( |
|
| 45 | + 'startcolor' => array( |
|
| 46 | 46 | 'rgb' => $color |
| 47 | 47 | ) |
| 48 | - ) ); |
|
| 48 | + )); |
|
| 49 | 49 | } |
| 50 | 50 | /** |
| 51 | 51 | */ |
| 52 | 52 | static function styleActiveSheet($objPHPExcel) { |
| 53 | - $objPHPExcel->getActiveSheet ()->getDefaultStyle ()->getFont ()->setName ( 'Arial' )->setSize ( 8 )->setBold ( false ); |
|
| 54 | - $objPHPExcel->getActiveSheet ()->getDefaultStyle ()->getNumberFormat ()->setFormatCode ( \PHPExcel_Style_NumberFormat::FORMAT_TEXT ); |
|
| 55 | - $objPHPExcel->getActiveSheet ()->freezePane ( 'A3' ); |
|
| 56 | - $style = array ( |
|
| 57 | - 'alignment' => array ( |
|
| 53 | + $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setName('Arial')->setSize(8)->setBold(false); |
|
| 54 | + $objPHPExcel->getActiveSheet()->getDefaultStyle()->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_TEXT); |
|
| 55 | + $objPHPExcel->getActiveSheet()->freezePane('A3'); |
|
| 56 | + $style = array( |
|
| 57 | + 'alignment' => array( |
|
| 58 | 58 | 'horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, |
| 59 | 59 | 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER |
| 60 | 60 | ) |
| 61 | 61 | ); |
| 62 | - $objWorksheet = $objPHPExcel->getActiveSheet (); |
|
| 63 | - $objWorksheet->getDefaultStyle ()->applyFromArray ( $style ); |
|
| 64 | - $objWorksheet->getStyle ( 'A1:AA2' )->getFont ()->setBold ( true ); |
|
| 65 | - for($col = ord ( 'a' ); $col <= ord ( 'z' ); $col ++) { |
|
| 66 | - $objWorksheet->getColumnDimension ( chr ( $col ) )->setAutoSize ( true ); |
|
| 62 | + $objWorksheet = $objPHPExcel->getActiveSheet(); |
|
| 63 | + $objWorksheet->getDefaultStyle()->applyFromArray($style); |
|
| 64 | + $objWorksheet->getStyle('A1:AA2')->getFont()->setBold(true); |
|
| 65 | + for ($col = ord('a'); $col <= ord('z'); $col ++) { |
|
| 66 | + $objWorksheet->getColumnDimension(chr($col))->setAutoSize(true); |
|
| 67 | 67 | } |
| 68 | 68 | return $objPHPExcel; |
| 69 | 69 | } |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | * @param unknown $objPHPExcel |
| 73 | 73 | */ |
| 74 | 74 | private static function downloadExcel($objPHPExcel, $filename) { |
| 75 | - ob_end_clean (); |
|
| 76 | - ob_start (); |
|
| 77 | - header ( "Content-type: application/vnd.ms-excel; charset=utf-8" ); |
|
| 78 | - header ( "Content-Transfer-Encoding: binary" ); |
|
| 79 | - header ( "Content-Description: File Transfer" ); |
|
| 80 | - header ( "Content-Disposition: attachment; filename=\"" . $filename . "\"" ); |
|
| 81 | - header ( "Cache-Control: max-age=0" ); |
|
| 82 | - header ( "Expires: 0" ); |
|
| 83 | - header ( "Pragma: no-cache" ); |
|
| 75 | + ob_end_clean(); |
|
| 76 | + ob_start(); |
|
| 77 | + header("Content-type: application/vnd.ms-excel; charset=utf-8"); |
|
| 78 | + header("Content-Transfer-Encoding: binary"); |
|
| 79 | + header("Content-Description: File Transfer"); |
|
| 80 | + header("Content-Disposition: attachment; filename=\"".$filename."\""); |
|
| 81 | + header("Cache-Control: max-age=0"); |
|
| 82 | + header("Expires: 0"); |
|
| 83 | + header("Pragma: no-cache"); |
|
| 84 | 84 | |
| 85 | - $objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' ); |
|
| 86 | - $objWriter->setPreCalculateFormulas ( true ); |
|
| 87 | - $objWriter->save ( 'php://output' ); |
|
| 85 | + $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); |
|
| 86 | + $objWriter->setPreCalculateFormulas(true); |
|
| 87 | + $objWriter->save('php://output'); |
|
| 88 | 88 | exit (); |
| 89 | 89 | } |
| 90 | 90 | /** |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | * @param unknown $string |
| 93 | 93 | */ |
| 94 | 94 | private static function clearName($string, $removeWords) { |
| 95 | - $string = str_replace ( ' ', '-', $string ); |
|
| 96 | - $string = preg_replace ( '/[^A-Za-z0-9\-]/', '', $string ); |
|
| 97 | - foreach ( $removeWords as $word ) { |
|
| 98 | - $string = str_replace ( $word, '', $string ); |
|
| 95 | + $string = str_replace(' ', '-', $string); |
|
| 96 | + $string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); |
|
| 97 | + foreach ($removeWords as $word) { |
|
| 98 | + $string = str_replace($word, '', $string); |
|
| 99 | 99 | } |
| 100 | - $string = substr ( $string, 0, 29 ); |
|
| 100 | + $string = substr($string, 0, 29); |
|
| 101 | 101 | return $string; |
| 102 | 102 | } |
| 103 | 103 | /** |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | * @param unknown $title |
| 106 | 106 | */ |
| 107 | 107 | static function printTitle($objPHPExcel, $title) { |
| 108 | - $objPHPExcel->getActiveSheet ()->setTitle ( ExcelExport::clearName ( $title, array('ddzia') ), true ); |
|
| 109 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
|
| 108 | + $objPHPExcel->getActiveSheet()->setTitle(ExcelExport::clearName($title, array('ddzia')), true); |
|
| 109 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 1, $title); |
|
| 110 | 110 | } |
| 111 | 111 | /** |
| 112 | 112 | * |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | static function newSheet($objPHPExcel, $index = -1) { |
| 116 | 116 | if ($index < 0) { |
| 117 | - $index = $objPHPExcel->getSheetCount (); |
|
| 117 | + $index = $objPHPExcel->getSheetCount(); |
|
| 118 | 118 | } |
| 119 | - $objPHPExcel->createSheet ( $index ); |
|
| 120 | - $objPHPExcel->setActiveSheetIndex ( $index ); |
|
| 121 | - $sheet = $objPHPExcel->getActiveSheet (); |
|
| 119 | + $objPHPExcel->createSheet($index); |
|
| 120 | + $objPHPExcel->setActiveSheetIndex($index); |
|
| 121 | + $sheet = $objPHPExcel->getActiveSheet(); |
|
| 122 | 122 | return $sheet; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -38,12 +38,17 @@ |
||
| 38 | 38 | } |
| 39 | 39 | return $row; |
| 40 | 40 | } |
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * @param string $title |
|
| 44 | + */ |
|
| 41 | 45 | private static function printTitle($objPHPExcel, $title) { |
| 42 | 46 | $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
| 43 | 47 | } |
| 44 | 48 | /** |
| 45 | 49 | * |
| 46 | - * @param PHPExcel $objPHPExcel |
|
| 50 | + * @param PHPExcel $objPHPExcel |
|
| 51 | + * @param integer $row |
|
| 47 | 52 | */ |
| 48 | 53 | private static function printFooter($objPHPExcel, $cols, $row) { |
| 49 | 54 | $objPHPExcel->getActiveSheet ()->getStyle ( 'A' . $row . ':AA' . ($row + 1) )->getFont ()->setBold ( true ); |
@@ -6,62 +6,62 @@ |
||
| 6 | 6 | use Hospitalplugin\Entities\Infections; |
| 7 | 7 | |
| 8 | 8 | class ExcelExportInfections { |
| 9 | - private static function getData() { |
|
| 10 | - $wardId = (! empty ( $_POST ['wardId'] ) ? $_POST ['wardId'] : 0); |
|
| 11 | - $date = (! empty ( $_POST ['date'] ) ? $_POST ['date'] : (new \DateTime ())->format ( "Y-m" )); |
|
| 12 | - $from = new \DateTime ( $date . '-01' ); |
|
| 13 | - $fromStr = $from->format ( 'Y-m-01' ); |
|
| 14 | - $toStr = $from->format ( 'Y-m-t' ); |
|
| 15 | - $infections = InfectionsCRUD::getInfections ( $fromStr, $toStr, $wardId, 'Infections' ); |
|
| 16 | - return $infections; |
|
| 17 | - } |
|
| 18 | - private static function getColumns() { |
|
| 19 | - return Infections::getFields (); |
|
| 20 | - } |
|
| 21 | - private static function printHeaders($objPHPExcel, $cols) { |
|
| 22 | - $count = 0; |
|
| 23 | - foreach ( $cols as $col => $sym ) { |
|
| 24 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, 2, sprintf ( "%7s", $col ) ); |
|
| 25 | - } |
|
| 26 | - } |
|
| 27 | - /** |
|
| 28 | - */ |
|
| 29 | - private static function printData($objPHPExcel, $data, $cols) { |
|
| 30 | - $row = 3; |
|
| 31 | - foreach ( $data as $rowValue ) { |
|
| 32 | - $count = 0; |
|
| 33 | - foreach ( $cols as $col => $sym ) { |
|
| 34 | - $value = $rowValue->$sym; |
|
| 35 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $value ); |
|
| 36 | - } |
|
| 37 | - $row ++; |
|
| 38 | - } |
|
| 39 | - return $row; |
|
| 40 | - } |
|
| 41 | - private static function printTitle($objPHPExcel, $title) { |
|
| 42 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
|
| 43 | - } |
|
| 44 | - /** |
|
| 45 | - * |
|
| 46 | - * @param PHPExcel $objPHPExcel |
|
| 47 | - */ |
|
| 48 | - private static function printFooter($objPHPExcel, $cols, $row) { |
|
| 49 | - $objPHPExcel->getActiveSheet ()->getStyle ( 'A' . $row . ':AA' . ($row + 1) )->getFont ()->setBold ( true ); |
|
| 50 | - // SUM |
|
| 51 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 1, $row, "SUMA" ); |
|
| 52 | - for($i = 2; $i < count ( $cols ); $i ++) { |
|
| 53 | - $colLetter = chr ( 65 + $i ); |
|
| 54 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $i, $row, "=sum(" . $colLetter . "3" . ":" . $colLetter . ($row - 1) . ")" ); |
|
| 55 | - } |
|
| 56 | - ExcelExport::cellColor ( $objPHPExcel, 'A' . $row . ':AA' . ($row + 1), 'DDDDDD' ); |
|
| 57 | - } |
|
| 58 | - static function fillData($objPHPExcel) { |
|
| 59 | - $data = ExcelExportInfections::getData (); |
|
| 60 | - $cols = ExcelExportInfections::getColumns (); |
|
| 9 | + private static function getData() { |
|
| 10 | + $wardId = (! empty ( $_POST ['wardId'] ) ? $_POST ['wardId'] : 0); |
|
| 11 | + $date = (! empty ( $_POST ['date'] ) ? $_POST ['date'] : (new \DateTime ())->format ( "Y-m" )); |
|
| 12 | + $from = new \DateTime ( $date . '-01' ); |
|
| 13 | + $fromStr = $from->format ( 'Y-m-01' ); |
|
| 14 | + $toStr = $from->format ( 'Y-m-t' ); |
|
| 15 | + $infections = InfectionsCRUD::getInfections ( $fromStr, $toStr, $wardId, 'Infections' ); |
|
| 16 | + return $infections; |
|
| 17 | + } |
|
| 18 | + private static function getColumns() { |
|
| 19 | + return Infections::getFields (); |
|
| 20 | + } |
|
| 21 | + private static function printHeaders($objPHPExcel, $cols) { |
|
| 22 | + $count = 0; |
|
| 23 | + foreach ( $cols as $col => $sym ) { |
|
| 24 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, 2, sprintf ( "%7s", $col ) ); |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | + /** |
|
| 28 | + */ |
|
| 29 | + private static function printData($objPHPExcel, $data, $cols) { |
|
| 30 | + $row = 3; |
|
| 31 | + foreach ( $data as $rowValue ) { |
|
| 32 | + $count = 0; |
|
| 33 | + foreach ( $cols as $col => $sym ) { |
|
| 34 | + $value = $rowValue->$sym; |
|
| 35 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $value ); |
|
| 36 | + } |
|
| 37 | + $row ++; |
|
| 38 | + } |
|
| 39 | + return $row; |
|
| 40 | + } |
|
| 41 | + private static function printTitle($objPHPExcel, $title) { |
|
| 42 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
|
| 43 | + } |
|
| 44 | + /** |
|
| 45 | + * |
|
| 46 | + * @param PHPExcel $objPHPExcel |
|
| 47 | + */ |
|
| 48 | + private static function printFooter($objPHPExcel, $cols, $row) { |
|
| 49 | + $objPHPExcel->getActiveSheet ()->getStyle ( 'A' . $row . ':AA' . ($row + 1) )->getFont ()->setBold ( true ); |
|
| 50 | + // SUM |
|
| 51 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 1, $row, "SUMA" ); |
|
| 52 | + for($i = 2; $i < count ( $cols ); $i ++) { |
|
| 53 | + $colLetter = chr ( 65 + $i ); |
|
| 54 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $i, $row, "=sum(" . $colLetter . "3" . ":" . $colLetter . ($row - 1) . ")" ); |
|
| 55 | + } |
|
| 56 | + ExcelExport::cellColor ( $objPHPExcel, 'A' . $row . ':AA' . ($row + 1), 'DDDDDD' ); |
|
| 57 | + } |
|
| 58 | + static function fillData($objPHPExcel) { |
|
| 59 | + $data = ExcelExportInfections::getData (); |
|
| 60 | + $cols = ExcelExportInfections::getColumns (); |
|
| 61 | 61 | |
| 62 | - ExcelExportInfections::printTitle ( $objPHPExcel, "Raport" ); |
|
| 63 | - ExcelExportInfections::printHeaders ( $objPHPExcel, $cols ); |
|
| 64 | - $lastRow = ExcelExportInfections::printData ( $objPHPExcel, $data, $cols ); |
|
| 65 | - ExcelExportInfections::printFooter ( $objPHPExcel, $cols, $lastRow ); |
|
| 66 | - } |
|
| 62 | + ExcelExportInfections::printTitle ( $objPHPExcel, "Raport" ); |
|
| 63 | + ExcelExportInfections::printHeaders ( $objPHPExcel, $cols ); |
|
| 64 | + $lastRow = ExcelExportInfections::printData ( $objPHPExcel, $data, $cols ); |
|
| 65 | + ExcelExportInfections::printFooter ( $objPHPExcel, $cols, $lastRow ); |
|
| 66 | + } |
|
| 67 | 67 | } |
| 68 | 68 | \ No newline at end of file |
@@ -7,61 +7,61 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ExcelExportInfections { |
| 9 | 9 | private static function getData() { |
| 10 | - $wardId = (! empty ( $_POST ['wardId'] ) ? $_POST ['wardId'] : 0); |
|
| 11 | - $date = (! empty ( $_POST ['date'] ) ? $_POST ['date'] : (new \DateTime ())->format ( "Y-m" )); |
|
| 12 | - $from = new \DateTime ( $date . '-01' ); |
|
| 13 | - $fromStr = $from->format ( 'Y-m-01' ); |
|
| 14 | - $toStr = $from->format ( 'Y-m-t' ); |
|
| 15 | - $infections = InfectionsCRUD::getInfections ( $fromStr, $toStr, $wardId, 'Infections' ); |
|
| 10 | + $wardId = (!empty ($_POST ['wardId']) ? $_POST ['wardId'] : 0); |
|
| 11 | + $date = (!empty ($_POST ['date']) ? $_POST ['date'] : (new \DateTime())->format("Y-m")); |
|
| 12 | + $from = new \DateTime($date.'-01'); |
|
| 13 | + $fromStr = $from->format('Y-m-01'); |
|
| 14 | + $toStr = $from->format('Y-m-t'); |
|
| 15 | + $infections = InfectionsCRUD::getInfections($fromStr, $toStr, $wardId, 'Infections'); |
|
| 16 | 16 | return $infections; |
| 17 | 17 | } |
| 18 | 18 | private static function getColumns() { |
| 19 | - return Infections::getFields (); |
|
| 19 | + return Infections::getFields(); |
|
| 20 | 20 | } |
| 21 | 21 | private static function printHeaders($objPHPExcel, $cols) { |
| 22 | 22 | $count = 0; |
| 23 | - foreach ( $cols as $col => $sym ) { |
|
| 24 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, 2, sprintf ( "%7s", $col ) ); |
|
| 23 | + foreach ($cols as $col => $sym) { |
|
| 24 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, 2, sprintf("%7s", $col)); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | /** |
| 28 | 28 | */ |
| 29 | 29 | private static function printData($objPHPExcel, $data, $cols) { |
| 30 | 30 | $row = 3; |
| 31 | - foreach ( $data as $rowValue ) { |
|
| 31 | + foreach ($data as $rowValue) { |
|
| 32 | 32 | $count = 0; |
| 33 | - foreach ( $cols as $col => $sym ) { |
|
| 33 | + foreach ($cols as $col => $sym) { |
|
| 34 | 34 | $value = $rowValue->$sym; |
| 35 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $value ); |
|
| 35 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, $row, $value); |
|
| 36 | 36 | } |
| 37 | 37 | $row ++; |
| 38 | 38 | } |
| 39 | 39 | return $row; |
| 40 | 40 | } |
| 41 | 41 | private static function printTitle($objPHPExcel, $title) { |
| 42 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 1, $title ); |
|
| 42 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 1, $title); |
|
| 43 | 43 | } |
| 44 | 44 | /** |
| 45 | 45 | * |
| 46 | 46 | * @param PHPExcel $objPHPExcel |
| 47 | 47 | */ |
| 48 | 48 | private static function printFooter($objPHPExcel, $cols, $row) { |
| 49 | - $objPHPExcel->getActiveSheet ()->getStyle ( 'A' . $row . ':AA' . ($row + 1) )->getFont ()->setBold ( true ); |
|
| 49 | + $objPHPExcel->getActiveSheet()->getStyle('A'.$row.':AA'.($row + 1))->getFont()->setBold(true); |
|
| 50 | 50 | // SUM |
| 51 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 1, $row, "SUMA" ); |
|
| 52 | - for($i = 2; $i < count ( $cols ); $i ++) { |
|
| 53 | - $colLetter = chr ( 65 + $i ); |
|
| 54 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $i, $row, "=sum(" . $colLetter . "3" . ":" . $colLetter . ($row - 1) . ")" ); |
|
| 51 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $row, "SUMA"); |
|
| 52 | + for ($i = 2; $i < count($cols); $i ++) { |
|
| 53 | + $colLetter = chr(65 + $i); |
|
| 54 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($i, $row, "=sum(".$colLetter."3".":".$colLetter.($row - 1).")"); |
|
| 55 | 55 | } |
| 56 | - ExcelExport::cellColor ( $objPHPExcel, 'A' . $row . ':AA' . ($row + 1), 'DDDDDD' ); |
|
| 56 | + ExcelExport::cellColor($objPHPExcel, 'A'.$row.':AA'.($row + 1), 'DDDDDD'); |
|
| 57 | 57 | } |
| 58 | 58 | static function fillData($objPHPExcel) { |
| 59 | - $data = ExcelExportInfections::getData (); |
|
| 60 | - $cols = ExcelExportInfections::getColumns (); |
|
| 59 | + $data = ExcelExportInfections::getData(); |
|
| 60 | + $cols = ExcelExportInfections::getColumns(); |
|
| 61 | 61 | |
| 62 | - ExcelExportInfections::printTitle ( $objPHPExcel, "Raport" ); |
|
| 63 | - ExcelExportInfections::printHeaders ( $objPHPExcel, $cols ); |
|
| 64 | - $lastRow = ExcelExportInfections::printData ( $objPHPExcel, $data, $cols ); |
|
| 65 | - ExcelExportInfections::printFooter ( $objPHPExcel, $cols, $lastRow ); |
|
| 62 | + ExcelExportInfections::printTitle($objPHPExcel, "Raport"); |
|
| 63 | + ExcelExportInfections::printHeaders($objPHPExcel, $cols); |
|
| 64 | + $lastRow = ExcelExportInfections::printData($objPHPExcel, $data, $cols); |
|
| 65 | + ExcelExportInfections::printFooter($objPHPExcel, $cols, $lastRow); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | \ No newline at end of file |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * |
| 22 | 22 | * @param unknown $objPHPExcel |
| 23 | - * @param unknown $cols |
|
| 23 | + * @param string[] $cols |
|
| 24 | 24 | */ |
| 25 | 25 | private static function printHeaders($objPHPExcel, $cols) { |
| 26 | 26 | $count = 1; |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Hospitalplugin\utils; |
| 4 | 4 | |
| 5 | -use Hospitalplugin\Entities\InfectionsCRUD; |
|
| 6 | -use Hospitalplugin\Entities\Infections; |
|
| 7 | 5 | use Hospitalplugin\Entities\PatientRaport; |
| 8 | 6 | use Hospitalplugin\Entities\WardCRUD; |
| 9 | 7 | |
@@ -9,133 +9,133 @@ |
||
| 9 | 9 | |
| 10 | 10 | class ExcelExportPunction { |
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * |
|
| 14 | - * @param unknown $id |
|
| 15 | - */ |
|
| 16 | - private static function getData($id, $type) { |
|
| 17 | - $raport = PatientRaport::getRaportBetweenDates ( $id, $type, '2014-06-01', (new \DateTime ())->format ( "Y-m-d" ) ); |
|
| 18 | - return $raport; |
|
| 19 | - } |
|
| 20 | - /** |
|
| 21 | - * |
|
| 22 | - * @param unknown $objPHPExcel |
|
| 23 | - * @param unknown $cols |
|
| 24 | - */ |
|
| 25 | - private static function printHeaders($objPHPExcel, $cols) { |
|
| 26 | - $count = 1; |
|
| 27 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 2, "Data" ); |
|
| 28 | - foreach ( $cols as $col ) { |
|
| 29 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, 2, sprintf ( "%7s", $col ) ); |
|
| 30 | - } |
|
| 31 | - } |
|
| 32 | - /** |
|
| 33 | - */ |
|
| 34 | - private static function printData($objPHPExcel, $data, $type) { |
|
| 35 | - $row = 3; |
|
| 36 | - $lastColumn = 1; |
|
| 37 | - $colNumberOfPatients = ExcelExport::getColumnLetter ( 1 ); |
|
| 38 | - $indexes = PatientRaport::getIndexes ( $type ); |
|
| 39 | - foreach ( $data as $rowKey => $rowValue ) { |
|
| 40 | - // 1 col: date |
|
| 41 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row, json_encode ( $rowKey ) ); |
|
| 42 | - $count = 1; |
|
| 43 | - // 2-5 cols: N1 N2 N3 N0 |
|
| 44 | - foreach ( $indexes as $index ) { |
|
| 45 | - $value = isset ( $rowValue [$index] ) ? $rowValue [$index] : "0"; |
|
| 46 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $value ); |
|
| 47 | - } |
|
| 48 | - // 6 col: num of categorized (N = N1+N2+N3) |
|
| 49 | - $colHighestCategory = ExcelExport::getColumnLetter ( $count - 2 ); |
|
| 50 | - $colNumberOfPatients = ExcelExport::getColumnLetter ( $count ); |
|
| 51 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=SUM(B' . $row . ':' . $colHighestCategory . $row . ')' ); |
|
| 52 | - $tpb = PatientRaport::getTpb ( $type ); |
|
| 53 | - // 7-11 tpb1, tpb2, tpb3, 0 (no-cat), 2 (add) |
|
| 54 | - foreach ( $tpb as $tpbn ) { |
|
| 55 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $tpbn ); |
|
| 56 | - } |
|
| 57 | - // 9-11: Tpb1*N1,Tpb2*N2,Tpb3*N3+2xN |
|
| 58 | - $tpbSize = count ( $tpb ); |
|
| 59 | - foreach ( $tpb as $tpbn ) { |
|
| 60 | - $col1Letter = ExcelExport::getColumnLetter ( $count - 2 * $tpbSize ); |
|
| 61 | - $col2Letter = ExcelExport::getColumnLetter ( $count - $tpbSize ); |
|
| 62 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=' . $col1Letter . $row . "*" . $col2Letter . $row ); |
|
| 63 | - } |
|
| 64 | - // SUM Tpb |
|
| 65 | - $col3Letter = ExcelExport::getColumnLetter ( $count - $tpbSize ); |
|
| 66 | - $col4Letter = ExcelExport::getColumnLetter ( $count - 1 ); |
|
| 67 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=SUM(' . $col3Letter . $row . ":" . $col4Letter . $row . ")" ); |
|
| 68 | - $row ++; |
|
| 69 | - $lastColumn = $count - 1; |
|
| 70 | - } |
|
| 71 | - // number of categorization days |
|
| 72 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 1, 1, '=COUNTIFS(' . $colNumberOfPatients . '3:' . $colNumberOfPatients . ($row - 1) . ',">0")' ); |
|
| 73 | - // sum |
|
| 74 | - $col5Letter = ExcelExport::getColumnLetter ( $lastColumn ); |
|
| 75 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 2, 1, '=SUM(' . $col5Letter . '3:' . $col5Letter . ($row - 1) . ')/60' ); |
|
| 76 | - return $row; |
|
| 77 | - } |
|
| 12 | + /** |
|
| 13 | + * |
|
| 14 | + * @param unknown $id |
|
| 15 | + */ |
|
| 16 | + private static function getData($id, $type) { |
|
| 17 | + $raport = PatientRaport::getRaportBetweenDates ( $id, $type, '2014-06-01', (new \DateTime ())->format ( "Y-m-d" ) ); |
|
| 18 | + return $raport; |
|
| 19 | + } |
|
| 20 | + /** |
|
| 21 | + * |
|
| 22 | + * @param unknown $objPHPExcel |
|
| 23 | + * @param unknown $cols |
|
| 24 | + */ |
|
| 25 | + private static function printHeaders($objPHPExcel, $cols) { |
|
| 26 | + $count = 1; |
|
| 27 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 2, "Data" ); |
|
| 28 | + foreach ( $cols as $col ) { |
|
| 29 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, 2, sprintf ( "%7s", $col ) ); |
|
| 30 | + } |
|
| 31 | + } |
|
| 32 | + /** |
|
| 33 | + */ |
|
| 34 | + private static function printData($objPHPExcel, $data, $type) { |
|
| 35 | + $row = 3; |
|
| 36 | + $lastColumn = 1; |
|
| 37 | + $colNumberOfPatients = ExcelExport::getColumnLetter ( 1 ); |
|
| 38 | + $indexes = PatientRaport::getIndexes ( $type ); |
|
| 39 | + foreach ( $data as $rowKey => $rowValue ) { |
|
| 40 | + // 1 col: date |
|
| 41 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row, json_encode ( $rowKey ) ); |
|
| 42 | + $count = 1; |
|
| 43 | + // 2-5 cols: N1 N2 N3 N0 |
|
| 44 | + foreach ( $indexes as $index ) { |
|
| 45 | + $value = isset ( $rowValue [$index] ) ? $rowValue [$index] : "0"; |
|
| 46 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $value ); |
|
| 47 | + } |
|
| 48 | + // 6 col: num of categorized (N = N1+N2+N3) |
|
| 49 | + $colHighestCategory = ExcelExport::getColumnLetter ( $count - 2 ); |
|
| 50 | + $colNumberOfPatients = ExcelExport::getColumnLetter ( $count ); |
|
| 51 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=SUM(B' . $row . ':' . $colHighestCategory . $row . ')' ); |
|
| 52 | + $tpb = PatientRaport::getTpb ( $type ); |
|
| 53 | + // 7-11 tpb1, tpb2, tpb3, 0 (no-cat), 2 (add) |
|
| 54 | + foreach ( $tpb as $tpbn ) { |
|
| 55 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $tpbn ); |
|
| 56 | + } |
|
| 57 | + // 9-11: Tpb1*N1,Tpb2*N2,Tpb3*N3+2xN |
|
| 58 | + $tpbSize = count ( $tpb ); |
|
| 59 | + foreach ( $tpb as $tpbn ) { |
|
| 60 | + $col1Letter = ExcelExport::getColumnLetter ( $count - 2 * $tpbSize ); |
|
| 61 | + $col2Letter = ExcelExport::getColumnLetter ( $count - $tpbSize ); |
|
| 62 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=' . $col1Letter . $row . "*" . $col2Letter . $row ); |
|
| 63 | + } |
|
| 64 | + // SUM Tpb |
|
| 65 | + $col3Letter = ExcelExport::getColumnLetter ( $count - $tpbSize ); |
|
| 66 | + $col4Letter = ExcelExport::getColumnLetter ( $count - 1 ); |
|
| 67 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=SUM(' . $col3Letter . $row . ":" . $col4Letter . $row . ")" ); |
|
| 68 | + $row ++; |
|
| 69 | + $lastColumn = $count - 1; |
|
| 70 | + } |
|
| 71 | + // number of categorization days |
|
| 72 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 1, 1, '=COUNTIFS(' . $colNumberOfPatients . '3:' . $colNumberOfPatients . ($row - 1) . ',">0")' ); |
|
| 73 | + // sum |
|
| 74 | + $col5Letter = ExcelExport::getColumnLetter ( $lastColumn ); |
|
| 75 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 2, 1, '=SUM(' . $col5Letter . '3:' . $col5Letter . ($row - 1) . ')/60' ); |
|
| 76 | + return $row; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * |
|
| 81 | - * @param unknown $objPHPExcel |
|
| 82 | - */ |
|
| 83 | - static function fillSummary($objPHPExcel) { |
|
| 84 | - ExcelExport::newSheet ( $objPHPExcel, 0 ); |
|
| 85 | - ExcelExport::printTitle ( $objPHPExcel, "Raport" ); |
|
| 86 | - $sheetCount = $objPHPExcel->getSheetCount (); |
|
| 87 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'A2', 'Oddz.' ); |
|
| 88 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'B2', 'Dni' ); |
|
| 89 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'C2', 'Tpb' ); |
|
| 90 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'D2', 'Tśpb' ); |
|
| 91 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'E2', 'Tśpc*' ); |
|
| 92 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'F2', 'Tśpc**' ); |
|
| 93 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'G2', 'Td***' ); |
|
| 94 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'H2', 'Le*' ); |
|
| 95 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'I2', 'Le**' ); |
|
| 96 | - for($i = 1; $i < $sheetCount; $i ++) { |
|
| 97 | - $loadedSheetNames = $objPHPExcel->getSheetNames (); |
|
| 98 | - foreach ( $loadedSheetNames as $sheetIndex => $loadedSheetName ) { |
|
| 99 | - if ($sheetIndex == 0) { |
|
| 100 | - continue; |
|
| 101 | - } |
|
| 102 | - $row = $sheetIndex + 2; |
|
| 103 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'A' . $row, "='" . $loadedSheetName . "'!A1" ); |
|
| 104 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'B' . $row, "='" . $loadedSheetName . "'!B1" ); |
|
| 105 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'C' . $row, "='" . $loadedSheetName . "'!C1" ); |
|
| 106 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 3, $row, "=IF(C" . $row . ">0,C" . $row . "/B" . $row . ",0)" ); |
|
| 107 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 4, $row, "=D" . $row . "*110%" ); |
|
| 108 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 5, $row, "=D" . $row . "*125%" ); |
|
| 109 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 6, $row, "1531" ); |
|
| 110 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 7, $row, "=IF(E" . $row . ">0,E" . $row . "*365/G" . $row . ",\"-\")" ); |
|
| 111 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 8, $row, "=IF(F" . $row . ">0,F" . $row . "*365/G" . $row . ",\"-\")" ); |
|
| 112 | - } |
|
| 113 | - $objPHPExcel->getActiveSheet ()->getStyle ( 'C3:I100' )->getNumberFormat ()->setFormatCode ( '#,##0.0' ); |
|
| 114 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 1, "* Czas pielęgnacji pośredniej jako 10% czasu pielęgnacji bezpośredniej" ); |
|
| 115 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 2, "** Czas pielęgnacji pośredniej jako 25% czasu pielęgnacji bezpośredniej" ); |
|
| 116 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 3, "*** Czas dyspozycyjny - propozycja z Rozporządzenia MZ: 202 dni x 7,58 h" ); |
|
| 117 | - ExcelExport::styleActiveSheet ( $objPHPExcel ); |
|
| 118 | - } |
|
| 119 | - } |
|
| 120 | - static function fillData($objPHPExcel) { |
|
| 121 | - // no time limit for this script |
|
| 122 | - set_time_limit ( 0 ); |
|
| 123 | - $time_start = microtime ( true ); |
|
| 124 | - // remove first default sheet |
|
| 125 | - $objPHPExcel->removeSheetByIndex ( 0 ); |
|
| 126 | - // get wards |
|
| 127 | - $wards = WardCRUD::getWardsArray (); |
|
| 128 | - foreach ( $wards as $ward ) { |
|
| 129 | - ExcelExport::newSheet ( $objPHPExcel ); |
|
| 130 | - $wardName = $ward->name . " (" . $ward->getTypOddzialu () . ")"; |
|
| 131 | - ExcelExport::printTitle ( $objPHPExcel, $wardName ); |
|
| 132 | - $data = ExcelExportPunction::getData ( $ward->id, $ward->getTypOddzialu () ); |
|
| 133 | - $cols = PatientRaport::getColumns ( $ward->getTypOddzialu () ); |
|
| 134 | - ExcelExportPunction::printHeaders ( $objPHPExcel, $cols ); |
|
| 135 | - ExcelExportPunction::printData ( $objPHPExcel, $data, $ward->getTypOddzialu () ); |
|
| 136 | - ExcelExport::styleActiveSheet ( $objPHPExcel ); |
|
| 137 | - } |
|
| 138 | - ExcelExportPunction::fillSummary ( $objPHPExcel ); |
|
| 139 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 100, "summary " . ($time_start - microtime ( true )) . " s" ); |
|
| 140 | - } |
|
| 79 | + /** |
|
| 80 | + * |
|
| 81 | + * @param unknown $objPHPExcel |
|
| 82 | + */ |
|
| 83 | + static function fillSummary($objPHPExcel) { |
|
| 84 | + ExcelExport::newSheet ( $objPHPExcel, 0 ); |
|
| 85 | + ExcelExport::printTitle ( $objPHPExcel, "Raport" ); |
|
| 86 | + $sheetCount = $objPHPExcel->getSheetCount (); |
|
| 87 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'A2', 'Oddz.' ); |
|
| 88 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'B2', 'Dni' ); |
|
| 89 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'C2', 'Tpb' ); |
|
| 90 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'D2', 'Tśpb' ); |
|
| 91 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'E2', 'Tśpc*' ); |
|
| 92 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'F2', 'Tśpc**' ); |
|
| 93 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'G2', 'Td***' ); |
|
| 94 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'H2', 'Le*' ); |
|
| 95 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'I2', 'Le**' ); |
|
| 96 | + for($i = 1; $i < $sheetCount; $i ++) { |
|
| 97 | + $loadedSheetNames = $objPHPExcel->getSheetNames (); |
|
| 98 | + foreach ( $loadedSheetNames as $sheetIndex => $loadedSheetName ) { |
|
| 99 | + if ($sheetIndex == 0) { |
|
| 100 | + continue; |
|
| 101 | + } |
|
| 102 | + $row = $sheetIndex + 2; |
|
| 103 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'A' . $row, "='" . $loadedSheetName . "'!A1" ); |
|
| 104 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'B' . $row, "='" . $loadedSheetName . "'!B1" ); |
|
| 105 | + $objPHPExcel->getActiveSheet ()->setCellValue ( 'C' . $row, "='" . $loadedSheetName . "'!C1" ); |
|
| 106 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 3, $row, "=IF(C" . $row . ">0,C" . $row . "/B" . $row . ",0)" ); |
|
| 107 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 4, $row, "=D" . $row . "*110%" ); |
|
| 108 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 5, $row, "=D" . $row . "*125%" ); |
|
| 109 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 6, $row, "1531" ); |
|
| 110 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 7, $row, "=IF(E" . $row . ">0,E" . $row . "*365/G" . $row . ",\"-\")" ); |
|
| 111 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 8, $row, "=IF(F" . $row . ">0,F" . $row . "*365/G" . $row . ",\"-\")" ); |
|
| 112 | + } |
|
| 113 | + $objPHPExcel->getActiveSheet ()->getStyle ( 'C3:I100' )->getNumberFormat ()->setFormatCode ( '#,##0.0' ); |
|
| 114 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 1, "* Czas pielęgnacji pośredniej jako 10% czasu pielęgnacji bezpośredniej" ); |
|
| 115 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 2, "** Czas pielęgnacji pośredniej jako 25% czasu pielęgnacji bezpośredniej" ); |
|
| 116 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 3, "*** Czas dyspozycyjny - propozycja z Rozporządzenia MZ: 202 dni x 7,58 h" ); |
|
| 117 | + ExcelExport::styleActiveSheet ( $objPHPExcel ); |
|
| 118 | + } |
|
| 119 | + } |
|
| 120 | + static function fillData($objPHPExcel) { |
|
| 121 | + // no time limit for this script |
|
| 122 | + set_time_limit ( 0 ); |
|
| 123 | + $time_start = microtime ( true ); |
|
| 124 | + // remove first default sheet |
|
| 125 | + $objPHPExcel->removeSheetByIndex ( 0 ); |
|
| 126 | + // get wards |
|
| 127 | + $wards = WardCRUD::getWardsArray (); |
|
| 128 | + foreach ( $wards as $ward ) { |
|
| 129 | + ExcelExport::newSheet ( $objPHPExcel ); |
|
| 130 | + $wardName = $ward->name . " (" . $ward->getTypOddzialu () . ")"; |
|
| 131 | + ExcelExport::printTitle ( $objPHPExcel, $wardName ); |
|
| 132 | + $data = ExcelExportPunction::getData ( $ward->id, $ward->getTypOddzialu () ); |
|
| 133 | + $cols = PatientRaport::getColumns ( $ward->getTypOddzialu () ); |
|
| 134 | + ExcelExportPunction::printHeaders ( $objPHPExcel, $cols ); |
|
| 135 | + ExcelExportPunction::printData ( $objPHPExcel, $data, $ward->getTypOddzialu () ); |
|
| 136 | + ExcelExport::styleActiveSheet ( $objPHPExcel ); |
|
| 137 | + } |
|
| 138 | + ExcelExportPunction::fillSummary ( $objPHPExcel ); |
|
| 139 | + $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 100, "summary " . ($time_start - microtime ( true )) . " s" ); |
|
| 140 | + } |
|
| 141 | 141 | } |
| 142 | 142 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * @param unknown $id |
| 15 | 15 | */ |
| 16 | 16 | private static function getData($id, $type) { |
| 17 | - $raport = PatientRaport::getRaportBetweenDates ( $id, $type, '2014-06-01', (new \DateTime ())->format ( "Y-m-d" ) ); |
|
| 17 | + $raport = PatientRaport::getRaportBetweenDates($id, $type, '2014-06-01', (new \DateTime())->format("Y-m-d")); |
|
| 18 | 18 | return $raport; |
| 19 | 19 | } |
| 20 | 20 | /** |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | private static function printHeaders($objPHPExcel, $cols) { |
| 26 | 26 | $count = 1; |
| 27 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 2, "Data" ); |
|
| 28 | - foreach ( $cols as $col ) { |
|
| 29 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, 2, sprintf ( "%7s", $col ) ); |
|
| 27 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 2, "Data"); |
|
| 28 | + foreach ($cols as $col) { |
|
| 29 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, 2, sprintf("%7s", $col)); |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | /** |
@@ -34,45 +34,45 @@ discard block |
||
| 34 | 34 | private static function printData($objPHPExcel, $data, $type) { |
| 35 | 35 | $row = 3; |
| 36 | 36 | $lastColumn = 1; |
| 37 | - $colNumberOfPatients = ExcelExport::getColumnLetter ( 1 ); |
|
| 38 | - $indexes = PatientRaport::getIndexes ( $type ); |
|
| 39 | - foreach ( $data as $rowKey => $rowValue ) { |
|
| 37 | + $colNumberOfPatients = ExcelExport::getColumnLetter(1); |
|
| 38 | + $indexes = PatientRaport::getIndexes($type); |
|
| 39 | + foreach ($data as $rowKey => $rowValue) { |
|
| 40 | 40 | // 1 col: date |
| 41 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row, json_encode ( $rowKey ) ); |
|
| 41 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row, json_encode($rowKey)); |
|
| 42 | 42 | $count = 1; |
| 43 | 43 | // 2-5 cols: N1 N2 N3 N0 |
| 44 | - foreach ( $indexes as $index ) { |
|
| 45 | - $value = isset ( $rowValue [$index] ) ? $rowValue [$index] : "0"; |
|
| 46 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $value ); |
|
| 44 | + foreach ($indexes as $index) { |
|
| 45 | + $value = isset ($rowValue [$index]) ? $rowValue [$index] : "0"; |
|
| 46 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, $row, $value); |
|
| 47 | 47 | } |
| 48 | 48 | // 6 col: num of categorized (N = N1+N2+N3) |
| 49 | - $colHighestCategory = ExcelExport::getColumnLetter ( $count - 2 ); |
|
| 50 | - $colNumberOfPatients = ExcelExport::getColumnLetter ( $count ); |
|
| 51 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=SUM(B' . $row . ':' . $colHighestCategory . $row . ')' ); |
|
| 52 | - $tpb = PatientRaport::getTpb ( $type ); |
|
| 49 | + $colHighestCategory = ExcelExport::getColumnLetter($count - 2); |
|
| 50 | + $colNumberOfPatients = ExcelExport::getColumnLetter($count); |
|
| 51 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, $row, '=SUM(B'.$row.':'.$colHighestCategory.$row.')'); |
|
| 52 | + $tpb = PatientRaport::getTpb($type); |
|
| 53 | 53 | // 7-11 tpb1, tpb2, tpb3, 0 (no-cat), 2 (add) |
| 54 | - foreach ( $tpb as $tpbn ) { |
|
| 55 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, $tpbn ); |
|
| 54 | + foreach ($tpb as $tpbn) { |
|
| 55 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, $row, $tpbn); |
|
| 56 | 56 | } |
| 57 | 57 | // 9-11: Tpb1*N1,Tpb2*N2,Tpb3*N3+2xN |
| 58 | - $tpbSize = count ( $tpb ); |
|
| 59 | - foreach ( $tpb as $tpbn ) { |
|
| 60 | - $col1Letter = ExcelExport::getColumnLetter ( $count - 2 * $tpbSize ); |
|
| 61 | - $col2Letter = ExcelExport::getColumnLetter ( $count - $tpbSize ); |
|
| 62 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=' . $col1Letter . $row . "*" . $col2Letter . $row ); |
|
| 58 | + $tpbSize = count($tpb); |
|
| 59 | + foreach ($tpb as $tpbn) { |
|
| 60 | + $col1Letter = ExcelExport::getColumnLetter($count - 2 * $tpbSize); |
|
| 61 | + $col2Letter = ExcelExport::getColumnLetter($count - $tpbSize); |
|
| 62 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, $row, '='.$col1Letter.$row."*".$col2Letter.$row); |
|
| 63 | 63 | } |
| 64 | 64 | // SUM Tpb |
| 65 | - $col3Letter = ExcelExport::getColumnLetter ( $count - $tpbSize ); |
|
| 66 | - $col4Letter = ExcelExport::getColumnLetter ( $count - 1 ); |
|
| 67 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( $count ++, $row, '=SUM(' . $col3Letter . $row . ":" . $col4Letter . $row . ")" ); |
|
| 65 | + $col3Letter = ExcelExport::getColumnLetter($count - $tpbSize); |
|
| 66 | + $col4Letter = ExcelExport::getColumnLetter($count - 1); |
|
| 67 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count ++, $row, '=SUM('.$col3Letter.$row.":".$col4Letter.$row.")"); |
|
| 68 | 68 | $row ++; |
| 69 | 69 | $lastColumn = $count - 1; |
| 70 | 70 | } |
| 71 | 71 | // number of categorization days |
| 72 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 1, 1, '=COUNTIFS(' . $colNumberOfPatients . '3:' . $colNumberOfPatients . ($row - 1) . ',">0")' ); |
|
| 72 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, 1, '=COUNTIFS('.$colNumberOfPatients.'3:'.$colNumberOfPatients.($row - 1).',">0")'); |
|
| 73 | 73 | // sum |
| 74 | - $col5Letter = ExcelExport::getColumnLetter ( $lastColumn ); |
|
| 75 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 2, 1, '=SUM(' . $col5Letter . '3:' . $col5Letter . ($row - 1) . ')/60' ); |
|
| 74 | + $col5Letter = ExcelExport::getColumnLetter($lastColumn); |
|
| 75 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, 1, '=SUM('.$col5Letter.'3:'.$col5Letter.($row - 1).')/60'); |
|
| 76 | 76 | return $row; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -81,61 +81,61 @@ discard block |
||
| 81 | 81 | * @param unknown $objPHPExcel |
| 82 | 82 | */ |
| 83 | 83 | static function fillSummary($objPHPExcel) { |
| 84 | - ExcelExport::newSheet ( $objPHPExcel, 0 ); |
|
| 85 | - ExcelExport::printTitle ( $objPHPExcel, "Raport" ); |
|
| 86 | - $sheetCount = $objPHPExcel->getSheetCount (); |
|
| 87 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'A2', 'Oddz.' ); |
|
| 88 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'B2', 'Dni' ); |
|
| 89 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'C2', 'Tpb' ); |
|
| 90 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'D2', 'Tśpb' ); |
|
| 91 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'E2', 'Tśpc*' ); |
|
| 92 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'F2', 'Tśpc**' ); |
|
| 93 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'G2', 'Td***' ); |
|
| 94 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'H2', 'Le*' ); |
|
| 95 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'I2', 'Le**' ); |
|
| 96 | - for($i = 1; $i < $sheetCount; $i ++) { |
|
| 97 | - $loadedSheetNames = $objPHPExcel->getSheetNames (); |
|
| 98 | - foreach ( $loadedSheetNames as $sheetIndex => $loadedSheetName ) { |
|
| 84 | + ExcelExport::newSheet($objPHPExcel, 0); |
|
| 85 | + ExcelExport::printTitle($objPHPExcel, "Raport"); |
|
| 86 | + $sheetCount = $objPHPExcel->getSheetCount(); |
|
| 87 | + $objPHPExcel->getActiveSheet()->setCellValue('A2', 'Oddz.'); |
|
| 88 | + $objPHPExcel->getActiveSheet()->setCellValue('B2', 'Dni'); |
|
| 89 | + $objPHPExcel->getActiveSheet()->setCellValue('C2', 'Tpb'); |
|
| 90 | + $objPHPExcel->getActiveSheet()->setCellValue('D2', 'Tśpb'); |
|
| 91 | + $objPHPExcel->getActiveSheet()->setCellValue('E2', 'Tśpc*'); |
|
| 92 | + $objPHPExcel->getActiveSheet()->setCellValue('F2', 'Tśpc**'); |
|
| 93 | + $objPHPExcel->getActiveSheet()->setCellValue('G2', 'Td***'); |
|
| 94 | + $objPHPExcel->getActiveSheet()->setCellValue('H2', 'Le*'); |
|
| 95 | + $objPHPExcel->getActiveSheet()->setCellValue('I2', 'Le**'); |
|
| 96 | + for ($i = 1; $i < $sheetCount; $i ++) { |
|
| 97 | + $loadedSheetNames = $objPHPExcel->getSheetNames(); |
|
| 98 | + foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
|
| 99 | 99 | if ($sheetIndex == 0) { |
| 100 | 100 | continue; |
| 101 | 101 | } |
| 102 | 102 | $row = $sheetIndex + 2; |
| 103 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'A' . $row, "='" . $loadedSheetName . "'!A1" ); |
|
| 104 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'B' . $row, "='" . $loadedSheetName . "'!B1" ); |
|
| 105 | - $objPHPExcel->getActiveSheet ()->setCellValue ( 'C' . $row, "='" . $loadedSheetName . "'!C1" ); |
|
| 106 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 3, $row, "=IF(C" . $row . ">0,C" . $row . "/B" . $row . ",0)" ); |
|
| 107 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 4, $row, "=D" . $row . "*110%" ); |
|
| 108 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 5, $row, "=D" . $row . "*125%" ); |
|
| 109 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 6, $row, "1531" ); |
|
| 110 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 7, $row, "=IF(E" . $row . ">0,E" . $row . "*365/G" . $row . ",\"-\")" ); |
|
| 111 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 8, $row, "=IF(F" . $row . ">0,F" . $row . "*365/G" . $row . ",\"-\")" ); |
|
| 103 | + $objPHPExcel->getActiveSheet()->setCellValue('A'.$row, "='".$loadedSheetName."'!A1"); |
|
| 104 | + $objPHPExcel->getActiveSheet()->setCellValue('B'.$row, "='".$loadedSheetName."'!B1"); |
|
| 105 | + $objPHPExcel->getActiveSheet()->setCellValue('C'.$row, "='".$loadedSheetName."'!C1"); |
|
| 106 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, $row, "=IF(C".$row.">0,C".$row."/B".$row.",0)"); |
|
| 107 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(4, $row, "=D".$row."*110%"); |
|
| 108 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(5, $row, "=D".$row."*125%"); |
|
| 109 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(6, $row, "1531"); |
|
| 110 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(7, $row, "=IF(E".$row.">0,E".$row."*365/G".$row.",\"-\")"); |
|
| 111 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(8, $row, "=IF(F".$row.">0,F".$row."*365/G".$row.",\"-\")"); |
|
| 112 | 112 | } |
| 113 | - $objPHPExcel->getActiveSheet ()->getStyle ( 'C3:I100' )->getNumberFormat ()->setFormatCode ( '#,##0.0' ); |
|
| 114 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 1, "* Czas pielęgnacji pośredniej jako 10% czasu pielęgnacji bezpośredniej" ); |
|
| 115 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 2, "** Czas pielęgnacji pośredniej jako 25% czasu pielęgnacji bezpośredniej" ); |
|
| 116 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, $row + 3, "*** Czas dyspozycyjny - propozycja z Rozporządzenia MZ: 202 dni x 7,58 h" ); |
|
| 117 | - ExcelExport::styleActiveSheet ( $objPHPExcel ); |
|
| 113 | + $objPHPExcel->getActiveSheet()->getStyle('C3:I100')->getNumberFormat()->setFormatCode('#,##0.0'); |
|
| 114 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row + 1, "* Czas pielęgnacji pośredniej jako 10% czasu pielęgnacji bezpośredniej"); |
|
| 115 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row + 2, "** Czas pielęgnacji pośredniej jako 25% czasu pielęgnacji bezpośredniej"); |
|
| 116 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row + 3, "*** Czas dyspozycyjny - propozycja z Rozporządzenia MZ: 202 dni x 7,58 h"); |
|
| 117 | + ExcelExport::styleActiveSheet($objPHPExcel); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | static function fillData($objPHPExcel) { |
| 121 | 121 | // no time limit for this script |
| 122 | - set_time_limit ( 0 ); |
|
| 123 | - $time_start = microtime ( true ); |
|
| 122 | + set_time_limit(0); |
|
| 123 | + $time_start = microtime(true); |
|
| 124 | 124 | // remove first default sheet |
| 125 | - $objPHPExcel->removeSheetByIndex ( 0 ); |
|
| 125 | + $objPHPExcel->removeSheetByIndex(0); |
|
| 126 | 126 | // get wards |
| 127 | - $wards = WardCRUD::getWardsArray (); |
|
| 128 | - foreach ( $wards as $ward ) { |
|
| 129 | - ExcelExport::newSheet ( $objPHPExcel ); |
|
| 130 | - $wardName = $ward->name . " (" . $ward->getTypOddzialu () . ")"; |
|
| 131 | - ExcelExport::printTitle ( $objPHPExcel, $wardName ); |
|
| 132 | - $data = ExcelExportPunction::getData ( $ward->id, $ward->getTypOddzialu () ); |
|
| 133 | - $cols = PatientRaport::getColumns ( $ward->getTypOddzialu () ); |
|
| 134 | - ExcelExportPunction::printHeaders ( $objPHPExcel, $cols ); |
|
| 135 | - ExcelExportPunction::printData ( $objPHPExcel, $data, $ward->getTypOddzialu () ); |
|
| 136 | - ExcelExport::styleActiveSheet ( $objPHPExcel ); |
|
| 127 | + $wards = WardCRUD::getWardsArray(); |
|
| 128 | + foreach ($wards as $ward) { |
|
| 129 | + ExcelExport::newSheet($objPHPExcel); |
|
| 130 | + $wardName = $ward->name." (".$ward->getTypOddzialu().")"; |
|
| 131 | + ExcelExport::printTitle($objPHPExcel, $wardName); |
|
| 132 | + $data = ExcelExportPunction::getData($ward->id, $ward->getTypOddzialu()); |
|
| 133 | + $cols = PatientRaport::getColumns($ward->getTypOddzialu()); |
|
| 134 | + ExcelExportPunction::printHeaders($objPHPExcel, $cols); |
|
| 135 | + ExcelExportPunction::printData($objPHPExcel, $data, $ward->getTypOddzialu()); |
|
| 136 | + ExcelExport::styleActiveSheet($objPHPExcel); |
|
| 137 | 137 | } |
| 138 | - ExcelExportPunction::fillSummary ( $objPHPExcel ); |
|
| 139 | - $objPHPExcel->getActiveSheet ()->setCellValueByColumnAndRow ( 0, 100, "summary " . ($time_start - microtime ( true )) . " s" ); |
|
| 138 | + ExcelExportPunction::fillSummary($objPHPExcel); |
|
| 139 | + $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 100, "summary ".($time_start - microtime(true))." s"); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | \ No newline at end of file |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | private static $fnames; |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * @return \Hospitalplugin\Entities\Patient |
|
| 52 | + * @return string |
|
| 53 | 53 | */ |
| 54 | 54 | public static function getRandomPerson() |
| 55 | 55 | { |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * @param unknown $haystack |
|
| 74 | - * @param unknown $needle |
|
| 73 | + * @param string $haystack |
|
| 74 | + * @param string $needle |
|
| 75 | 75 | * @return boolean |
| 76 | 76 | */ |
| 77 | 77 | static function endsWith($haystack, $needle) |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | namespace Hospitalplugin\utils; |
| 25 | 25 | |
| 26 | 26 | use Hospitalplugin\Entities\Patient; |
| 27 | -use Hospitalplugin\Entities\PatientZZ; |
|
| 28 | 27 | |
| 29 | 28 | /** |
| 30 | 29 | * PersonGenerator |
@@ -1,26 +1,26 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PersonGenerator |
|
| 4 | - * |
|
| 5 | - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
|
| 6 | - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
|
| 7 | - * |
|
| 8 | - * Permission is hereby granted to use or copy this program |
|
| 9 | - * for any purpose, provided the above notices are retained on all copies. |
|
| 10 | - * Permission to modify the code and to distribute modified code is granted, |
|
| 11 | - * provided the above notices are retained, and a notice that the code was |
|
| 12 | - * modified is included with the above copyright notice. |
|
| 13 | - * |
|
| 14 | - * @category Wp |
|
| 15 | - * @package Punction |
|
| 16 | - * @author Andrzej Marcinkowski <[email protected]> |
|
| 17 | - * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz |
|
| 18 | - * @license MIT http://opensource.org/licenses/MIT |
|
| 19 | - * @version 1.0 $Id: a88997670673063e272ee5666aa86ed1ec9a1561 $ $Format:%H$ |
|
| 20 | - * @link http:// |
|
| 21 | - * @since File available since Release 1.0.0 |
|
| 22 | - * PHP Version 5 |
|
| 23 | - */ |
|
| 3 | + * PersonGenerator |
|
| 4 | + * |
|
| 5 | + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
|
| 6 | + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
|
| 7 | + * |
|
| 8 | + * Permission is hereby granted to use or copy this program |
|
| 9 | + * for any purpose, provided the above notices are retained on all copies. |
|
| 10 | + * Permission to modify the code and to distribute modified code is granted, |
|
| 11 | + * provided the above notices are retained, and a notice that the code was |
|
| 12 | + * modified is included with the above copyright notice. |
|
| 13 | + * |
|
| 14 | + * @category Wp |
|
| 15 | + * @package Punction |
|
| 16 | + * @author Andrzej Marcinkowski <[email protected]> |
|
| 17 | + * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz |
|
| 18 | + * @license MIT http://opensource.org/licenses/MIT |
|
| 19 | + * @version 1.0 $Id: a88997670673063e272ee5666aa86ed1ec9a1561 $ $Format:%H$ |
|
| 20 | + * @link http:// |
|
| 21 | + * @since File available since Release 1.0.0 |
|
| 22 | + * PHP Version 5 |
|
| 23 | + */ |
|
| 24 | 24 | namespace Hospitalplugin\utils; |
| 25 | 25 | |
| 26 | 26 | use Hospitalplugin\Entities\Patient; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * @return \Hospitalplugin\Entities\Patient |
| 53 | - */ |
|
| 53 | + */ |
|
| 54 | 54 | public static function getRandomPerson() |
| 55 | 55 | { |
| 56 | 56 | // TODO extract paths |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * |
|
| 97 | - * @param $date |
|
| 98 | - * @param $sex |
|
| 99 | - * 'm' / 'f' |
|
| 100 | - */ |
|
| 96 | + * |
|
| 97 | + * @param $date |
|
| 98 | + * @param $sex |
|
| 99 | + * 'm' / 'f' |
|
| 100 | + */ |
|
| 101 | 101 | public static function getRandomPesel($date, $sex = 'm') |
| 102 | 102 | { |
| 103 | 103 | $datetime = new \DateTime($date); |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | $intSum = 0; |
| 126 | 126 | for ($i = 0; $i < 10; $i ++) { |
| 127 | 127 | $intSum += $arrSteps[$i] * $x[$i]; // mnożymy każdy ze znaków |
| 128 | - // przez wagć i sumujemy |
|
| 129 | - // wszystko |
|
| 128 | + // przez wagć i sumujemy |
|
| 129 | + // wszystko |
|
| 130 | 130 | } |
| 131 | 131 | $int = 10 - $intSum % 10; // obliczamy sumć kontrolną |
| 132 | 132 | $intControlNr = ($int == 10) ? 0 : $int; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * |
| 140 | 140 | * @param unknown $arr |
| 141 | 141 | * @return string random element |
| 142 | - */ |
|
| 142 | + */ |
|
| 143 | 143 | public static function getRandom($arr) |
| 144 | 144 | { |
| 145 | 145 | return implode('', $arr[array_rand($arr)]); |
@@ -54,19 +54,19 @@ discard block |
||
| 54 | 54 | public static function getRandomPerson() |
| 55 | 55 | { |
| 56 | 56 | // TODO extract paths |
| 57 | - self::$names = Utils::readFileToArray(__DIR__ . '/../../resources/pl_names.csv'); |
|
| 58 | - self::$mnames = Utils::readFileToArray(__DIR__ . '/../../resources/pl_mnames.csv'); |
|
| 59 | - self::$fnames = Utils::readFileToArray(__DIR__ . '/../../resources/pl_fnames.csv'); |
|
| 57 | + self::$names = Utils::readFileToArray(__DIR__.'/../../resources/pl_names.csv'); |
|
| 58 | + self::$mnames = Utils::readFileToArray(__DIR__.'/../../resources/pl_mnames.csv'); |
|
| 59 | + self::$fnames = Utils::readFileToArray(__DIR__.'/../../resources/pl_fnames.csv'); |
|
| 60 | 60 | // var_dump(self::$mnames); |
| 61 | 61 | $sex = (rand(0, 1) == 0 ? 'm' : 'f'); |
| 62 | 62 | $firstname = ($sex == 'm' ? self::getRandom(self::$mnames) : self::getRandom(self::$fnames)); |
| 63 | 63 | $lastname = self::getRandom(self::$names); |
| 64 | 64 | if ($sex == 'f' && self::endsWith($lastname, 'i')) { |
| 65 | - $lastname = rtrim($lastname, "i") . 'a'; |
|
| 65 | + $lastname = rtrim($lastname, "i").'a'; |
|
| 66 | 66 | } |
| 67 | 67 | $bdate = self::getRandomBirthDate(); |
| 68 | 68 | $pesel = self::getRandomPesel($bdate, $sex); |
| 69 | - return $firstname . ' ' . $lastname . '|' . $pesel; |
|
| 69 | + return $firstname.' '.$lastname.'|'.$pesel; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | $age = rand(0, 100); |
| 88 | 88 | $dayOfYear = rand(0, 365); |
| 89 | - $interval = new \DateInterval('P' . $age . 'Y' . $dayOfYear . 'D'); |
|
| 89 | + $interval = new \DateInterval('P'.$age.'Y'.$dayOfYear.'D'); |
|
| 90 | 90 | $date = new \DateTime(); |
| 91 | 91 | $birth = $date->sub($interval); |
| 92 | 92 | return $birth->format('Y-m-d'); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @param $date1 $date1 string parsable date strtotime(date) |
| 46 | 46 | * @param $date2 $date2 string parsable date strtotime(date) |
| 47 | - * @return number |
|
| 47 | + * @return double |
|
| 48 | 48 | */ |
| 49 | 49 | public static function diffDates($date1, $date2) |
| 50 | 50 | { |
@@ -73,6 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @param $month int month 1-12 |
| 75 | 75 | * @param $day int day 1-31 |
| 76 | + * @param string $date |
|
| 76 | 77 | * @return string Y-m-d |
| 77 | 78 | */ |
| 78 | 79 | public static function getNextDayDate($date) |
@@ -84,7 +85,7 @@ discard block |
||
| 84 | 85 | /** |
| 85 | 86 | * precious day in Y-m-d format |
| 86 | 87 | * |
| 87 | - * @param $date sttring Y-m-d |
|
| 88 | + * @param string $date sttring Y-m-d |
|
| 88 | 89 | * @return string Y-m-d |
| 89 | 90 | */ |
| 90 | 91 | public static function getPreviousDay($date) |
@@ -118,8 +119,8 @@ discard block |
||
| 118 | 119 | * @return string date |
| 119 | 120 | * |
| 120 | 121 | * |
| 121 | - * @param $month int default null |
|
| 122 | - * @param $day int default null |
|
| 122 | + * @param integer $month int default null |
|
| 123 | + * @param integer $day int default null |
|
| 123 | 124 | */ |
| 124 | 125 | public static function getStartDate($month = null, $day = null) |
| 125 | 126 | { |
@@ -140,8 +141,8 @@ discard block |
||
| 140 | 141 | /** |
| 141 | 142 | * getEndDate |
| 142 | 143 | * |
| 143 | - * @param $month int default null |
|
| 144 | - * @param $day int default null |
|
| 144 | + * @param integer $month int default null |
|
| 145 | + * @param integer $day int default null |
|
| 145 | 146 | */ |
| 146 | 147 | public static function getEndDate($month = null, $day = null) |
| 147 | 148 | { |
@@ -216,7 +217,7 @@ discard block |
||
| 216 | 217 | /** |
| 217 | 218 | * read file to array |
| 218 | 219 | * |
| 219 | - * @param $url file url |
|
| 220 | + * @param string $url file url |
|
| 220 | 221 | * @param $delm default ; |
| 221 | 222 | * @param $encl default \ |
| 222 | 223 | * @param $head default false |
@@ -338,8 +339,9 @@ discard block |
||
| 338 | 339 | /** |
| 339 | 340 | * Class casting |
| 340 | 341 | * |
| 341 | - * @param string|object $destination |
|
| 342 | + * @param string $destination |
|
| 342 | 343 | * @param object $sourceObject |
| 344 | + * @param integer $arguments |
|
| 343 | 345 | * @return object |
| 344 | 346 | */ |
| 345 | 347 | static function cast($destination, $sourceObject, $arguments = NULL) |
@@ -330,7 +330,7 @@ |
||
| 330 | 330 | |
| 331 | 331 | // ź |
| 332 | 332 | chr(0x9F) => 'ź', |
| 333 | - chr(0xBC) => 'ź' |
|
| 333 | + chr(0xBC) => 'ź' |
|
| 334 | 334 | ); |
| 335 | 335 | return html_entity_decode(mb_convert_encoding(strtr($text, $map), 'UTF-8', 'ISO-8859-2'), ENT_QUOTES, 'UTF-8'); |
| 336 | 336 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public static function getNextDay($month, $day) |
| 67 | 67 | { |
| 68 | - return Utils::getNextDayDate('Y-' . $month . '-' . $day); |
|
| 68 | + return Utils::getNextDayDate('Y-'.$month.'-'.$day); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public static function getNextMonthFirstDay($month, $day) |
| 104 | 104 | { |
| 105 | - return date('Y-m-d', strtotime('+1 month', strtotime(date('Y-' . $month . '-01')))); |
|
| 105 | + return date('Y-m-d', strtotime('+1 month', strtotime(date('Y-'.$month.'-01')))); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | } else |
| 130 | 130 | if ($day == null) { |
| 131 | 131 | // first day of mnth |
| 132 | - $date = new \DateTime(date('Y-') . $month . '-01'); |
|
| 132 | + $date = new \DateTime(date('Y-').$month.'-01'); |
|
| 133 | 133 | } else { |
| 134 | 134 | // date |
| 135 | - $date = new \DateTime(date('Y-' . $month . '-' . $day)); |
|
| 135 | + $date = new \DateTime(date('Y-'.$month.'-'.$day)); |
|
| 136 | 136 | } |
| 137 | 137 | return $date->format('Y-m-d'); |
| 138 | 138 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public static function getStartEndDate($dateParam) |
| 172 | 172 | { |
| 173 | - if (empty($dateParam) || ! in_array($dateParam, array( |
|
| 173 | + if (empty($dateParam) || !in_array($dateParam, array( |
|
| 174 | 174 | 0, |
| 175 | 175 | 1, |
| 176 | 176 | 7 |
@@ -89,6 +89,7 @@ |
||
| 89 | 89 | * hospitalRegisterScript |
| 90 | 90 | * @param unknown $file |
| 91 | 91 | * @param unknown $required |
| 92 | + * @param string $hook |
|
| 92 | 93 | */ |
| 93 | 94 | public function hospitalRegisterScript($file, $required = null, $hook = null) |
| 94 | 95 | { |
@@ -1,26 +1,26 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * ScriptsAndStyles |
|
| 4 | - * |
|
| 5 | - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
|
| 6 | - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
|
| 7 | - * |
|
| 8 | - * Permission is hereby granted to use or copy this program |
|
| 9 | - * for any purpose, provided the above notices are retained on all copies. |
|
| 10 | - * Permission to modify the code and to distribute modified code is granted, |
|
| 11 | - * provided the above notices are retained, and a notice that the code was |
|
| 12 | - * modified is included with the above copyright notice. |
|
| 13 | - * |
|
| 14 | - * @category Wp |
|
| 15 | - * @package Punction |
|
| 16 | - * @author Andrzej Marcinkowski <[email protected]> |
|
| 17 | - * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz |
|
| 18 | - * @license MIT http://opensource.org/licenses/MIT |
|
| 19 | - * @version 1.0 $Format:%H$ |
|
| 20 | - * @link http:// |
|
| 21 | - * @since File available since Release 1.0.0 |
|
| 22 | - * PHP Version 5 |
|
| 23 | - */ |
|
| 3 | + * ScriptsAndStyles |
|
| 4 | + * |
|
| 5 | + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
|
| 6 | + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
|
| 7 | + * |
|
| 8 | + * Permission is hereby granted to use or copy this program |
|
| 9 | + * for any purpose, provided the above notices are retained on all copies. |
|
| 10 | + * Permission to modify the code and to distribute modified code is granted, |
|
| 11 | + * provided the above notices are retained, and a notice that the code was |
|
| 12 | + * modified is included with the above copyright notice. |
|
| 13 | + * |
|
| 14 | + * @category Wp |
|
| 15 | + * @package Punction |
|
| 16 | + * @author Andrzej Marcinkowski <[email protected]> |
|
| 17 | + * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz |
|
| 18 | + * @license MIT http://opensource.org/licenses/MIT |
|
| 19 | + * @version 1.0 $Format:%H$ |
|
| 20 | + * @link http:// |
|
| 21 | + * @since File available since Release 1.0.0 |
|
| 22 | + * PHP Version 5 |
|
| 23 | + */ |
|
| 24 | 24 | namespace Hospitalplugin\WP; |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function hospitalRegisterStyle($file) |
| 83 | 83 | { |
| 84 | - wp_register_style('hospital_admin_style' . $file, $this->path . '/css/' . $file, array(), '1', 'screen'); |
|
| 85 | - wp_enqueue_style('hospital_admin_style' . $file); |
|
| 84 | + wp_register_style('hospital_admin_style'.$file, $this->path.'/css/'.$file, array(), '1', 'screen'); |
|
| 85 | + wp_enqueue_style('hospital_admin_style'.$file); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function hospitalRegisterScript($file, $required = null, $hook = null) |
| 94 | 94 | { |
| 95 | - wp_enqueue_script('hospital_admin_script' . $file, $this->path . '/js/' . $file, $required); |
|
| 95 | + wp_enqueue_script('hospital_admin_script'.$file, $this->path.'/js/'.$file, $required); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $params = array( |
| 107 | 107 | 'my_arr' => $json_dates |
| 108 | 108 | ); |
| 109 | - wp_localize_script('hospital_admin_script' . $file, 'php_params', $params); |
|
| 109 | + wp_localize_script('hospital_admin_script'.$file, 'php_params', $params); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | use Punction\DB\DoctrineBootstrap; |
| 26 | 26 | |
| 27 | 27 | if (! defined ( 'ABSPATH' )) { |
| 28 | - define ( 'WP_USE_THEMES', false ); |
|
| 29 | - require ('/var/www/wp/wp-load.php'); |
|
| 28 | + define ( 'WP_USE_THEMES', false ); |
|
| 29 | + require ('/var/www/wp/wp-load.php'); |
|
| 30 | 30 | } |
| 31 | 31 | require_once ('/var/www/vendor/autoload.php'); |
| 32 | 32 | Logger::configure ( '../resources/log4php.xml' ); |
| 33 | 33 | /** |
| 34 | - * migration log4php logger |
|
| 35 | - */ |
|
| 34 | + * migration log4php logger |
|
| 35 | + */ |
|
| 36 | 36 | $log = Logger::getLogger ( "migration" ); |
| 37 | 37 | $log->info ( "Start!" ); |
| 38 | 38 | |
@@ -63,73 +63,73 @@ discard block |
||
| 63 | 63 | $entityManager = $db1->getEntityManager (); |
| 64 | 64 | |
| 65 | 65 | foreach ( $results as $result ) { |
| 66 | - /** |
|
| 67 | - */ |
|
| 68 | - $id = $result ['ID']; |
|
| 69 | - /** |
|
| 70 | - */ |
|
| 71 | - $title = $result ['post_title']; |
|
| 72 | - /** |
|
| 73 | - */ |
|
| 74 | - $pesel = implode ( get_post_meta ( $id, 'pesel' ) ); |
|
| 75 | - /** |
|
| 76 | - */ |
|
| 77 | - $oddzid = implode ( get_post_meta ( $id, 'oddzial.ID' ) ); |
|
| 78 | - /** |
|
| 79 | - */ |
|
| 66 | + /** |
|
| 67 | + */ |
|
| 68 | + $id = $result ['ID']; |
|
| 69 | + /** |
|
| 70 | + */ |
|
| 71 | + $title = $result ['post_title']; |
|
| 72 | + /** |
|
| 73 | + */ |
|
| 74 | + $pesel = implode ( get_post_meta ( $id, 'pesel' ) ); |
|
| 75 | + /** |
|
| 76 | + */ |
|
| 77 | + $oddzid = implode ( get_post_meta ( $id, 'oddzial.ID' ) ); |
|
| 78 | + /** |
|
| 79 | + */ |
|
| 80 | 80 | |
| 81 | - $numer_historii = implode ( get_post_meta ( $id, 'numer_ksiegi_glownej' ) ); |
|
| 82 | - /** |
|
| 83 | - */ |
|
| 84 | - $data_kategoryzacji = implode ( get_post_meta ( $id, 'data_kategoryzacji' ) ); |
|
| 85 | - /** |
|
| 86 | - */ |
|
| 87 | - $kategoria_pacjenta = implode ( get_post_meta ( $id, 'kategoria_pacjenta' ) ); |
|
| 88 | - /** |
|
| 89 | - */ |
|
| 90 | - $aktywnosc_fizyczna = implode ( get_post_meta ( $id, '1_aktywnosc_fizyczna' ) ); |
|
| 91 | - /** |
|
| 92 | - */ |
|
| 93 | - $higiena = implode ( get_post_meta ( $id, '2_higiena' ) ); |
|
| 94 | - /** |
|
| 95 | - */ |
|
| 96 | - $odzywianie = implode ( get_post_meta ( $id, '3_odzywianie' ) ); |
|
| 97 | - /** |
|
| 98 | - */ |
|
| 99 | - $wydalanie = implode ( get_post_meta ( $id, '4_wydalanie' ) ); |
|
| 100 | - /** |
|
| 101 | - */ |
|
| 102 | - $pomiar_objawow_zyciowych = implode ( get_post_meta ( $id, '5_pomiar_objawow_zyciowych' ) ); |
|
| 103 | - /** |
|
| 104 | - */ |
|
| 105 | - $leczenie = implode ( get_post_meta ( $id, '6_leczenie' ) ); |
|
| 106 | - /** |
|
| 107 | - */ |
|
| 108 | - $edukacja_i_wsparcie_psychiczne = implode ( get_post_meta ( $id, '7_edukacja_i_wsparcie_psychiczne' ) ); |
|
| 81 | + $numer_historii = implode ( get_post_meta ( $id, 'numer_ksiegi_glownej' ) ); |
|
| 82 | + /** |
|
| 83 | + */ |
|
| 84 | + $data_kategoryzacji = implode ( get_post_meta ( $id, 'data_kategoryzacji' ) ); |
|
| 85 | + /** |
|
| 86 | + */ |
|
| 87 | + $kategoria_pacjenta = implode ( get_post_meta ( $id, 'kategoria_pacjenta' ) ); |
|
| 88 | + /** |
|
| 89 | + */ |
|
| 90 | + $aktywnosc_fizyczna = implode ( get_post_meta ( $id, '1_aktywnosc_fizyczna' ) ); |
|
| 91 | + /** |
|
| 92 | + */ |
|
| 93 | + $higiena = implode ( get_post_meta ( $id, '2_higiena' ) ); |
|
| 94 | + /** |
|
| 95 | + */ |
|
| 96 | + $odzywianie = implode ( get_post_meta ( $id, '3_odzywianie' ) ); |
|
| 97 | + /** |
|
| 98 | + */ |
|
| 99 | + $wydalanie = implode ( get_post_meta ( $id, '4_wydalanie' ) ); |
|
| 100 | + /** |
|
| 101 | + */ |
|
| 102 | + $pomiar_objawow_zyciowych = implode ( get_post_meta ( $id, '5_pomiar_objawow_zyciowych' ) ); |
|
| 103 | + /** |
|
| 104 | + */ |
|
| 105 | + $leczenie = implode ( get_post_meta ( $id, '6_leczenie' ) ); |
|
| 106 | + /** |
|
| 107 | + */ |
|
| 108 | + $edukacja_i_wsparcie_psychiczne = implode ( get_post_meta ( $id, '7_edukacja_i_wsparcie_psychiczne' ) ); |
|
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - */ |
|
| 112 | - $patient = new PatientZZ (); |
|
| 113 | - $patient->setName ( $title ); |
|
| 114 | - if ($data_kategoryzacji == null) { |
|
| 115 | - $log->warn ( "Patient " . $id . " missing date. Omitting." ); |
|
| 116 | - continue; |
|
| 117 | - } |
|
| 118 | - $patient->setDataKategoryzacji ( \DateTime::createFromFormat ( "d-m-Y", $data_kategoryzacji ) ); |
|
| 119 | - $patient->setOddzialId ( $oddzid ); |
|
| 120 | - $patient->setNumerHistorii ( $numer_historii ); |
|
| 110 | + /** |
|
| 111 | + */ |
|
| 112 | + $patient = new PatientZZ (); |
|
| 113 | + $patient->setName ( $title ); |
|
| 114 | + if ($data_kategoryzacji == null) { |
|
| 115 | + $log->warn ( "Patient " . $id . " missing date. Omitting." ); |
|
| 116 | + continue; |
|
| 117 | + } |
|
| 118 | + $patient->setDataKategoryzacji ( \DateTime::createFromFormat ( "d-m-Y", $data_kategoryzacji ) ); |
|
| 119 | + $patient->setOddzialId ( $oddzid ); |
|
| 120 | + $patient->setNumerHistorii ( $numer_historii ); |
|
| 121 | 121 | |
| 122 | - $patient->setPesel ( $pesel ); |
|
| 123 | - $patient->setKategoriaPacjenta ( $kategoria_pacjenta ); |
|
| 124 | - $patient->setAktywnoscFizyczna ( $aktywnosc_fizyczna ); |
|
| 125 | - $patient->setHigiena ( $higiena ); |
|
| 126 | - $patient->setOdzywianie ( $odzywianie ); |
|
| 127 | - $patient->setWydalanie ( $wydalanie ); |
|
| 128 | - $patient->setPomiarObjawowZyciowych ( $pomiar_objawow_zyciowych ); |
|
| 129 | - $patient->setLeczenie ( $leczenie ); |
|
| 130 | - $patient->setEdukacjaIWsparciePsychiczne ( $edukacja_i_wsparcie_psychiczne ); |
|
| 122 | + $patient->setPesel ( $pesel ); |
|
| 123 | + $patient->setKategoriaPacjenta ( $kategoria_pacjenta ); |
|
| 124 | + $patient->setAktywnoscFizyczna ( $aktywnosc_fizyczna ); |
|
| 125 | + $patient->setHigiena ( $higiena ); |
|
| 126 | + $patient->setOdzywianie ( $odzywianie ); |
|
| 127 | + $patient->setWydalanie ( $wydalanie ); |
|
| 128 | + $patient->setPomiarObjawowZyciowych ( $pomiar_objawow_zyciowych ); |
|
| 129 | + $patient->setLeczenie ( $leczenie ); |
|
| 130 | + $patient->setEdukacjaIWsparciePsychiczne ( $edukacja_i_wsparcie_psychiczne ); |
|
| 131 | 131 | |
| 132 | - $entityManager->persist ( $patient ); |
|
| 132 | + $entityManager->persist ( $patient ); |
|
| 133 | 133 | } |
| 134 | 134 | $entityManager->flush (); |
| 135 | 135 | $log->info ( "Stop!" ); |
@@ -24,17 +24,17 @@ discard block |
||
| 24 | 24 | use Hospitalplugin\Entities\PatientZZ; |
| 25 | 25 | use Punction\DB\DoctrineBootstrap; |
| 26 | 26 | |
| 27 | -if (! defined ( 'ABSPATH' )) { |
|
| 28 | - define ( 'WP_USE_THEMES', false ); |
|
| 27 | +if (!defined('ABSPATH')) { |
|
| 28 | + define('WP_USE_THEMES', false); |
|
| 29 | 29 | require ('/var/www/wp/wp-load.php'); |
| 30 | 30 | } |
| 31 | 31 | require_once ('/var/www/vendor/autoload.php'); |
| 32 | -Logger::configure ( '../resources/log4php.xml' ); |
|
| 32 | +Logger::configure('../resources/log4php.xml'); |
|
| 33 | 33 | /** |
| 34 | 34 | * migration log4php logger |
| 35 | 35 | */ |
| 36 | -$log = Logger::getLogger ( "migration" ); |
|
| 37 | -$log->info ( "Start!" ); |
|
| 36 | +$log = Logger::getLogger("migration"); |
|
| 37 | +$log->info("Start!"); |
|
| 38 | 38 | |
| 39 | 39 | global $wpdb; |
| 40 | 40 | /** |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | $error = "Error: the query failed..."; |
| 58 | 58 | /** |
| 59 | 59 | */ |
| 60 | -$results = $wpdb->get_results ( $query, ARRAY_A ) || wp_die ( $error ); |
|
| 60 | +$results = $wpdb->get_results($query, ARRAY_A) || wp_die($error); |
|
| 61 | 61 | |
| 62 | -$db1 = new DoctrineBootstrap (); |
|
| 63 | -$entityManager = $db1->getEntityManager (); |
|
| 62 | +$db1 = new DoctrineBootstrap(); |
|
| 63 | +$entityManager = $db1->getEntityManager(); |
|
| 64 | 64 | |
| 65 | -foreach ( $results as $result ) { |
|
| 65 | +foreach ($results as $result) { |
|
| 66 | 66 | /** |
| 67 | 67 | */ |
| 68 | 68 | $id = $result ['ID']; |
@@ -71,65 +71,65 @@ discard block |
||
| 71 | 71 | $title = $result ['post_title']; |
| 72 | 72 | /** |
| 73 | 73 | */ |
| 74 | - $pesel = implode ( get_post_meta ( $id, 'pesel' ) ); |
|
| 74 | + $pesel = implode(get_post_meta($id, 'pesel')); |
|
| 75 | 75 | /** |
| 76 | 76 | */ |
| 77 | - $oddzid = implode ( get_post_meta ( $id, 'oddzial.ID' ) ); |
|
| 77 | + $oddzid = implode(get_post_meta($id, 'oddzial.ID')); |
|
| 78 | 78 | /** |
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | - $numer_historii = implode ( get_post_meta ( $id, 'numer_ksiegi_glownej' ) ); |
|
| 81 | + $numer_historii = implode(get_post_meta($id, 'numer_ksiegi_glownej')); |
|
| 82 | 82 | /** |
| 83 | 83 | */ |
| 84 | - $data_kategoryzacji = implode ( get_post_meta ( $id, 'data_kategoryzacji' ) ); |
|
| 84 | + $data_kategoryzacji = implode(get_post_meta($id, 'data_kategoryzacji')); |
|
| 85 | 85 | /** |
| 86 | 86 | */ |
| 87 | - $kategoria_pacjenta = implode ( get_post_meta ( $id, 'kategoria_pacjenta' ) ); |
|
| 87 | + $kategoria_pacjenta = implode(get_post_meta($id, 'kategoria_pacjenta')); |
|
| 88 | 88 | /** |
| 89 | 89 | */ |
| 90 | - $aktywnosc_fizyczna = implode ( get_post_meta ( $id, '1_aktywnosc_fizyczna' ) ); |
|
| 90 | + $aktywnosc_fizyczna = implode(get_post_meta($id, '1_aktywnosc_fizyczna')); |
|
| 91 | 91 | /** |
| 92 | 92 | */ |
| 93 | - $higiena = implode ( get_post_meta ( $id, '2_higiena' ) ); |
|
| 93 | + $higiena = implode(get_post_meta($id, '2_higiena')); |
|
| 94 | 94 | /** |
| 95 | 95 | */ |
| 96 | - $odzywianie = implode ( get_post_meta ( $id, '3_odzywianie' ) ); |
|
| 96 | + $odzywianie = implode(get_post_meta($id, '3_odzywianie')); |
|
| 97 | 97 | /** |
| 98 | 98 | */ |
| 99 | - $wydalanie = implode ( get_post_meta ( $id, '4_wydalanie' ) ); |
|
| 99 | + $wydalanie = implode(get_post_meta($id, '4_wydalanie')); |
|
| 100 | 100 | /** |
| 101 | 101 | */ |
| 102 | - $pomiar_objawow_zyciowych = implode ( get_post_meta ( $id, '5_pomiar_objawow_zyciowych' ) ); |
|
| 102 | + $pomiar_objawow_zyciowych = implode(get_post_meta($id, '5_pomiar_objawow_zyciowych')); |
|
| 103 | 103 | /** |
| 104 | 104 | */ |
| 105 | - $leczenie = implode ( get_post_meta ( $id, '6_leczenie' ) ); |
|
| 105 | + $leczenie = implode(get_post_meta($id, '6_leczenie')); |
|
| 106 | 106 | /** |
| 107 | 107 | */ |
| 108 | - $edukacja_i_wsparcie_psychiczne = implode ( get_post_meta ( $id, '7_edukacja_i_wsparcie_psychiczne' ) ); |
|
| 108 | + $edukacja_i_wsparcie_psychiczne = implode(get_post_meta($id, '7_edukacja_i_wsparcie_psychiczne')); |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | */ |
| 112 | - $patient = new PatientZZ (); |
|
| 113 | - $patient->setName ( $title ); |
|
| 112 | + $patient = new PatientZZ(); |
|
| 113 | + $patient->setName($title); |
|
| 114 | 114 | if ($data_kategoryzacji == null) { |
| 115 | - $log->warn ( "Patient " . $id . " missing date. Omitting." ); |
|
| 115 | + $log->warn("Patient ".$id." missing date. Omitting."); |
|
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | - $patient->setDataKategoryzacji ( \DateTime::createFromFormat ( "d-m-Y", $data_kategoryzacji ) ); |
|
| 119 | - $patient->setOddzialId ( $oddzid ); |
|
| 120 | - $patient->setNumerHistorii ( $numer_historii ); |
|
| 118 | + $patient->setDataKategoryzacji(\DateTime::createFromFormat("d-m-Y", $data_kategoryzacji)); |
|
| 119 | + $patient->setOddzialId($oddzid); |
|
| 120 | + $patient->setNumerHistorii($numer_historii); |
|
| 121 | 121 | |
| 122 | - $patient->setPesel ( $pesel ); |
|
| 123 | - $patient->setKategoriaPacjenta ( $kategoria_pacjenta ); |
|
| 124 | - $patient->setAktywnoscFizyczna ( $aktywnosc_fizyczna ); |
|
| 125 | - $patient->setHigiena ( $higiena ); |
|
| 126 | - $patient->setOdzywianie ( $odzywianie ); |
|
| 127 | - $patient->setWydalanie ( $wydalanie ); |
|
| 128 | - $patient->setPomiarObjawowZyciowych ( $pomiar_objawow_zyciowych ); |
|
| 129 | - $patient->setLeczenie ( $leczenie ); |
|
| 130 | - $patient->setEdukacjaIWsparciePsychiczne ( $edukacja_i_wsparcie_psychiczne ); |
|
| 122 | + $patient->setPesel($pesel); |
|
| 123 | + $patient->setKategoriaPacjenta($kategoria_pacjenta); |
|
| 124 | + $patient->setAktywnoscFizyczna($aktywnosc_fizyczna); |
|
| 125 | + $patient->setHigiena($higiena); |
|
| 126 | + $patient->setOdzywianie($odzywianie); |
|
| 127 | + $patient->setWydalanie($wydalanie); |
|
| 128 | + $patient->setPomiarObjawowZyciowych($pomiar_objawow_zyciowych); |
|
| 129 | + $patient->setLeczenie($leczenie); |
|
| 130 | + $patient->setEdukacjaIWsparciePsychiczne($edukacja_i_wsparcie_psychiczne); |
|
| 131 | 131 | |
| 132 | - $entityManager->persist ( $patient ); |
|
| 132 | + $entityManager->persist($patient); |
|
| 133 | 133 | } |
| 134 | -$entityManager->flush (); |
|
| 135 | -$log->info ( "Stop!" ); |
|
| 134 | +$entityManager->flush(); |
|
| 135 | +$log->info("Stop!"); |
|
@@ -46,228 +46,228 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | class Infections extends InfectionRaport { |
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 51 | - */ |
|
| 52 | - public $G; |
|
| 49 | + /** |
|
| 50 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 51 | + */ |
|
| 52 | + public $G; |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 56 | - */ |
|
| 57 | - public $A; |
|
| 54 | + /** |
|
| 55 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 56 | + */ |
|
| 57 | + public $A; |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 61 | - */ |
|
| 62 | - public $B; |
|
| 59 | + /** |
|
| 60 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 61 | + */ |
|
| 62 | + public $B; |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 66 | - */ |
|
| 67 | - public $Bzak; |
|
| 64 | + /** |
|
| 65 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 66 | + */ |
|
| 67 | + public $Bzak; |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 71 | - */ |
|
| 72 | - public $ZMO; |
|
| 69 | + /** |
|
| 70 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 71 | + */ |
|
| 72 | + public $ZMO; |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 76 | - */ |
|
| 77 | - public $ZUM; |
|
| 74 | + /** |
|
| 75 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 76 | + */ |
|
| 77 | + public $ZUM; |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 81 | - */ |
|
| 82 | - public $PNEUVAP; |
|
| 79 | + /** |
|
| 80 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 81 | + */ |
|
| 82 | + public $PNEUVAP; |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 86 | - */ |
|
| 87 | - public $ZODC; |
|
| 84 | + /** |
|
| 85 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 86 | + */ |
|
| 87 | + public $ZODC; |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 91 | - */ |
|
| 92 | - public $ZKR; |
|
| 89 | + /** |
|
| 90 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 91 | + */ |
|
| 92 | + public $ZKR; |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 96 | - */ |
|
| 97 | - public $ROZIII; |
|
| 94 | + /** |
|
| 95 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 96 | + */ |
|
| 97 | + public $ROZIII; |
|
| 98 | 98 | |
| 99 | - /** |
|
| 100 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 101 | - */ |
|
| 102 | - public $ROZII; |
|
| 99 | + /** |
|
| 100 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 101 | + */ |
|
| 102 | + public $ROZII; |
|
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 106 | - */ |
|
| 107 | - public $OIOM; |
|
| 104 | + /** |
|
| 105 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 106 | + */ |
|
| 107 | + public $OIOM; |
|
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 111 | - */ |
|
| 112 | - public $BM; |
|
| 109 | + /** |
|
| 110 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 111 | + */ |
|
| 112 | + public $BM; |
|
| 113 | 113 | |
| 114 | - /** |
|
| 115 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 116 | - */ |
|
| 117 | - public $IZOL; |
|
| 114 | + /** |
|
| 115 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 116 | + */ |
|
| 117 | + public $IZOL; |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 121 | - */ |
|
| 122 | - public $ZAK; |
|
| 119 | + /** |
|
| 120 | + * @Column(columnDefinition="SMALLINT NOT NULL DEFAULT 0") * |
|
| 121 | + */ |
|
| 122 | + public $ZAK; |
|
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * @Column(type="string", length=1000) |
|
| 126 | - */ |
|
| 127 | - public $Uwagi; |
|
| 124 | + /** |
|
| 125 | + * @Column(type="string", length=1000) |
|
| 126 | + */ |
|
| 127 | + public $Uwagi; |
|
| 128 | 128 | |
| 129 | - /** |
|
| 130 | - * @Column(type="string", length=1000) |
|
| 131 | - */ |
|
| 132 | - public $Weryfikacja = ""; |
|
| 133 | - public function getG() { |
|
| 134 | - return $this->G; |
|
| 135 | - } |
|
| 136 | - public function setG($G) { |
|
| 137 | - $this->G = $G; |
|
| 138 | - return $this; |
|
| 139 | - } |
|
| 140 | - public function getA() { |
|
| 141 | - return $this->A; |
|
| 142 | - } |
|
| 143 | - public function setA($A) { |
|
| 144 | - $this->A = $A; |
|
| 145 | - return $this; |
|
| 146 | - } |
|
| 147 | - public function getB() { |
|
| 148 | - return $this->B; |
|
| 149 | - } |
|
| 150 | - public function setB($B) { |
|
| 151 | - $this->B = $B; |
|
| 152 | - return $this; |
|
| 153 | - } |
|
| 154 | - public function getBzak() { |
|
| 155 | - return $this->Bzak; |
|
| 156 | - } |
|
| 157 | - public function setBzak($Bzak) { |
|
| 158 | - $this->Bzak = $Bzak; |
|
| 159 | - return $this; |
|
| 160 | - } |
|
| 161 | - public function getZMO() { |
|
| 162 | - return $this->ZMO; |
|
| 163 | - } |
|
| 164 | - public function setZMO($ZMO) { |
|
| 165 | - $this->ZMO = $ZMO; |
|
| 166 | - return $this; |
|
| 167 | - } |
|
| 168 | - public function getZUM() { |
|
| 169 | - return $this->ZUM; |
|
| 170 | - } |
|
| 171 | - public function setZUM($ZUM) { |
|
| 172 | - $this->ZUM = $ZUM; |
|
| 173 | - return $this; |
|
| 174 | - } |
|
| 175 | - public function getPNEUVAP() { |
|
| 176 | - return $this->PNEUVAP; |
|
| 177 | - } |
|
| 178 | - public function setPNEUVAP($PNEUVAP) { |
|
| 179 | - $this->PNEUVAP = $PNEUVAP; |
|
| 180 | - return $this; |
|
| 181 | - } |
|
| 182 | - public function getZODC() { |
|
| 183 | - return $this->ZODC; |
|
| 184 | - } |
|
| 185 | - public function setZODC($ZODC) { |
|
| 186 | - $this->ZODC = $ZODC; |
|
| 187 | - return $this; |
|
| 188 | - } |
|
| 189 | - public function getZKR() { |
|
| 190 | - return $this->ZKR; |
|
| 191 | - } |
|
| 192 | - public function setZKR($ZKR) { |
|
| 193 | - $this->ZKR = $ZKR; |
|
| 194 | - return $this; |
|
| 195 | - } |
|
| 196 | - public function getOIOM() { |
|
| 197 | - return $this->OIOM; |
|
| 198 | - } |
|
| 199 | - public function setOIOM($OIOM) { |
|
| 200 | - $this->OIOM = $OIOM; |
|
| 201 | - return $this; |
|
| 202 | - } |
|
| 203 | - public function getBM() { |
|
| 204 | - return $this->BM; |
|
| 205 | - } |
|
| 206 | - public function setBM($BM) { |
|
| 207 | - $this->BM = $BM; |
|
| 208 | - return $this; |
|
| 209 | - } |
|
| 210 | - public function getIZOL() { |
|
| 211 | - return $this->IZOL; |
|
| 212 | - } |
|
| 213 | - public function setIZOL($IZOL) { |
|
| 214 | - $this->IZOL = $IZOL; |
|
| 215 | - return $this; |
|
| 216 | - } |
|
| 217 | - public function getZAK() { |
|
| 218 | - return $this->ZAK; |
|
| 219 | - } |
|
| 220 | - public function setZAK($ZAK) { |
|
| 221 | - $this->ZAK = $ZAK; |
|
| 222 | - return $this; |
|
| 223 | - } |
|
| 224 | - public function getROZIII() { |
|
| 225 | - return $this->ROZIII; |
|
| 226 | - } |
|
| 227 | - public function setROZIII($ROZIII) { |
|
| 228 | - $this->ROZIII = $ROZIII; |
|
| 229 | - return $this; |
|
| 230 | - } |
|
| 231 | - public function getROZII() { |
|
| 232 | - return $this->ROZII; |
|
| 233 | - } |
|
| 234 | - public function setROZII($ROZII) { |
|
| 235 | - $this->ROZII = $ROZII; |
|
| 236 | - return $this; |
|
| 237 | - } |
|
| 238 | - public function getUwagi() { |
|
| 239 | - return $this->Uwagi; |
|
| 240 | - } |
|
| 241 | - public function setUwagi($Uwagi) { |
|
| 242 | - $this->Uwagi = $Uwagi; |
|
| 243 | - return $this; |
|
| 244 | - } |
|
| 245 | - public function getWeryfikacja() { |
|
| 246 | - return $this->Weryfikacja; |
|
| 247 | - } |
|
| 248 | - public function setWeryfikacja($Weryfikacja) { |
|
| 249 | - $this->Weryfikacja = $Weryfikacja; |
|
| 250 | - return $this; |
|
| 251 | - } |
|
| 252 | - public static function getFields() { |
|
| 253 | - return array ( |
|
| 254 | - "Data raportu" => "dataRaportu", |
|
| 255 | - "Oddział" => "ward", |
|
| 256 | - "G" => "G", |
|
| 257 | - "A" => "A", |
|
| 258 | - "B" => "B", |
|
| 259 | - "Bzak" => "Bzak", |
|
| 260 | - "ZMO" => "ZMO", |
|
| 261 | - "ZUM" => "ZUM", |
|
| 262 | - "PNEU-VAP" => "PNEUVAP", |
|
| 263 | - "ZODC" => "ZODC", |
|
| 264 | - "ZKR" => "ZKR", |
|
| 265 | - "ROZ-III" => "ROZIII", |
|
| 266 | - "ROZ-II" => "ROZII", |
|
| 267 | - "OIOM" => "OIOM", |
|
| 268 | - "BM" => "BM", |
|
| 269 | - "IZOL" => "IZOL", |
|
| 270 | - "ZAK" => "ZAK" |
|
| 271 | - ); |
|
| 272 | - } |
|
| 129 | + /** |
|
| 130 | + * @Column(type="string", length=1000) |
|
| 131 | + */ |
|
| 132 | + public $Weryfikacja = ""; |
|
| 133 | + public function getG() { |
|
| 134 | + return $this->G; |
|
| 135 | + } |
|
| 136 | + public function setG($G) { |
|
| 137 | + $this->G = $G; |
|
| 138 | + return $this; |
|
| 139 | + } |
|
| 140 | + public function getA() { |
|
| 141 | + return $this->A; |
|
| 142 | + } |
|
| 143 | + public function setA($A) { |
|
| 144 | + $this->A = $A; |
|
| 145 | + return $this; |
|
| 146 | + } |
|
| 147 | + public function getB() { |
|
| 148 | + return $this->B; |
|
| 149 | + } |
|
| 150 | + public function setB($B) { |
|
| 151 | + $this->B = $B; |
|
| 152 | + return $this; |
|
| 153 | + } |
|
| 154 | + public function getBzak() { |
|
| 155 | + return $this->Bzak; |
|
| 156 | + } |
|
| 157 | + public function setBzak($Bzak) { |
|
| 158 | + $this->Bzak = $Bzak; |
|
| 159 | + return $this; |
|
| 160 | + } |
|
| 161 | + public function getZMO() { |
|
| 162 | + return $this->ZMO; |
|
| 163 | + } |
|
| 164 | + public function setZMO($ZMO) { |
|
| 165 | + $this->ZMO = $ZMO; |
|
| 166 | + return $this; |
|
| 167 | + } |
|
| 168 | + public function getZUM() { |
|
| 169 | + return $this->ZUM; |
|
| 170 | + } |
|
| 171 | + public function setZUM($ZUM) { |
|
| 172 | + $this->ZUM = $ZUM; |
|
| 173 | + return $this; |
|
| 174 | + } |
|
| 175 | + public function getPNEUVAP() { |
|
| 176 | + return $this->PNEUVAP; |
|
| 177 | + } |
|
| 178 | + public function setPNEUVAP($PNEUVAP) { |
|
| 179 | + $this->PNEUVAP = $PNEUVAP; |
|
| 180 | + return $this; |
|
| 181 | + } |
|
| 182 | + public function getZODC() { |
|
| 183 | + return $this->ZODC; |
|
| 184 | + } |
|
| 185 | + public function setZODC($ZODC) { |
|
| 186 | + $this->ZODC = $ZODC; |
|
| 187 | + return $this; |
|
| 188 | + } |
|
| 189 | + public function getZKR() { |
|
| 190 | + return $this->ZKR; |
|
| 191 | + } |
|
| 192 | + public function setZKR($ZKR) { |
|
| 193 | + $this->ZKR = $ZKR; |
|
| 194 | + return $this; |
|
| 195 | + } |
|
| 196 | + public function getOIOM() { |
|
| 197 | + return $this->OIOM; |
|
| 198 | + } |
|
| 199 | + public function setOIOM($OIOM) { |
|
| 200 | + $this->OIOM = $OIOM; |
|
| 201 | + return $this; |
|
| 202 | + } |
|
| 203 | + public function getBM() { |
|
| 204 | + return $this->BM; |
|
| 205 | + } |
|
| 206 | + public function setBM($BM) { |
|
| 207 | + $this->BM = $BM; |
|
| 208 | + return $this; |
|
| 209 | + } |
|
| 210 | + public function getIZOL() { |
|
| 211 | + return $this->IZOL; |
|
| 212 | + } |
|
| 213 | + public function setIZOL($IZOL) { |
|
| 214 | + $this->IZOL = $IZOL; |
|
| 215 | + return $this; |
|
| 216 | + } |
|
| 217 | + public function getZAK() { |
|
| 218 | + return $this->ZAK; |
|
| 219 | + } |
|
| 220 | + public function setZAK($ZAK) { |
|
| 221 | + $this->ZAK = $ZAK; |
|
| 222 | + return $this; |
|
| 223 | + } |
|
| 224 | + public function getROZIII() { |
|
| 225 | + return $this->ROZIII; |
|
| 226 | + } |
|
| 227 | + public function setROZIII($ROZIII) { |
|
| 228 | + $this->ROZIII = $ROZIII; |
|
| 229 | + return $this; |
|
| 230 | + } |
|
| 231 | + public function getROZII() { |
|
| 232 | + return $this->ROZII; |
|
| 233 | + } |
|
| 234 | + public function setROZII($ROZII) { |
|
| 235 | + $this->ROZII = $ROZII; |
|
| 236 | + return $this; |
|
| 237 | + } |
|
| 238 | + public function getUwagi() { |
|
| 239 | + return $this->Uwagi; |
|
| 240 | + } |
|
| 241 | + public function setUwagi($Uwagi) { |
|
| 242 | + $this->Uwagi = $Uwagi; |
|
| 243 | + return $this; |
|
| 244 | + } |
|
| 245 | + public function getWeryfikacja() { |
|
| 246 | + return $this->Weryfikacja; |
|
| 247 | + } |
|
| 248 | + public function setWeryfikacja($Weryfikacja) { |
|
| 249 | + $this->Weryfikacja = $Weryfikacja; |
|
| 250 | + return $this; |
|
| 251 | + } |
|
| 252 | + public static function getFields() { |
|
| 253 | + return array ( |
|
| 254 | + "Data raportu" => "dataRaportu", |
|
| 255 | + "Oddział" => "ward", |
|
| 256 | + "G" => "G", |
|
| 257 | + "A" => "A", |
|
| 258 | + "B" => "B", |
|
| 259 | + "Bzak" => "Bzak", |
|
| 260 | + "ZMO" => "ZMO", |
|
| 261 | + "ZUM" => "ZUM", |
|
| 262 | + "PNEU-VAP" => "PNEUVAP", |
|
| 263 | + "ZODC" => "ZODC", |
|
| 264 | + "ZKR" => "ZKR", |
|
| 265 | + "ROZ-III" => "ROZIII", |
|
| 266 | + "ROZ-II" => "ROZII", |
|
| 267 | + "OIOM" => "OIOM", |
|
| 268 | + "BM" => "BM", |
|
| 269 | + "IZOL" => "IZOL", |
|
| 270 | + "ZAK" => "ZAK" |
|
| 271 | + ); |
|
| 272 | + } |
|
| 273 | 273 | } |
@@ -250,7 +250,7 @@ |
||
| 250 | 250 | return $this; |
| 251 | 251 | } |
| 252 | 252 | public static function getFields() { |
| 253 | - return array ( |
|
| 253 | + return array( |
|
| 254 | 254 | "Data raportu" => "dataRaportu", |
| 255 | 255 | "Oddział" => "ward", |
| 256 | 256 | "G" => "G", |