|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Patient |
|
5
|
|
|
* |
|
6
|
|
|
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
|
7
|
|
|
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
|
8
|
|
|
* |
|
9
|
|
|
* Permission is hereby granted to use or copy this program |
|
10
|
|
|
* for any purpose, provided the above notices are retained on all copies. |
|
11
|
|
|
* Permission to modify the code and to distribute modified code is granted, |
|
12
|
|
|
* provided the above notices are retained, and a notice that the code was |
|
13
|
|
|
* modified is included with the above copyright notice. |
|
14
|
|
|
* |
|
15
|
|
|
* @category Wp |
|
16
|
|
|
* @package Punction |
|
17
|
|
|
* @author Andrzej Marcinkowski <[email protected]> |
|
18
|
|
|
* @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz |
|
19
|
|
|
* @license MIT http://opensource.org/licenses/MIT |
|
20
|
|
|
* @version 1.0 $Id: 5e3d6d9fad27385cb557282c244e0767bf6c41e0 $ $Format:%H$ |
|
21
|
|
|
* @link http:// |
|
22
|
|
|
* @since File available since Release 1.0.0 |
|
23
|
|
|
* PHP Version 5 |
|
24
|
|
|
*/ |
|
25
|
|
|
namespace Hospitalplugin\Entities; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Infections |
|
29
|
|
|
* |
|
30
|
|
|
* @category Wp |
|
31
|
|
|
* @package Epidemio |
|
32
|
|
|
* @author Andrzej Marcinkowski <[email protected]> |
|
33
|
|
|
* @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz |
|
34
|
|
|
* @license MIT http://opensource.org/licenses/MIT |
|
35
|
|
|
* @version 1.0 $Id: 5e3d6d9fad27385cb557282c244e0767bf6c41e0 $ $Format:%H$ |
|
36
|
|
|
* @link http:// |
|
37
|
|
|
* @since File available since Release 1.0.0 |
|
38
|
|
|
* |
|
39
|
|
|
*/ |
|
40
|
|
|
class InfectionRaport { |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* id |
|
44
|
|
|
* @Id @Column(type="integer") @GeneratedValue |
|
45
|
|
|
*/ |
|
46
|
|
|
public $id; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* $dataRaportu datetime |
|
50
|
|
|
* @Column(type="datetime") * |
|
51
|
|
|
*/ |
|
52
|
|
|
public $dataRaportu; |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* $dataPrzeslania datetime |
|
56
|
|
|
* @Column(type="datetime") * |
|
57
|
|
|
*/ |
|
58
|
|
|
public $dataPrzeslania; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @ManyToOne(targetEntity="Hospitalplugin\Entities\Ward") |
|
62
|
|
|
* @JoinColumn(name="oddzialId", referencedColumnName="id") |
|
63
|
|
|
*/ |
|
64
|
|
|
public $ward; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @ManyToOne(targetEntity="Hospitalplugin\Entities\User") |
|
68
|
|
|
* @JoinColumn(name="userId", referencedColumnName="id") |
|
69
|
|
|
*/ |
|
70
|
|
|
protected $user; |
|
71
|
|
|
|
|
72
|
|
|
function __construct($args) { |
|
|
|
|
|
|
73
|
|
View Code Duplication |
foreach ( $args as $key => $value ) { |
|
|
|
|
|
|
74
|
|
|
if ($key == 'dataRaportu') { |
|
75
|
|
|
$value = new \DateTime ( $value ); |
|
76
|
|
|
} |
|
77
|
|
|
call_user_func ( array ( |
|
78
|
|
|
$this, |
|
79
|
|
|
'set' . $key |
|
80
|
|
|
), $value ); |
|
81
|
|
|
} |
|
82
|
|
|
$this->dataPrzeslania = new \DateTime (); |
|
83
|
|
|
echo '<h3><div class="alert alert-primary">Dziękuję za przesłanie raportu!</div></h3>'; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* getId |
|
88
|
|
|
* |
|
89
|
|
|
* @return id |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getId() { |
|
92
|
|
|
return $this->id; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* sets id |
|
97
|
|
|
* |
|
98
|
|
|
* @param int $id |
|
99
|
|
|
* ID |
|
100
|
|
|
* |
|
101
|
|
|
* @return \Hospitalplugin\Entities\Patient |
|
102
|
|
|
*/ |
|
103
|
|
|
public function setId($id) { |
|
104
|
|
|
$this->id = $id; |
|
105
|
|
|
return $this; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* toString |
|
110
|
|
|
* |
|
111
|
|
|
* @return string |
|
112
|
|
|
*/ |
|
113
|
|
|
public function toString() { |
|
114
|
|
|
$txt = $this->getId (); |
|
115
|
|
|
$data = $this->getDataRaportu (); |
|
116
|
|
|
if ($data instanceof \DateTime) { |
|
117
|
|
|
$txt .= $this->getDataRaportu ()->format ( "Y-m-d" ); |
|
118
|
|
|
} else { |
|
119
|
|
|
$txt .= $this->getDataRaportu (); |
|
120
|
|
|
} |
|
121
|
|
|
return $txt; |
|
122
|
|
|
} |
|
123
|
|
|
public function getDataRaportu() { |
|
124
|
|
|
return $this->dataRaportu; |
|
125
|
|
|
} |
|
126
|
|
|
public function setDataRaportu($dataRaportu) { |
|
127
|
|
|
$this->dataRaportu = $dataRaportu; |
|
128
|
|
|
return $this; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
public function getDataPrzeslania() { |
|
132
|
|
|
return $this->dataPrzeslania; |
|
133
|
|
|
} |
|
134
|
|
|
public function setDataPrzeslania($dataPrzeslania) { |
|
135
|
|
|
$this->dataPrzeslania = $dataPrzeslania; |
|
136
|
|
|
return $this; |
|
137
|
|
|
} |
|
138
|
|
|
public function getWard() { |
|
139
|
|
|
return $this->ward; |
|
140
|
|
|
} |
|
141
|
|
|
public function setWard($ward) { |
|
142
|
|
|
$this->ward = $ward; |
|
143
|
|
|
return $this; |
|
144
|
|
|
} |
|
145
|
|
|
public function getUser() { |
|
146
|
|
|
return $this->user; |
|
147
|
|
|
} |
|
148
|
|
|
public function setUser($user) { |
|
149
|
|
|
$this->user = $user; |
|
150
|
|
|
return $this; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
|
|
154
|
|
|
} |
|
155
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.