|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
Copyright (C) 2018-2020 KANOUN Salim |
|
4
|
|
|
This program is free software; you can redistribute it and/or modify |
|
5
|
|
|
it under the terms of the Affero GNU General Public v.3 License as published by |
|
6
|
|
|
the Free Software Foundation; |
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
|
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
10
|
|
|
Affero GNU General Public Public for more details. |
|
11
|
|
|
You should have received a copy of the Affero GNU General Public Public along |
|
12
|
|
|
with this program; if not, write to the Free Software Foundation, Inc., |
|
13
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
14
|
|
|
*/ |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Acess series data in database |
|
18
|
|
|
*/ |
|
19
|
|
|
Class Series_Details { |
|
20
|
|
|
|
|
21
|
|
|
private $linkpdo; |
|
22
|
|
|
public $seriesOrthancID; |
|
23
|
|
|
public $studyOrthancId; |
|
24
|
|
|
public $seriesNumber; |
|
25
|
|
|
public $manufacturer; |
|
26
|
|
|
public $modelName; |
|
27
|
|
|
public $seriesDescription; |
|
28
|
|
|
public $modality; |
|
29
|
|
|
public $acquisitionDateTime; |
|
30
|
|
|
public $injectedDose; |
|
31
|
|
|
public $radiopharmaceutical; |
|
32
|
|
|
public $injectedDateTime; |
|
33
|
|
|
public $injectedTime; |
|
34
|
|
|
public $injectedActivity; |
|
35
|
|
|
public $halfLife; |
|
36
|
|
|
public $patientWeight; |
|
37
|
|
|
public $numberInstances; |
|
38
|
|
|
public $serieUID; |
|
39
|
|
|
public $deleted; |
|
40
|
|
|
public $serieDiskSize; |
|
41
|
|
|
public $serieUncompressedDiskSize; |
|
42
|
|
|
|
|
43
|
|
|
public $parentIdVisit; |
|
44
|
|
|
|
|
45
|
|
|
public $studyDetailsObject; |
|
46
|
|
|
|
|
47
|
|
|
public function __construct(String $seriesOrthancID, PDO $linkpdo) { |
|
48
|
|
|
$this->linkpdo=$linkpdo; |
|
49
|
|
|
$this->seriesOrthancID=$seriesOrthancID; |
|
50
|
|
|
|
|
51
|
|
|
$seriesQuery=$this->linkpdo->prepare('SELECT * FROM orthanc_series |
|
52
|
|
|
WHERE series_orthanc_id=:seriesOrthancID' ); |
|
53
|
|
|
|
|
54
|
|
|
$seriesQuery->execute(array( |
|
55
|
|
|
"seriesOrthancID" => $this->seriesOrthancID |
|
56
|
|
|
)); |
|
57
|
|
|
|
|
58
|
|
|
$serieData=$seriesQuery->fetch(PDO::FETCH_ASSOC); |
|
59
|
|
|
|
|
60
|
|
|
$this->studyOrthancId=$serieData['study_orthanc_id']; |
|
61
|
|
|
$this->seriesNumber=$serieData['serie_number']; |
|
62
|
|
|
$this->manufacturer=$serieData['manufacturer']; |
|
63
|
|
|
$this->modelName=$serieData['model_name']; |
|
64
|
|
|
$this->seriesDescription=$serieData['series_description']; |
|
65
|
|
|
$this->modality=$serieData['modality']; |
|
66
|
|
|
$this->acquisitionDateTime=$serieData['acquisition_datetime']; |
|
67
|
|
|
$this->injectedDose=$serieData['injected_dose']; |
|
68
|
|
|
$this->radiopharmaceutical=$serieData['radiopharmaceutical']; |
|
69
|
|
|
$this->injectedDateTime=$serieData['injected_datetime']; |
|
70
|
|
|
$this->injectedTime=$serieData['injected_time']; |
|
71
|
|
|
$this->injectedActivity=$serieData['injected_activity']; |
|
72
|
|
|
$this->halfLife=$serieData['half_life']; |
|
73
|
|
|
$this->patientWeight=$serieData['patient_weight']; |
|
74
|
|
|
$this->numberInstances=$serieData['number_of_instances']; |
|
75
|
|
|
$this->serieUID=$serieData['serie_uid']; |
|
76
|
|
|
$this->deleted=$serieData['deleted']; |
|
77
|
|
|
$this->serieDiskSize=$serieData['serie_disk_size']; |
|
78
|
|
|
$this->serieUncompressedDiskSize=$serieData['serie_uncompressed_disk_size']; |
|
79
|
|
|
|
|
80
|
|
|
//Store study related data |
|
81
|
|
|
$this->studyDetailsObject=new Study_Details($this->studyOrthancId, $linkpdo); |
|
82
|
|
|
|
|
83
|
|
|
//Store ID_Visit related to this dicom series |
|
84
|
|
|
$this->parentIdVisit=$this->studyDetailsObject->idVisit; |
|
85
|
|
|
|
|
86
|
|
|
|
|
87
|
|
|
|
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* Modify deleted status of the serie |
|
92
|
|
|
* @param bool $deleted |
|
93
|
|
|
*/ |
|
94
|
|
|
public function changeDeletionStatus(bool $deleted) { |
|
95
|
|
|
$connecter=$this->linkpdo->prepare('UPDATE orthanc_series SET deleted=:deleted WHERE series_orthanc_id = :seriesOrthancID'); |
|
96
|
|
|
$connecter->execute(array( |
|
97
|
|
|
"seriesOrthancID" => $this->seriesOrthancID, |
|
98
|
|
|
"deleted"=>intval($deleted) |
|
99
|
|
|
)); |
|
100
|
|
|
|
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* Instanciate Series object by Series Instance UID |
|
106
|
|
|
* @param string $uid |
|
107
|
|
|
* @param PDO $linkpdo |
|
108
|
|
|
* @return Series_Details |
|
109
|
|
|
*/ |
|
110
|
|
|
public static function getSerieObjectByUID(string $uid, PDO $linkpdo) { |
|
111
|
|
|
|
|
112
|
|
|
$seriesQuery=$linkpdo->prepare('SELECT series_orthanc_id FROM orthanc_series |
|
113
|
|
|
WHERE serie_uid=:seriesUID' ); |
|
114
|
|
|
|
|
115
|
|
|
$seriesQuery->execute(array( |
|
116
|
|
|
"seriesUID" => $uid |
|
117
|
|
|
)); |
|
118
|
|
|
|
|
119
|
|
|
$serieOrthancID=$seriesQuery->fetch(PDO::FETCH_COLUMN); |
|
120
|
|
|
|
|
121
|
|
|
return new Series_Details($serieOrthancID, $linkpdo); |
|
122
|
|
|
|
|
123
|
|
|
} |
|
124
|
|
|
} |