Completed
Push — master ( 17af13...acdc2b )
by Andrzej
02:44
created
src/Entities/PatientRaport.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
 	 * @param unknown $date        	
15 15
 	 */
16 16
 	public static function getRaport($wardId, $date, $wardType) {
17
-		$startDate = $date . '-01';
18
-		$endDate = date ( "Y-m-t 23:59:59", strtotime ( $startDate ) );
17
+		$startDate = $date.'-01';
18
+		$endDate = date("Y-m-t 23:59:59", strtotime($startDate));
19 19
 		
20
-		return PatientRaport::getRaportBetweenDates ( $wardId, $wardType, $startDate, $endDate );
20
+		return PatientRaport::getRaportBetweenDates($wardId, $wardType, $startDate, $endDate);
21 21
 	}
22 22
 	private static function getQuery($type) {
23 23
 		if ($type == 'POR') {
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 			$dql2 .= " FROM Hospitalplugin\Entities\PatientPOR p ";
32 32
 			$dql2 .= " WHERE p.dataKategoryzacji BETWEEN ?1 AND ?2 AND p.oddzialId = ?3 AND (p.iICzas <> 3 OR p.iICzas IS NULL)";
33 33
 			$dql2 .= " GROUP BY data, p.kategoriaPacjenta";
34
-			return array (
34
+			return array(
35 35
 					$dql1,
36 36
 					$dql2 
37 37
 			);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$dql .= " FROM Hospitalplugin\Entities\Patient p ";
42 42
 			$dql .= " WHERE p.dataKategoryzacji BETWEEN ?1 AND ?2 AND p.oddzialId = ?3";
43 43
 			$dql .= " GROUP BY data, p.kategoriaPacjenta";
44
-			return array (
44
+			return array(
45 45
 					$dql 
46 46
 			);
47 47
 		}
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 	 * @return array
56 56
 	 */
57 57
 	public static function getRaportBetweenDates($wardId, $type, $startDate, $endDate) {
58
-		$em = DoctrineBootstrap::getEntityManager ();
59
-		$em->getConfiguration ()->addCustomDatetimeFunction ( 'DATE', 'Hospitalplugin\DQLFunctions\DateFunction' );
60
-		$dql = PatientRaport::getQuery ( $type );
61
-		$allResults = array ();
62
-		foreach ( $dql as $query ) {
63
-			$result = $em->createQuery ( $query )->setParameter ( 1, $startDate )->setParameter ( 2, $endDate )->setParameter ( 3, $wardId )->getResult ();
64
-			$allResults = array_merge ( $result, $allResults );
58
+		$em = DoctrineBootstrap::getEntityManager();
59
+		$em->getConfiguration()->addCustomDatetimeFunction('DATE', 'Hospitalplugin\DQLFunctions\DateFunction');
60
+		$dql = PatientRaport::getQuery($type);
61
+		$allResults = array();
62
+		foreach ($dql as $query) {
63
+			$result = $em->createQuery($query)->setParameter(1, $startDate)->setParameter(2, $endDate)->setParameter(3, $wardId)->getResult();
64
+			$allResults = array_merge($result, $allResults);
65 65
 		}
66 66
 		
67
-		$table = array ();
68
-		foreach ( $allResults as $row ) {
67
+		$table = array();
68
+		foreach ($allResults as $row) {
69 69
 			$table [$row ['data']] [$row ['kategoria']] = $row ['suma'];
70 70
 		}
71 71
 		return $table;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	static function getColumns($type) {
77 77
 		if ($type == 'POR') {
78
-			return array (
78
+			return array(
79 79
 					'N1 naturalny',
80 80
 					'N2 naturalny',
81 81
 					'N3 naturalny',
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 					'Tpb/dzień'
104 104
 			);
105 105
 		} else {
106
-			return array (
106
+			return array(
107 107
 					'N1',
108 108
 					'N2',
109 109
 					'N3',
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	}
126 126
 	static function getIndexes($type) {
127 127
 		if ($type == 'POR') {
128
-			return array (
128
+			return array(
129 129
 					'1',
130 130
 					'2',
131 131
 					'3',
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 					'0'
136 136
 			);
137 137
 		} else {
138
-			return array (
138
+			return array(
139 139
 					'1',
140 140
 					'2',
141 141
 					'3',
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	static function getTpb($type) {
155 155
 		if ($type == 'ZZ' || $type == 'PED') {
156
-			return array (
156
+			return array(
157 157
 					38,
158 158
 					95,
159 159
 					159,
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 					2
162 162
 			);
163 163
 		} else if ($type == 'PSY') {
164
-			return array (
164
+			return array(
165 165
 					40,
166 166
 					100,
167 167
 					160,
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 					2
170 170
 			);
171 171
 		} else if ($type == 'POR') {
172
-			return array (
172
+			return array(
173 173
 					137,
174 174
 					274,
175 175
 					328,
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
 					2
181 181
 			);
182 182
 		} else if ($type == 'DIA') {
183
-			return array (
183
+			return array(
184 184
 					52,
185 185
 					112,
186 186
 					0,
187 187
 					2
188 188
 			);
189 189
 		} else if ($type == 'POL') {
190
-			return array (
190
+			return array(
191 191
 					72,
192 192
 					100,
193 193
 					98,
Please login to merge, or discard this patch.