src/Entity/OrthancTransaction.php line 17

Open in your IDE?
  1. <?php
  2. namespace MedBrief\MSR\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6. * OrthancTransaction
  7. *
  8. * @ORM\Table(name="OrthancTransaction")
  9. *
  10. * @ORM\Entity
  11. *
  12. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  13. */
  14. class OrthancTransaction
  15. {
  16. public const TRANSACTION_STATUS_PENDING = 1;
  17. public const TRANSACTION_STATUS_SUCCESS = 2;
  18. public const TRANSACTION_STATUS_FAILED = 3;
  19. public const TYPE_STORE_INSTANCE = 1;
  20. public const TYPE_DELETE_INSTANCE = 2;
  21. public const TYPE_INSTANCE_DETAILS = 3;
  22. public const TYPE_SERIES_DETAILS = 4;
  23. public const TYPE_STUDY_DETAILS = 5;
  24. public const TYPE_PATIENT_DETAILS = 6;
  25. public const TYPE_SYSTEM = 7;
  26. /**
  27. * @var int
  28. *
  29. * @ORM\Column(name="id", type="integer")
  30. *
  31. * @ORM\Id
  32. *
  33. * @ORM\GeneratedValue(strategy="IDENTITY")
  34. */
  35. private $id;
  36. /**
  37. * @var \DateTime|null
  38. *
  39. * @ORM\Column(name="deletedAt", type="datetime", nullable=true)
  40. */
  41. private $deletedAt;
  42. /**
  43. * @var int
  44. *
  45. * @ORM\Column(name="type", type="integer", nullable=false)
  46. */
  47. private $type;
  48. /**
  49. * @var int
  50. *
  51. * @ORM\Column(name="transaction_status", type="integer", nullable=false)
  52. */
  53. private $transaction_status;
  54. /**
  55. * @var string
  56. *
  57. * @ORM\Column(name="transaction_response", type="text", nullable=false)
  58. */
  59. private $transaction_response;
  60. /**
  61. * @var \DateTime
  62. *
  63. * @ORM\Column(name="created", type="datetime")
  64. *
  65. * @Gedmo\Timestampable(on="create")
  66. */
  67. private $created;
  68. /**
  69. * @var \DateTime
  70. *
  71. * @ORM\Column(name="updated", type="datetime")
  72. *
  73. * @Gedmo\Timestampable(on="update")
  74. */
  75. private $updated;
  76. /**
  77. * @var Document
  78. *
  79. * @ORM\ManyToOne(targetEntity="MedBrief\MSR\Entity\Document", inversedBy="orthancTransactions", cascade={"persist","remove"})
  80. *
  81. * @ORM\JoinColumns({
  82. *
  83. * @ORM\JoinColumn(name="document_id", referencedColumnName="id")
  84. * })
  85. */
  86. private $document;
  87. /**
  88. * @var Patient
  89. *
  90. * @ORM\ManyToOne(targetEntity="MedBrief\MSR\Entity\Patient", inversedBy="orthancTransactions", cascade={"persist","remove"})
  91. *
  92. * @ORM\JoinColumns({
  93. *
  94. * @ORM\JoinColumn(name="patient_id", referencedColumnName="id")
  95. * })
  96. */
  97. private $patient;
  98. /**
  99. * @var Series
  100. *
  101. * @ORM\ManyToOne(targetEntity="MedBrief\MSR\Entity\Series", inversedBy="orthancTransactions", cascade={"persist","remove"})
  102. *
  103. * @ORM\JoinColumns({
  104. *
  105. * @ORM\JoinColumn(name="series_id", referencedColumnName="id")
  106. * })
  107. */
  108. private $series;
  109. /**
  110. * @var Study
  111. *
  112. * @ORM\ManyToOne(targetEntity="MedBrief\MSR\Entity\Study", inversedBy="orthancTransactions", cascade={"persist","remove"})
  113. *
  114. * @ORM\JoinColumns({
  115. *
  116. * @ORM\JoinColumn(name="study_id", referencedColumnName="id")
  117. * })
  118. */
  119. private $study;
  120. public function __construct()
  121. {
  122. // default status is pending
  123. $this->transaction_status = self::TRANSACTION_STATUS_PENDING;
  124. }
  125. public function __toString()
  126. {
  127. return (string) $this->getId();
  128. }
  129. /**
  130. * Get id
  131. *
  132. * @return int
  133. */
  134. public function getId()
  135. {
  136. return $this->id;
  137. }
  138. /**
  139. * Set type
  140. *
  141. * @param int $type
  142. *
  143. * @return OrthancTransaction
  144. */
  145. public function setType($type)
  146. {
  147. $this->type = $type;
  148. return $this;
  149. }
  150. /**
  151. * Get type
  152. *
  153. * @return int
  154. */
  155. public function getType()
  156. {
  157. return $this->type;
  158. }
  159. /**
  160. * Set transactionStatus
  161. *
  162. * @param int $transactionStatus
  163. *
  164. * @return OrthancTransaction
  165. */
  166. public function setTransactionStatus($transactionStatus)
  167. {
  168. $this->transaction_status = $transactionStatus;
  169. return $this;
  170. }
  171. /**
  172. * Get transactionStatus
  173. *
  174. * @return int
  175. */
  176. public function getTransactionStatus()
  177. {
  178. return $this->transaction_status;
  179. }
  180. /**
  181. * Set transactionResponse
  182. *
  183. * @param string $transactionResponse
  184. *
  185. * @return OrthancTransaction
  186. */
  187. public function setTransactionResponse($transactionResponse)
  188. {
  189. $this->transaction_response = $transactionResponse;
  190. return $this;
  191. }
  192. /**
  193. * Get transactionResponse
  194. *
  195. * @return string
  196. */
  197. public function getTransactionResponse()
  198. {
  199. return $this->transaction_response;
  200. }
  201. /**
  202. * Set created
  203. *
  204. * @param \DateTime $created
  205. *
  206. * @return OrthancTransaction
  207. */
  208. public function setCreated($created)
  209. {
  210. $this->created = $created;
  211. return $this;
  212. }
  213. /**
  214. * Get created
  215. *
  216. * @return \DateTime
  217. */
  218. public function getCreated()
  219. {
  220. return $this->created;
  221. }
  222. /**
  223. * Set updated
  224. *
  225. * @param \DateTime $updated
  226. *
  227. * @return OrthancTransaction
  228. */
  229. public function setUpdated($updated)
  230. {
  231. $this->updated = $updated;
  232. return $this;
  233. }
  234. /**
  235. * Get updated
  236. *
  237. * @return \DateTime
  238. */
  239. public function getUpdated()
  240. {
  241. return $this->updated;
  242. }
  243. /**
  244. * Set document
  245. *
  246. * @param Document $document
  247. *
  248. * @return OrthancTransaction
  249. */
  250. public function setDocument(Document $document)
  251. {
  252. $this->document = $document;
  253. return $this;
  254. }
  255. /**
  256. * Get document
  257. *
  258. * @return Document
  259. */
  260. public function getDocument()
  261. {
  262. return $this->document;
  263. }
  264. /**
  265. * Set deletedAt
  266. *
  267. * @param \DateTime $deletedAt
  268. *
  269. * @return OrthancTransaction
  270. */
  271. public function setDeletedAt($deletedAt)
  272. {
  273. $this->deletedAt = $deletedAt;
  274. return $this;
  275. }
  276. /**
  277. * Get deletedAt
  278. *
  279. * @return \DateTime
  280. */
  281. public function getDeletedAt()
  282. {
  283. return $this->deletedAt;
  284. }
  285. /**
  286. * Set patient
  287. *
  288. * @param Patient $patient
  289. *
  290. * @return OrthancTransaction
  291. */
  292. public function setPatient(?Patient $patient = null)
  293. {
  294. $this->patient = $patient;
  295. return $this;
  296. }
  297. /**
  298. * Get patient
  299. *
  300. * @return Patient
  301. */
  302. public function getPatient()
  303. {
  304. return $this->patient;
  305. }
  306. /**
  307. * Set series
  308. *
  309. * @param Series $series
  310. *
  311. * @return OrthancTransaction
  312. */
  313. public function setSeries(?Series $series = null)
  314. {
  315. $this->series = $series;
  316. return $this;
  317. }
  318. /**
  319. * Get series
  320. *
  321. * @return Series
  322. */
  323. public function getSeries()
  324. {
  325. return $this->series;
  326. }
  327. /**
  328. * Set study
  329. *
  330. * @param Study $study
  331. *
  332. * @return OrthancTransaction
  333. */
  334. public function setStudy(?Study $study = null)
  335. {
  336. $this->study = $study;
  337. return $this;
  338. }
  339. /**
  340. * Get study
  341. *
  342. * @return Study
  343. */
  344. public function getStudy()
  345. {
  346. return $this->study;
  347. }
  348. }