Passed
Push — dev ( d62152...d10d14 )
by Salim
03:23
created
src/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,6 @@
 block discarded – undo
20 20
  * @author      Salim Kanoun <[email protected]>
21 21
  */
22 22
 
23
-header( 'content-type: text/html; charset=utf-8' );
23
+header('content-type: text/html; charset=utf-8');
24 24
 require_once('vendor/autoload.php');
25 25
 require 'router.php';
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/models/Documentation.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
     public $deleted;
34 34
     
35 35
     
36
-    public function __construct(PDO $linkpdo, int $idDocumentation){
36
+    public function __construct(PDO $linkpdo, int $idDocumentation) {
37 37
     	
38
-    	$documentationQuery = $linkpdo->prepare("SELECT * FROM documentation WHERE id_documentation = :idDocumentation");
38
+    	$documentationQuery=$linkpdo->prepare("SELECT * FROM documentation WHERE id_documentation = :idDocumentation");
39 39
     	$documentationQuery->execute(array('idDocumentation' => $idDocumentation));
40 40
     	$documentation=$documentationQuery->fetch(PDO::FETCH_ASSOC);
41 41
     	
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $this->accessReviewer=$documentation['reviewer'];
51 51
         $this->deleted=$documentation['deleted'];
52 52
         
53
-        $this->documentFileLocation = ($_SERVER['DOCUMENT_ROOT']."/data/upload/documentation/".$this->study."/".$this->documentName);
53
+        $this->documentFileLocation=($_SERVER['DOCUMENT_ROOT']."/data/upload/documentation/".$this->study."/".$this->documentName);
54 54
     }
55 55
     
56 56
     /**
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
      * @return boolean
60 60
      */
61 61
     
62
-    public function isDocumentationAllowedForRole(String $role){
63
-        if($role==User::INVESTIGATOR) return $this->accessInvestigator;
64
-        else if($role==User::CONTROLLER) return $this->accessController;
65
-        else if($role==User::MONITOR) return $this->accessMonitor;
66
-        else if($role==User::REVIEWER) return $this->accessReviewer;
67
-        else if($role==User::SUPERVISOR) return true;
62
+    public function isDocumentationAllowedForRole(String $role) {
63
+        if ($role == User::INVESTIGATOR) return $this->accessInvestigator;
64
+        else if ($role == User::CONTROLLER) return $this->accessController;
65
+        else if ($role == User::MONITOR) return $this->accessMonitor;
66
+        else if ($role == User::REVIEWER) return $this->accessReviewer;
67
+        else if ($role == User::SUPERVISOR) return true;
68 68
         else return false;
69 69
     }
70 70
     
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
      * @param bool $reviewer
79 79
      * @param bool $deleted
80 80
      */
81
-    public static function updateDocumentation(PDO $linkpdo, int $idDocumentation, bool $investigator, bool $monitor, bool $controller, bool $reviewer, bool $deleted){
82
-        $update = $linkpdo->prepare('UPDATE documentation
81
+    public static function updateDocumentation(PDO $linkpdo, int $idDocumentation, bool $investigator, bool $monitor, bool $controller, bool $reviewer, bool $deleted) {
82
+        $update=$linkpdo->prepare('UPDATE documentation
83 83
                                     SET investigator = :investigator,
84 84
                                         controller = :controller,
85 85
                                         monitor = :monitor,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             'monitor' => intval($monitor),
93 93
             'reviewer' =>intval($reviewer),
94 94
             'deleted'=>intval($deleted),
95
-            'id' => $idDocumentation ));
95
+            'id' => $idDocumentation));
96 96
     }
97 97
     
98 98
     /**
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
      * @param String $study
103 103
      * @param String $version
104 104
      */
105
-    public static function insertDocumentation(PDO $linkpdo, String $uploadedFilename, String $study, String $version){
106
-        $insertion = $linkpdo->prepare('INSERT INTO documentation (name, document_date, study, version)
105
+    public static function insertDocumentation(PDO $linkpdo, String $uploadedFilename, String $study, String $version) {
106
+        $insertion=$linkpdo->prepare('INSERT INTO documentation (name, document_date, study, version)
107 107
 																			VALUES (:name, :doc_date, :study, :version)');
108 108
         $insertion->execute(array(
109 109
             'name' => $uploadedFilename,
Please login to merge, or discard this patch.
src/models/TagAnon.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public $choice;
27 27
     public $newValue;
28 28
     
29
-    public function __construct($tag, $choice, $newValue=null){
29
+    public function __construct($tag, $choice, $newValue=null) {
30 30
         $this->tag=$tag;
31 31
         $this->choice=$choice;
32 32
         $this->newValue=$newValue;
Please login to merge, or discard this patch.
src/models/Center.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * Center management in the plateform
18 18
  */
19 19
 
20
-Class Center{
20
+Class Center {
21 21
 	public $name;
22 22
 	public $code;
23 23
 	public $countryCode;
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 	 * @param $code
31 31
 	 * @throws Exception
32 32
 	 */
33
-	public function __construct(PDO $linkpdo, $code){
33
+	public function __construct(PDO $linkpdo, $code) {
34 34
 	    
35
-	    $centerQuery = $linkpdo->prepare('SELECT * FROM centers WHERE code=:code');
35
+	    $centerQuery=$linkpdo->prepare('SELECT * FROM centers WHERE code=:code');
36 36
 	    $centerQuery->execute(array('code'=>$code));
37 37
 	    $center=$centerQuery->fetch(PDO::FETCH_ASSOC);
38 38
 	    
39
-	    if(empty($center)){
39
+	    if (empty($center)) {
40 40
 	        throw new Exception("Non Existing Center");
41 41
 	    }
42 42
 	    $this->linkpdo=$linkpdo;
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	 * @param string $name
52 52
 	 * @param string $countryCode
53 53
 	 */
54
-	public function updateCenter(string $name, string $countryCode){
55
-	    $updatePatient = $this->linkpdo->prepare("UPDATE centers
54
+	public function updateCenter(string $name, string $countryCode) {
55
+	    $updatePatient=$this->linkpdo->prepare("UPDATE centers
56 56
                                             SET name = :centerName,
57 57
                                             country_code = :countryCode
58 58
                                             WHERE code = :code");
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @param $center
70 70
 	 * @return User[]
71 71
 	 */
72
-	public static function getUsersAffiliatedToCenter(PDO $linkpdo, $center){
72
+	public static function getUsersAffiliatedToCenter(PDO $linkpdo, $center) {
73 73
 		
74 74
 		//Select All users that has a matching center
75 75
 		$queryUsersEmail=$linkpdo->prepare('
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		$users=$queryUsersEmail->fetchAll(PDO::FETCH_COLUMN);
88 88
 		
89 89
 		$usersObjects=[];
90
-		foreach ($users as $user){
90
+		foreach ($users as $user) {
91 91
 			$usersObjects[]=new User($user, $linkpdo);
92 92
 			
93 93
 		}
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 	 * @param $name
103 103
 	 * @param string $countryCode
104 104
 	 */
105
-	public static function addCenter(PDO $linkpdo, $code, String $name, String $countryCode){
106
-		$insertion = $linkpdo->prepare('INSERT INTO centers (code, name, country_code) VALUES (:code, :name, :countryCode)' );
105
+	public static function addCenter(PDO $linkpdo, $code, String $name, String $countryCode) {
106
+		$insertion=$linkpdo->prepare('INSERT INTO centers (code, name, country_code) VALUES (:code, :name, :countryCode)');
107 107
 		$insertion->execute(array(
108 108
 				'name' => $name,
109 109
 				'code' => $code,
Please login to merge, or discard this patch.
src/models/Patient.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * Access Patient data
18 18
  */
19 19
 
20
-class Patient{
20
+class Patient {
21 21
     
22 22
     public $patient;
23 23
     private $linkpdo;
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
     
41 41
     function __construct($patientCode, PDO $linkpdo) {
42 42
         $this->patient=$patientCode;
43
-        $this->linkpdo= $linkpdo;
43
+        $this->linkpdo=$linkpdo;
44 44
         
45
-        $queryPatientsData = $this->linkpdo->prepare('SELECT * FROM patients WHERE code = :patient');
45
+        $queryPatientsData=$this->linkpdo->prepare('SELECT * FROM patients WHERE code = :patient');
46 46
         $queryPatientsData->execute(array('patient' => $this->patient));
47
-        $dataPatient = $queryPatientsData->fetch(PDO::FETCH_ASSOC);
47
+        $dataPatient=$queryPatientsData->fetch(PDO::FETCH_ASSOC);
48 48
         
49
-        if(empty($dataPatient)){
49
+        if (empty($dataPatient)) {
50 50
             throw new Exception("Non Existing Patient");
51 51
         }
52 52
         
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
      * @param string $withdrawDate
87 87
      * @param string $withdrawReason
88 88
      */
89
-    public function changeWithdrawStatus(bool $withdraw, ?string $withdrawDate, ?string $withdrawReason){
89
+    public function changeWithdrawStatus(bool $withdraw, ?string $withdrawDate, ?string $withdrawReason) {
90 90
         
91
-        $insertion = $this->linkpdo->prepare('UPDATE patients
91
+        $insertion=$this->linkpdo->prepare('UPDATE patients
92 92
                                             SET withdraw = :withdraw,
93 93
                                             withdraw_date = :withdraw_date,
94 94
                                             withdraw_reason = :withdraw_reason
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
      * @param $investigator
111 111
      * @param $centerCode
112 112
      */
113
-    public function editPatientDetails($initials, $gender, $birthDate, $registrationDate, $investigator, $centerCode){
114
-            $insertion = $this->linkpdo->prepare("UPDATE patients
113
+    public function editPatientDetails($initials, $gender, $birthDate, $registrationDate, $investigator, $centerCode) {
114
+            $insertion=$this->linkpdo->prepare("UPDATE patients
115 115
                                             SET first_name = :firstName,
116 116
                                             last_name = :lastName,
117 117
                                             gender = :gender,
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
         //Look if specific patient visit manager exists for this study
145 145
         $specificObjectFile=$_SERVER["DOCUMENT_ROOT"].'/data/form/'.$this->patientStudy.'/Poo/'.$this->patientStudy."_Patient_Visit_Manager.php";
146 146
             
147
-        if(is_file($specificObjectFile)){
147
+        if (is_file($specificObjectFile)) {
148 148
             require_once($specificObjectFile);
149 149
             $objectName=$this->patientStudy."_Patient_Visit_Manager";
150 150
             return new $objectName($this, $visitGroupObject, $this->linkpdo);
151
-        }else{
151
+        }else {
152 152
             return new Patient_Visit_Manager($this, $visitGroupObject, $this->linkpdo);
153 153
         }
154 154
 
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
     /**
167 167
      * Return visits created for this patient without group filter
168 168
      */
169
-    public function getAllCreatedPatientsVisits(bool $deletedVisits = false) : Array
169
+    public function getAllCreatedPatientsVisits(bool $deletedVisits=false) : Array
170 170
     {
171 171
         $possibleStudyGroups=$this->getAllPossibleVisitGroup();
172 172
 
173
-        $visitsObjectArray = [];
173
+        $visitsObjectArray=[];
174 174
 
175
-        foreach($possibleStudyGroups as $studyGroup){
175
+        foreach ($possibleStudyGroups as $studyGroup) {
176 176
             $createdVisits=$this->getPatientVisitManager($studyGroup)->getCreatedPatientsVisits($deletedVisits);
177 177
             array_push($visitsObjectArray, ...$createdVisits);
178 178
         }
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
      /**
185 185
      * Return visits uploaded for this patient without group filter
186 186
      */
187
-    public function getAllQcDonePatientsVisits(bool $deletedVisits = false) : Array
187
+    public function getAllQcDonePatientsVisits(bool $deletedVisits=false) : Array
188 188
     {
189 189
         $possibleStudyGroups=$this->getAllPossibleVisitGroup();
190 190
 
191
-        $visitsObjectArray = [];
191
+        $visitsObjectArray=[];
192 192
 
193
-        foreach($possibleStudyGroups as $studyGroup){
193
+        foreach ($possibleStudyGroups as $studyGroup) {
194 194
             $createdVisits=$this->getPatientVisitManager($studyGroup)->getQcDonePatientsVisits($deletedVisits);
195 195
             array_push($visitsObjectArray, ...$createdVisits);
196 196
         }
@@ -202,42 +202,42 @@  discard block
 block discarded – undo
202 202
 
203 203
         $possiblevisitsGroups=$this->getAllPossibleVisitGroup();
204 204
 
205
-        $visitsObjectArray = [];
205
+        $visitsObjectArray=[];
206 206
 
207
-        foreach($possiblevisitsGroups as $visitGroup){
208
-            try{
207
+        foreach ($possiblevisitsGroups as $visitGroup) {
208
+            try {
209 209
                 $availableVisits=$this->getPatientVisitManager($visitGroup)->getAvailableVisitsToCreate();
210
-            }catch (Exception $e){
210
+            }catch (Exception $e) {
211 211
                 $availableVisits=array($e->getMessage());
212 212
             }
213 213
 
214
-            $visitsObjectArray [$visitGroup->groupModality]['visitsName'] = $availableVisits;
215
-            $visitsObjectArray [$visitGroup->groupModality]['groupId'] = $visitGroup->groupId;
214
+            $visitsObjectArray [$visitGroup->groupModality]['visitsName']=$availableVisits;
215
+            $visitsObjectArray [$visitGroup->groupModality]['groupId']=$visitGroup->groupId;
216 216
         }
217 217
 
218 218
         return $visitsObjectArray;
219 219
 
220 220
     }
221 221
 
222
-    public function isMissingVisit(){
222
+    public function isMissingVisit() {
223 223
 
224 224
         $modalitiesMissingVisits=$this->getMissingVisitModalities();
225 225
 
226
-        $isMissingSomeVisits= ( sizeof($modalitiesMissingVisits) > 0 ) ;
226
+        $isMissingSomeVisits=(sizeof($modalitiesMissingVisits) > 0);
227 227
 
228
-        return $isMissingSomeVisits ; 
228
+        return $isMissingSomeVisits; 
229 229
 
230 230
     }
231 231
 
232
-    public function getMissingVisitModalities(){
232
+    public function getMissingVisitModalities() {
233 233
 
234 234
         $possiblevisitsGroups=$this->getAllPossibleVisitGroup();
235 235
 
236
-        $visitsMissingGroupsArray = [];
236
+        $visitsMissingGroupsArray=[];
237 237
 
238
-        foreach($possiblevisitsGroups as $visitGroup){
238
+        foreach ($possiblevisitsGroups as $visitGroup) {
239 239
             $missingVisit=$this->getPatientVisitManager($visitGroup)->isMissingVisit();
240
-            if($missingVisit){
240
+            if ($missingVisit) {
241 241
                 $visitsMissingGroupsArray[]=$visitGroup->groupModality;
242 242
             }
243 243
         }
Please login to merge, or discard this patch.
src/models/Orthanc_Patient.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * This class is not used anymore ...
20 20
  */
21 21
 
22
-class Orthanc_Patient{
22
+class Orthanc_Patient {
23 23
 	public $patientName;
24 24
 	public $patientID;
25 25
 	public $patientSex;
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	private $context;
32 32
 	
33 33
 	
34
-	public function __construct($patientOrthancID, $url, $context){
34
+	public function __construct($patientOrthancID, $url, $context) {
35 35
 	    //Set orthanc address
36 36
 	    $this->url=$url;
37
-	    $this->context = $context;
37
+	    $this->context=$context;
38 38
 	    //Set current patient Orthanc ID
39 39
 		$this->patientOrthancID=$patientOrthancID;
40 40
 	}
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	/** 
43 43
 	 * Get and store the main tags of the patient level
44 44
 	 */
45
-	public function retrievePatientData(){
46
-	    $context  = stream_context_create($this->context);
47
-	    $json = file_get_contents($this->url.'/patients/'.$this->patientOrthancID, false, $context);
45
+	public function retrievePatientData() {
46
+	    $context=stream_context_create($this->context);
47
+	    $json=file_get_contents($this->url.'/patients/'.$this->patientOrthancID, false, $context);
48 48
 		$patientJson=json_decode($json, true);
49 49
 		//Add needed informations in this object
50 50
 		$this->patientName=$patientJson['MainDicomTags']['PatientName'];
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 	/**
59 59
 	 * Retrieve data from study level
60 60
 	 */
61
-	public function getStudiesData(){
62
-		foreach ($this->studiesOrthancID as $studyID){
61
+	public function getStudiesData() {
62
+		foreach ($this->studiesOrthancID as $studyID) {
63 63
 			//Create a study object of each study
64 64
 			$study=new Orthanc_Study($studyID, $this->url, $this->context);
65 65
 			//fetch the data of the study level
Please login to merge, or discard this patch.
src/models/Study_Review_Manager.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
 
26 26
 	public function __construct(Study $studyObject)
27 27
 	{
28
-		$this->studyObject = $studyObject;
28
+		$this->studyObject=$studyObject;
29 29
 	}
30 30
 
31 31
 	private function getAvailableReviewersName(): Array
32 32
 	{
33 33
 		//List the Reviewers declared in the study
34
-		$reviewerUsersObjects = $this->studyObject->getUsersByRoleInStudy(User::REVIEWER);
35
-		$availableReviewers = [];
34
+		$reviewerUsersObjects=$this->studyObject->getUsersByRoleInStudy(User::REVIEWER);
35
+		$availableReviewers=[];
36 36
 		foreach ($reviewerUsersObjects as $reviewerObject) {
37
-			$availableReviewers[] = $reviewerObject->lastName . " " . $reviewerObject->firstName;
37
+			$availableReviewers[]=$reviewerObject->lastName." ".$reviewerObject->firstName;
38 38
 		}
39 39
 
40 40
 		return $availableReviewers;
@@ -48,45 +48,45 @@  discard block
 block discarded – undo
48 48
 	public function getReviewsDetailsByVisit() : Array
49 49
 	{
50 50
 
51
-		$availableReviewers = $this->getAvailableReviewersName();
51
+		$availableReviewers=$this->getAvailableReviewersName();
52 52
 		//Retrieve created Visit from the study Object
53
-		$createdVisitObjects = $this->studyObject->getAllCreatedVisits();
53
+		$createdVisitObjects=$this->studyObject->getAllCreatedVisits();
54 54
 
55 55
 		//GlobalMap
56
-		$reviewdetailsMap = [];
56
+		$reviewdetailsMap=[];
57 57
 
58 58
 		foreach ($createdVisitObjects as $createdVisit) {
59 59
 			if ($createdVisit->stateQualityControl == Visit::QC_ACCEPTED && $createdVisit->visitTypeObject->reviewNeeded) {
60 60
 				//If QC Accepted and review needed we analyze it
61
-				$newVisit['visitId'] = $createdVisit->id_visit;
62
-				$newVisit['visitModality'] = $createdVisit->visitGroupObject->groupModality;
63
-				$newVisit['patientNumber'] = $createdVisit->patientCode;
64
-				$newVisit['visit'] = $createdVisit->visitType;
65
-				$newVisit['acquisitionDate'] = $createdVisit->acquisitionDate;
66
-				$newVisit['reviewStatus'] = $createdVisit->reviewStatus;
61
+				$newVisit['visitId']=$createdVisit->id_visit;
62
+				$newVisit['visitModality']=$createdVisit->visitGroupObject->groupModality;
63
+				$newVisit['patientNumber']=$createdVisit->patientCode;
64
+				$newVisit['visit']=$createdVisit->visitType;
65
+				$newVisit['acquisitionDate']=$createdVisit->acquisitionDate;
66
+				$newVisit['reviewStatus']=$createdVisit->reviewStatus;
67 67
 				//Retrieve review
68 68
 				try {
69
-					$reviewObjects = $createdVisit->getReviewsObject(false);
70
-				} catch (Exception $e) {
71
-					$reviewObjects = [];
69
+					$reviewObjects=$createdVisit->getReviewsObject(false);
70
+				}catch (Exception $e) {
71
+					$reviewObjects=[];
72 72
 				}
73 73
 
74
-				$newVisit['numberOfReview'] = count($reviewObjects);
75
-				$newVisit['reviewDoneBy'] = [];
76
-				$newVisit['reviewDetailsArray'] = [];
74
+				$newVisit['numberOfReview']=count($reviewObjects);
75
+				$newVisit['reviewDoneBy']=[];
76
+				$newVisit['reviewDetailsArray']=[];
77 77
 				foreach ($reviewObjects as $review) {
78
-					$reviewerObject = $review->getUserObject();
79
-					$details['user'] = $reviewerObject->lastName . " " . $reviewerObject->firstName;
80
-					$details['date'] = $review->reviewDate;
81
-					$newVisit['reviewDetailsArray'][] = $details;
82
-					$newVisit['reviewDoneBy'][] = $reviewerObject->lastName . " " . $reviewerObject->firstName;
78
+					$reviewerObject=$review->getUserObject();
79
+					$details['user']=$reviewerObject->lastName." ".$reviewerObject->firstName;
80
+					$details['date']=$review->reviewDate;
81
+					$newVisit['reviewDetailsArray'][]=$details;
82
+					$newVisit['reviewDoneBy'][]=$reviewerObject->lastName." ".$reviewerObject->firstName;
83 83
 				}
84 84
 
85 85
 				//Determine missing reviewer for this visit
86
-				$newVisit['reviewNotDoneBy'] = array_diff($availableReviewers, $newVisit['reviewDoneBy']);
86
+				$newVisit['reviewNotDoneBy']=array_diff($availableReviewers, $newVisit['reviewDoneBy']);
87 87
 
88 88
 				//Add all data to the global map
89
-				$reviewdetailsMap[$createdVisit->id_visit] = $newVisit;
89
+				$reviewdetailsMap[$createdVisit->id_visit]=$newVisit;
90 90
 			}
91 91
 		}
92 92
 		return $reviewdetailsMap;
Please login to merge, or discard this patch.
src/models/Visit_Type.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 /**
17 17
  * Acces data of Visit Type table
18 18
  */
19
-Class Visit_Type{
19
+Class Visit_Type {
20 20
     
21 21
     public $id;
22 22
     public $groupId;
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 
34 34
     public $linkpdo;
35 35
     
36
-    public function __construct(PDO $linkpdo, int $visitTypeId){
36
+    public function __construct(PDO $linkpdo, int $visitTypeId) {
37 37
         
38 38
         $this->linkpdo=$linkpdo;
39
-        $visitTypeQuery = $this->linkpdo->prepare('SELECT * FROM visit_type WHERE id = :visitTypeId');
39
+        $visitTypeQuery=$this->linkpdo->prepare('SELECT * FROM visit_type WHERE id = :visitTypeId');
40 40
         $visitTypeQuery->execute(array('visitTypeId' => $visitTypeId));
41 41
         $visitType=$visitTypeQuery->fetch(PDO::FETCH_ASSOC);
42 42
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
         
56 56
     }
57 57
 
58
-    public static function getVisitTypeByName($groupId, String $visitName,PDO $linkpdo) : Visit_Type {
59
-        $visitTypeQuery = $linkpdo->prepare('SELECT id FROM visit_type WHERE group_id = :groupId AND name= :name');
58
+    public static function getVisitTypeByName($groupId, String $visitName, PDO $linkpdo) : Visit_Type {
59
+        $visitTypeQuery=$linkpdo->prepare('SELECT id FROM visit_type WHERE group_id = :groupId AND name= :name');
60 60
         $visitTypeQuery->execute(array('groupId' => $groupId, 'name'=>$visitName));
61 61
         $visitTypeId=$visitTypeQuery->fetch(PDO::FETCH_COLUMN);
62 62
         return new Visit_Type($linkpdo, $visitTypeId);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @return array
83 83
      */
84 84
     public function getSpecificTableInputType() : Array {
85
-        $query = $this->linkpdo->prepare('SELECT COLUMN_NAME, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME="'.$this->tableReviewSpecificName.'"');
85
+        $query=$this->linkpdo->prepare('SELECT COLUMN_NAME, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME="'.$this->tableReviewSpecificName.'"');
86 86
         $query->execute();
87 87
         $datas=$query->fetchAll(PDO::FETCH_ASSOC);
88 88
         
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
         return new Visit_Group($this->linkpdo, $this->groupId);
95 95
     }
96 96
     
97
-    public static function createVisitType(string $studyName, Visit_Group $visitGroup, String $visitName, int $order, int $limitLowDays, int $limitUpDays, bool $localFormNeed, bool $qcNeeded, bool $reviewNeeded, bool $optional, String $anonProfile, PDO $linkpdo){
97
+    public static function createVisitType(string $studyName, Visit_Group $visitGroup, String $visitName, int $order, int $limitLowDays, int $limitUpDays, bool $localFormNeed, bool $qcNeeded, bool $reviewNeeded, bool $optional, String $anonProfile, PDO $linkpdo) {
98 98
         
99
-        $req = $linkpdo->prepare('INSERT INTO visit_type (group_id, name, table_review_specific, visit_order, local_form_needed, qc_needed, review_needed, optional, limit_low_days, limit_up_days, anon_profile)
99
+        $req=$linkpdo->prepare('INSERT INTO visit_type (group_id, name, table_review_specific, visit_order, local_form_needed, qc_needed, review_needed, optional, limit_low_days, limit_up_days, anon_profile)
100 100
                                       VALUES(:groupId, :visitName, :tableSpecific, :order, :localFormNeeded, :qcNeeded, :reviewNeeded, :optional, :limitLowDays, :limitUpDays, :anonProfile)');
101 101
         
102 102
         $tableSpecificName=$visitGroup->groupModality."_".$studyName."_".$visitName;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         ));
116 116
         
117 117
         //Create specific table of the visit for form with relation with the review table
118
-        $req = $linkpdo->prepare(' CREATE TABLE '.$tableSpecificName.' (id_review integer(11) NOT NULL, PRIMARY KEY (id_review));
118
+        $req=$linkpdo->prepare(' CREATE TABLE '.$tableSpecificName.' (id_review integer(11) NOT NULL, PRIMARY KEY (id_review));
119 119
             ALTER TABLE '.$tableSpecificName.' ADD FOREIGN KEY fk_idReview (id_review) REFERENCES reviews(id_review);
120 120
             ALTER TABLE '.$tableSpecificName.' ADD PRIMARY KEY (`id_review`); ');
121 121
         
Please login to merge, or discard this patch.
src/models/Orthanc_Serie.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * Collect serie's data from Orthanc Server
18 18
  */
19 19
 
20
-Class Orthanc_Serie{
20
+Class Orthanc_Serie {
21 21
 	
22 22
 	public $serieOrthancID;
23 23
 	public $parentStudyOrthancID;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	public function __construct($seriesOrthancID, $url, $context) {
53 53
 	    //Set Orthanc http address
54 54
 	    $this->url=$url;
55
-	    $this->context = $context;
55
+	    $this->context=$context;
56 56
 	    
57 57
 		//Set the current serie's Orthanc ID
58 58
 		$this->serieOrthancID=$seriesOrthancID;
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 *Get Series related data and store them in this object
63 63
 	 */
64
-	public function retrieveSeriesData(){
65
-	    $context  = stream_context_create($this->context);
64
+	public function retrieveSeriesData() {
65
+	    $context=stream_context_create($this->context);
66 66
 	    //Store all shared tags
67
-	    $this->sharedTags = json_decode(file_get_contents($this->url.'/series/'.$this->serieOrthancID.'/shared-tags', false, $context));
67
+	    $this->sharedTags=json_decode(file_get_contents($this->url.'/series/'.$this->serieOrthancID.'/shared-tags', false, $context));
68 68
 		//parse main series informations
69
-	    $json = file_get_contents($this->url.'/series/'.$this->serieOrthancID, false, $context);
69
+	    $json=file_get_contents($this->url.'/series/'.$this->serieOrthancID, false, $context);
70 70
 		$seriesJson=json_decode($json, true);
71 71
 		//add needed informations in the current object
72 72
 		$this->seriesManufacturer=$seriesJson['MainDicomTags']['Manufacturer'];
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$this->seriesDescription=$seriesJson['MainDicomTags']['SeriesDescription'];
77 77
 		$this->seriesInstanceUID=$seriesJson['MainDicomTags']['SeriesInstanceUID'];
78 78
 		$this->seriesNumber=$seriesJson['MainDicomTags']['SeriesNumber'];
79
-		$this->seriesIsStable= $seriesJson['IsStable'];
79
+		$this->seriesIsStable=$seriesJson['IsStable'];
80 80
 		$this->parentStudyOrthancID=$seriesJson['ParentStudy'];
81 81
 		$this->seriesInstances=$seriesJson['Instances'];
82 82
 		$this->numberOfInstanceInOrthanc=sizeof($seriesJson['Instances']);
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 	/**
94 94
 	 * Get statistics of the series (size in MB)
95 95
 	 */
96
-	private function retrieveSeriesStatistics(){
97
-	    $context  = stream_context_create($this->context);
98
-	    $json = file_get_contents($this->url.'/series/'.$this->serieOrthancID.'/statistics/', false, $context);
96
+	private function retrieveSeriesStatistics() {
97
+	    $context=stream_context_create($this->context);
98
+	    $json=file_get_contents($this->url.'/series/'.$this->serieOrthancID.'/statistics/', false, $context);
99 99
 	    $statisticsJson=json_decode($json, true);
100 100
 	    $this->diskSizeMb=$statisticsJson['DiskSizeMB'];
101 101
 	    $this->uncompressedSizeMb=$statisticsJson['UncompressedSizeMB'];
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 	 * Store some data only available in the Instance level 
107 107
 	 * @param $instanceID
108 108
 	 */
109
-	private function retrieveInstancesData($instanceID){
110
-	    $context  = stream_context_create($this->context);
111
-	    $json = file_get_contents($this->url.'/instances/'.$instanceID.'/tags/', false, $context);
109
+	private function retrieveInstancesData($instanceID) {
110
+	    $context=stream_context_create($this->context);
111
+	    $json=file_get_contents($this->url.'/instances/'.$instanceID.'/tags/', false, $context);
112 112
 	    $instanceJson=json_decode($json, true);
113 113
 	    $this->patientWeight=$instanceJson['0010,1030']['Value'];
114 114
 	    $this->seriesModelName=$instanceJson['0008,1090']['Value'];
115 115
 	    $this->injectedDose=$instanceJson['0054,0016']['Value'][0]['0018,1074']['Value'];
116 116
 	    //SK InjectedTime est deprecie en faveur de DateTime, A surveiller pour la suite
117
-	    $this->injectedTime=$instanceJson['0054,0016']['Value'][0]['0018,1072']['Value'] ;
118
-	    $this->injectedDateTime=$instanceJson['0054,0016']['Value'][0]['0018,1078']['Value'] ;
117
+	    $this->injectedTime=$instanceJson['0054,0016']['Value'][0]['0018,1072']['Value'];
118
+	    $this->injectedDateTime=$instanceJson['0054,0016']['Value'][0]['0018,1078']['Value'];
119 119
 	    $this->injectedActivity=$instanceJson['0054,0016']['Value'][0]['0018,1077']['Value'];
120 120
 	    $this->radiopharmaceutical=$instanceJson['0054,0016']['Value'][0]['0018,0031']['Value'];
121 121
 	    $this->halfLife=$instanceJson['0054,0016']['Value'][0]['0018,1075']['Value'];
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * Return if this serie  in a secondary capture type
127 127
 	 * @return boolean
128 128
 	 */
129
-	public function isSecondaryCapture(){
129
+	public function isSecondaryCapture() {
130 130
 		$scUids[]="1.2.840.10008.5.1.4.1.1.7";
131 131
 		$scUids[]="1.2.840.10008.5.1.4.1.1.7.1";
132 132
 		$scUids[]="1.2.840.10008.5.1.4.1.1.7.2";
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		$scUids[]="1.2.840.10008.5.1.4.1.1.88.65";
142 142
 		$scUids[]="1.2.840.10008.5.1.4.1.1.88.67";
143 143
 		
144
-		if(in_array($this->sopClassUid, $scUids)){
144
+		if (in_array($this->sopClassUid, $scUids)) {
145 145
 			return true;
146 146
 		}else {
147 147
 			return false;
Please login to merge, or discard this patch.