@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
| 204 | 204 | WHERE study = :study"); |
| 205 | 205 | |
| 206 | - }else{ |
|
| 206 | + } else{ |
|
| 207 | 207 | $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
| 208 | 208 | WHERE study = :study |
| 209 | 209 | AND ".$role."= 1 AND deleted=0"); |
@@ -292,7 +292,11 @@ discard block |
||
| 292 | 292 | )); |
| 293 | 293 | $result = $connecter->fetchAll(PDO::FETCH_COLUMN); |
| 294 | 294 | |
| 295 | - if(count($result)>0) return false; else return true; |
|
| 295 | + if(count($result)>0) { |
|
| 296 | + return false; |
|
| 297 | + } else { |
|
| 298 | + return true; |
|
| 299 | + } |
|
| 296 | 300 | |
| 297 | 301 | } |
| 298 | 302 | |
@@ -19,28 +19,28 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | Class Study { |
| 21 | 21 | |
| 22 | - private $linkpdo; |
|
| 23 | - public $study; |
|
| 24 | - public $patientCodePrefix; |
|
| 22 | + private $linkpdo; |
|
| 23 | + public $study; |
|
| 24 | + public $patientCodePrefix; |
|
| 25 | 25 | |
| 26 | - public function __construct(String $study, PDO $linkpdo){ |
|
| 26 | + public function __construct(String $study, PDO $linkpdo){ |
|
| 27 | 27 | |
| 28 | - $this->linkpdo=$linkpdo; |
|
| 29 | - $connecter = $this->linkpdo->prepare('SELECT * FROM studies WHERE name=:study'); |
|
| 30 | - $connecter->execute(array( |
|
| 31 | - "study" => $study, |
|
| 32 | - )); |
|
| 33 | - $result = $connecter->fetch(PDO::FETCH_ASSOC); |
|
| 28 | + $this->linkpdo=$linkpdo; |
|
| 29 | + $connecter = $this->linkpdo->prepare('SELECT * FROM studies WHERE name=:study'); |
|
| 30 | + $connecter->execute(array( |
|
| 31 | + "study" => $study, |
|
| 32 | + )); |
|
| 33 | + $result = $connecter->fetch(PDO::FETCH_ASSOC); |
|
| 34 | 34 | |
| 35 | - $this->study=$result['name']; |
|
| 36 | - $this->patientCodePrefix = $result['patient_code_prefix']; |
|
| 35 | + $this->study=$result['name']; |
|
| 36 | + $this->patientCodePrefix = $result['patient_code_prefix']; |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function getPatientsLinkedToUserCenters($username) |
|
| 42 | - { |
|
| 43 | - $patients = $this->linkpdo->prepare(' SELECT patients.code |
|
| 41 | + public function getPatientsLinkedToUserCenters($username) |
|
| 42 | + { |
|
| 43 | + $patients = $this->linkpdo->prepare(' SELECT patients.code |
|
| 44 | 44 | FROM patients |
| 45 | 45 | WHERE patients.center IN (SELECT affiliated_centers.center |
| 46 | 46 | FROM affiliated_centers |
@@ -52,234 +52,234 @@ discard block |
||
| 52 | 52 | AND study = :study |
| 53 | 53 | GROUP BY patients.code'); |
| 54 | 54 | |
| 55 | - $patients->execute(array( |
|
| 56 | - 'username' => $username, |
|
| 57 | - 'study' => $this->study |
|
| 58 | - )); |
|
| 55 | + $patients->execute(array( |
|
| 56 | + 'username' => $username, |
|
| 57 | + 'study' => $this->study |
|
| 58 | + )); |
|
| 59 | 59 | |
| 60 | - $patientsCodes = $patients->fetchAll(PDO::FETCH_COLUMN); |
|
| 60 | + $patientsCodes = $patients->fetchAll(PDO::FETCH_COLUMN); |
|
| 61 | 61 | |
| 62 | - $patientObjectsArray = []; |
|
| 62 | + $patientObjectsArray = []; |
|
| 63 | 63 | |
| 64 | - foreach ($patientsCodes as $patientCode) { |
|
| 65 | - $patientObjectsArray[] = new Patient($patientCode, $this->linkpdo); |
|
| 66 | - } |
|
| 64 | + foreach ($patientsCodes as $patientCode) { |
|
| 65 | + $patientObjectsArray[] = new Patient($patientCode, $this->linkpdo); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - return $patientObjectsArray; |
|
| 69 | - } |
|
| 68 | + return $patientObjectsArray; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - public function getAllCreatedVisits(bool $deleted=false){ |
|
| 71 | + public function getAllCreatedVisits(bool $deleted=false){ |
|
| 72 | 72 | |
| 73 | - $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 73 | + $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 74 | 74 | |
| 75 | - $visitsObjectArray = []; |
|
| 75 | + $visitsObjectArray = []; |
|
| 76 | 76 | |
| 77 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 78 | - $createdVisits=$studyGroup->getStudyVisitManager()->getCreatedVisits($deleted); |
|
| 79 | - array_push($visitsObjectArray, ...$createdVisits); |
|
| 80 | - } |
|
| 77 | + foreach($possibleStudyGroups as $studyGroup){ |
|
| 78 | + $createdVisits=$studyGroup->getStudyVisitManager()->getCreatedVisits($deleted); |
|
| 79 | + array_push($visitsObjectArray, ...$createdVisits); |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - return $visitsObjectArray; |
|
| 82 | + return $visitsObjectArray; |
|
| 83 | 83 | |
| 84 | - } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - public function getAllAwaitingUploadImagingVisit(){ |
|
| 86 | + public function getAllAwaitingUploadImagingVisit(){ |
|
| 87 | 87 | |
| 88 | - $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 89 | - $visitsObjectArray = []; |
|
| 88 | + $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 89 | + $visitsObjectArray = []; |
|
| 90 | 90 | |
| 91 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 92 | - if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 93 | - $awaitingUploadVisits=$studyGroup->getStudyVisitManager()->getAwaitingUploadVisit(); |
|
| 94 | - array_push($visitsObjectArray, ...$awaitingUploadVisits); |
|
| 95 | - } |
|
| 91 | + foreach($possibleStudyGroups as $studyGroup){ |
|
| 92 | + if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 93 | + $awaitingUploadVisits=$studyGroup->getStudyVisitManager()->getAwaitingUploadVisit(); |
|
| 94 | + array_push($visitsObjectArray, ...$awaitingUploadVisits); |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | 97 | |
| 98 | - } |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - return $visitsObjectArray; |
|
| 100 | + return $visitsObjectArray; |
|
| 101 | 101 | |
| 102 | - } |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - public function getAllAwaitingReviewImagingVisit($username = null){ |
|
| 104 | + public function getAllAwaitingReviewImagingVisit($username = null){ |
|
| 105 | 105 | |
| 106 | - $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 107 | - $visitsObjectArray = []; |
|
| 106 | + $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 107 | + $visitsObjectArray = []; |
|
| 108 | 108 | |
| 109 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 110 | - if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 111 | - $awaitingReviewVisits=$studyGroup->getStudyVisitManager()->getAwaitingReviewVisit($username); |
|
| 112 | - array_push($visitsObjectArray, ...$awaitingReviewVisits); |
|
| 113 | - } |
|
| 109 | + foreach($possibleStudyGroups as $studyGroup){ |
|
| 110 | + if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 111 | + $awaitingReviewVisits=$studyGroup->getStudyVisitManager()->getAwaitingReviewVisit($username); |
|
| 112 | + array_push($visitsObjectArray, ...$awaitingReviewVisits); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - } |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - return $visitsObjectArray; |
|
| 118 | + return $visitsObjectArray; |
|
| 119 | 119 | |
| 120 | - } |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - public function getAllUploadedImagingVisits(){ |
|
| 122 | + public function getAllUploadedImagingVisits(){ |
|
| 123 | 123 | |
| 124 | - $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 125 | - $visitsObjectArray = []; |
|
| 124 | + $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
|
| 125 | + $visitsObjectArray = []; |
|
| 126 | 126 | |
| 127 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 128 | - if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 129 | - $uploadedVisits=$studyGroup->getStudyVisitManager()->getUploadedVisits(); |
|
| 130 | - array_push($visitsObjectArray, ...$uploadedVisits); |
|
| 131 | - } |
|
| 127 | + foreach($possibleStudyGroups as $studyGroup){ |
|
| 128 | + if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 129 | + $uploadedVisits=$studyGroup->getStudyVisitManager()->getUploadedVisits(); |
|
| 130 | + array_push($visitsObjectArray, ...$uploadedVisits); |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | 133 | |
| 134 | - } |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - return $visitsObjectArray; |
|
| 136 | + return $visitsObjectArray; |
|
| 137 | 137 | |
| 138 | - } |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - public function isHavingAwaitingReviewImagingVisit($username=null){ |
|
| 141 | - $awaitingVisits=$this->getAllAwaitingReviewImagingVisit($username); |
|
| 142 | - $havingAwaitingReview= (sizeof($awaitingVisits) > 0); |
|
| 143 | - return $havingAwaitingReview; |
|
| 144 | - } |
|
| 140 | + public function isHavingAwaitingReviewImagingVisit($username=null){ |
|
| 141 | + $awaitingVisits=$this->getAllAwaitingReviewImagingVisit($username); |
|
| 142 | + $havingAwaitingReview= (sizeof($awaitingVisits) > 0); |
|
| 143 | + return $havingAwaitingReview; |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | - public function getAllPossibleVisitGroups(){ |
|
| 148 | + public function getAllPossibleVisitGroups(){ |
|
| 149 | 149 | |
| 150 | - $allGroupsType = $this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study'); |
|
| 151 | - $allGroupsType->execute(array('study' => $this->study)); |
|
| 152 | - $allGroupsIds=$allGroupsType->fetchall(PDO::FETCH_COLUMN); |
|
| 150 | + $allGroupsType = $this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study'); |
|
| 151 | + $allGroupsType->execute(array('study' => $this->study)); |
|
| 152 | + $allGroupsIds=$allGroupsType->fetchall(PDO::FETCH_COLUMN); |
|
| 153 | 153 | |
| 154 | - $visitGroupArray=[]; |
|
| 155 | - foreach ($allGroupsIds as $groupId){ |
|
| 156 | - $visitGroupArray[]=new Visit_Group($this->linkpdo, $groupId); |
|
| 157 | - } |
|
| 154 | + $visitGroupArray=[]; |
|
| 155 | + foreach ($allGroupsIds as $groupId){ |
|
| 156 | + $visitGroupArray[]=new Visit_Group($this->linkpdo, $groupId); |
|
| 157 | + } |
|
| 158 | 158 | |
| 159 | - return $visitGroupArray; |
|
| 159 | + return $visitGroupArray; |
|
| 160 | 160 | |
| 161 | - } |
|
| 161 | + } |
|
| 162 | 162 | |
| 163 | - public function getSpecificGroup(String $groupModality) : Visit_Group { |
|
| 163 | + public function getSpecificGroup(String $groupModality) : Visit_Group { |
|
| 164 | 164 | |
| 165 | - $groupQuery = $this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study AND group_modality=:groupModality'); |
|
| 166 | - $groupQuery->execute(array('study' => $this->study, 'groupModality'=> $groupModality)); |
|
| 167 | - $groupId=$groupQuery->fetch(PDO::FETCH_COLUMN); |
|
| 165 | + $groupQuery = $this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study AND group_modality=:groupModality'); |
|
| 166 | + $groupQuery->execute(array('study' => $this->study, 'groupModality'=> $groupModality)); |
|
| 167 | + $groupId=$groupQuery->fetch(PDO::FETCH_COLUMN); |
|
| 168 | 168 | |
| 169 | - return new Visit_Group($this->linkpdo, $groupId); |
|
| 169 | + return new Visit_Group($this->linkpdo, $groupId); |
|
| 170 | 170 | |
| 171 | - } |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - public function getStudySpecificGroupManager(String $groupModality) : Group_Visit_Manager { |
|
| 173 | + public function getStudySpecificGroupManager(String $groupModality) : Group_Visit_Manager { |
|
| 174 | 174 | |
| 175 | - $visitGroup=$this->getSpecificGroup($groupModality); |
|
| 175 | + $visitGroup=$this->getSpecificGroup($groupModality); |
|
| 176 | 176 | |
| 177 | - return new Group_Visit_Manager($this, $visitGroup, $this->linkpdo); |
|
| 177 | + return new Group_Visit_Manager($this, $visitGroup, $this->linkpdo); |
|
| 178 | 178 | |
| 179 | - } |
|
| 179 | + } |
|
| 180 | 180 | |
| 181 | - public function getReviewManager() : Study_Review_Manager { |
|
| 182 | - return new Study_Review_Manager($this); |
|
| 183 | - } |
|
| 181 | + public function getReviewManager() : Study_Review_Manager { |
|
| 182 | + return new Study_Review_Manager($this); |
|
| 183 | + } |
|
| 184 | 184 | |
| 185 | - public function getExportStudyData() : Export_Study_Data{ |
|
| 186 | - return new Export_Study_Data($this); |
|
| 187 | - } |
|
| 185 | + public function getExportStudyData() : Export_Study_Data{ |
|
| 186 | + return new Export_Study_Data($this); |
|
| 187 | + } |
|
| 188 | 188 | |
| 189 | - public function getAllPatientsInStudy(){ |
|
| 190 | - $allPatientQuery = $this->linkpdo->prepare('SELECT code FROM patients WHERE study = :study'); |
|
| 191 | - $allPatientQuery->execute(array('study' => $this->study)); |
|
| 192 | - $allPatients=$allPatientQuery->fetchall(PDO::FETCH_COLUMN); |
|
| 189 | + public function getAllPatientsInStudy(){ |
|
| 190 | + $allPatientQuery = $this->linkpdo->prepare('SELECT code FROM patients WHERE study = :study'); |
|
| 191 | + $allPatientQuery->execute(array('study' => $this->study)); |
|
| 192 | + $allPatients=$allPatientQuery->fetchall(PDO::FETCH_COLUMN); |
|
| 193 | 193 | |
| 194 | - $patientObjectArray=[]; |
|
| 195 | - foreach ($allPatients as $patient){ |
|
| 196 | - $patientObjectArray[]=new Patient($patient, $this->linkpdo); |
|
| 197 | - } |
|
| 194 | + $patientObjectArray=[]; |
|
| 195 | + foreach ($allPatients as $patient){ |
|
| 196 | + $patientObjectArray[]=new Patient($patient, $this->linkpdo); |
|
| 197 | + } |
|
| 198 | 198 | |
| 199 | - return $patientObjectArray; |
|
| 199 | + return $patientObjectArray; |
|
| 200 | 200 | |
| 201 | - } |
|
| 201 | + } |
|
| 202 | 202 | |
| 203 | - public function getDocumentation(String $role){ |
|
| 204 | - if($role==User::SUPERVISOR){ |
|
| 205 | - $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 203 | + public function getDocumentation(String $role){ |
|
| 204 | + if($role==User::SUPERVISOR){ |
|
| 205 | + $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 206 | 206 | WHERE study = :study"); |
| 207 | 207 | |
| 208 | - }else{ |
|
| 209 | - $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 208 | + }else{ |
|
| 209 | + $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 210 | 210 | WHERE study = :study |
| 211 | 211 | AND ".$role."= 1 AND deleted=0"); |
| 212 | 212 | |
| 213 | - } |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | - $documentationQuery->execute(array('study' => $this->study)); |
|
| 216 | - $documentationAnswers=$documentationQuery->fetchAll(PDO::FETCH_COLUMN); |
|
| 215 | + $documentationQuery->execute(array('study' => $this->study)); |
|
| 216 | + $documentationAnswers=$documentationQuery->fetchAll(PDO::FETCH_COLUMN); |
|
| 217 | 217 | |
| 218 | - $documentationObjects=[]; |
|
| 219 | - foreach ($documentationAnswers as $documentationId){ |
|
| 220 | - $documentationObjects[]=new Documentation($this->linkpdo, $documentationId); |
|
| 221 | - } |
|
| 222 | - return $documentationObjects; |
|
| 223 | - } |
|
| 218 | + $documentationObjects=[]; |
|
| 219 | + foreach ($documentationAnswers as $documentationId){ |
|
| 220 | + $documentationObjects[]=new Documentation($this->linkpdo, $documentationId); |
|
| 221 | + } |
|
| 222 | + return $documentationObjects; |
|
| 223 | + } |
|
| 224 | 224 | |
| 225 | - /** |
|
| 226 | - * Return userObject array for all users having role in the study |
|
| 227 | - * @return User[] |
|
| 228 | - */ |
|
| 229 | - public function getUsersWithRoleInStudy(){ |
|
| 230 | - $req = $this->linkpdo->prepare('SELECT DISTINCT users.username FROM roles,users |
|
| 225 | + /** |
|
| 226 | + * Return userObject array for all users having role in the study |
|
| 227 | + * @return User[] |
|
| 228 | + */ |
|
| 229 | + public function getUsersWithRoleInStudy(){ |
|
| 230 | + $req = $this->linkpdo->prepare('SELECT DISTINCT users.username FROM roles,users |
|
| 231 | 231 | WHERE roles.username=users.username |
| 232 | 232 | AND roles.study=:study'); |
| 233 | - $req->execute(array('study' => $this->study)); |
|
| 234 | - $answers=$req->fetchAll(PDO::FETCH_COLUMN); |
|
| 233 | + $req->execute(array('study' => $this->study)); |
|
| 234 | + $answers=$req->fetchAll(PDO::FETCH_COLUMN); |
|
| 235 | 235 | |
| 236 | - $usersObjects=[]; |
|
| 237 | - foreach ($answers as $username){ |
|
| 238 | - $usersObjects[]=new User($username, $this->linkpdo); |
|
| 239 | - } |
|
| 240 | - return $usersObjects; |
|
| 236 | + $usersObjects=[]; |
|
| 237 | + foreach ($answers as $username){ |
|
| 238 | + $usersObjects[]=new User($username, $this->linkpdo); |
|
| 239 | + } |
|
| 240 | + return $usersObjects; |
|
| 241 | 241 | |
| 242 | - } |
|
| 242 | + } |
|
| 243 | 243 | |
| 244 | - public function getUsersByRoleInStudy(String $role){ |
|
| 245 | - $req = $this->linkpdo->prepare('SELECT username FROM roles |
|
| 244 | + public function getUsersByRoleInStudy(String $role){ |
|
| 245 | + $req = $this->linkpdo->prepare('SELECT username FROM roles |
|
| 246 | 246 | WHERE study=:study AND name=:role '); |
| 247 | - $req->execute(array('study' => $this->study, 'role'=>$role)); |
|
| 248 | - $answers=$req->fetchAll(PDO::FETCH_COLUMN); |
|
| 247 | + $req->execute(array('study' => $this->study, 'role'=>$role)); |
|
| 248 | + $answers=$req->fetchAll(PDO::FETCH_COLUMN); |
|
| 249 | 249 | |
| 250 | - $usersObjects=[]; |
|
| 251 | - foreach ($answers as $username){ |
|
| 252 | - $usersObjects[]=new User($username, $this->linkpdo); |
|
| 253 | - } |
|
| 254 | - return $usersObjects; |
|
| 250 | + $usersObjects=[]; |
|
| 251 | + foreach ($answers as $username){ |
|
| 252 | + $usersObjects[]=new User($username, $this->linkpdo); |
|
| 253 | + } |
|
| 254 | + return $usersObjects; |
|
| 255 | 255 | |
| 256 | - } |
|
| 256 | + } |
|
| 257 | 257 | |
| 258 | - public function getAllRolesByUsers(){ |
|
| 259 | - $roles_query = $this->linkpdo->prepare('SELECT * FROM roles WHERE study=:study'); |
|
| 260 | - $roles_query->execute(array('study'=>$this->study)); |
|
| 261 | - $definedRoles=$roles_query->fetchall(PDO::FETCH_ASSOC); |
|
| 258 | + public function getAllRolesByUsers(){ |
|
| 259 | + $roles_query = $this->linkpdo->prepare('SELECT * FROM roles WHERE study=:study'); |
|
| 260 | + $roles_query->execute(array('study'=>$this->study)); |
|
| 261 | + $definedRoles=$roles_query->fetchall(PDO::FETCH_ASSOC); |
|
| 262 | 262 | |
| 263 | - foreach ($definedRoles as $role){ |
|
| 264 | - $rolesList[$role['username']][]=$role['name']; |
|
| 265 | - } |
|
| 266 | - return $rolesList; |
|
| 267 | - } |
|
| 268 | - |
|
| 269 | - public function getStatistics(String $modality) { |
|
| 270 | - return new Statistics($this, $modality); |
|
| 271 | - } |
|
| 263 | + foreach ($definedRoles as $role){ |
|
| 264 | + $rolesList[$role['username']][]=$role['name']; |
|
| 265 | + } |
|
| 266 | + return $rolesList; |
|
| 267 | + } |
|
| 268 | + |
|
| 269 | + public function getStatistics(String $modality) { |
|
| 270 | + return new Statistics($this, $modality); |
|
| 271 | + } |
|
| 272 | 272 | |
| 273 | - public function changeStudyActivation(bool $activated){ |
|
| 274 | - $req = $this->linkpdo->prepare('UPDATE studies SET |
|
| 273 | + public function changeStudyActivation(bool $activated){ |
|
| 274 | + $req = $this->linkpdo->prepare('UPDATE studies SET |
|
| 275 | 275 | active = :active |
| 276 | 276 | WHERE name = :study'); |
| 277 | - $req->execute(array( 'study'=> $this->study, 'active'=>intval($activated))); |
|
| 278 | - } |
|
| 277 | + $req->execute(array( 'study'=> $this->study, 'active'=>intval($activated))); |
|
| 278 | + } |
|
| 279 | 279 | |
| 280 | - public function isOriginalOrthancNeverKnown($anonFromOrthancStudyId){ |
|
| 280 | + public function isOriginalOrthancNeverKnown($anonFromOrthancStudyId){ |
|
| 281 | 281 | |
| 282 | - $connecter = $this->linkpdo->prepare('SELECT Study_Orthanc_ID FROM visits |
|
| 282 | + $connecter = $this->linkpdo->prepare('SELECT Study_Orthanc_ID FROM visits |
|
| 283 | 283 | INNER JOIN visit_type ON |
| 284 | 284 | (visit_type.id=visits.visit_type_id |
| 285 | 285 | AND visit_type.group_id IN (SELECT id FROM visit_group WHERE study = :study)) |
@@ -287,26 +287,26 @@ discard block |
||
| 287 | 287 | AND orthanc_studies.Anon_From_Orthanc_ID=:Anon_From_Orthanc_ID |
| 288 | 288 | AND orthanc_studies.deleted=0 |
| 289 | 289 | AND visits.deleted=0' |
| 290 | - ); |
|
| 291 | - $connecter->execute(array( |
|
| 292 | - "study" => $this->study, |
|
| 293 | - "Anon_From_Orthanc_ID"=>$anonFromOrthancStudyId |
|
| 294 | - )); |
|
| 295 | - $result = $connecter->fetchAll(PDO::FETCH_COLUMN); |
|
| 290 | + ); |
|
| 291 | + $connecter->execute(array( |
|
| 292 | + "study" => $this->study, |
|
| 293 | + "Anon_From_Orthanc_ID"=>$anonFromOrthancStudyId |
|
| 294 | + )); |
|
| 295 | + $result = $connecter->fetchAll(PDO::FETCH_COLUMN); |
|
| 296 | 296 | |
| 297 | - if(count($result)>0) return false; else return true; |
|
| 297 | + if(count($result)>0) return false; else return true; |
|
| 298 | 298 | |
| 299 | - } |
|
| 299 | + } |
|
| 300 | 300 | |
| 301 | - public static function createStudy(string $studyName, $patientCodePrefix, PDO $linkpdo){ |
|
| 301 | + public static function createStudy(string $studyName, $patientCodePrefix, PDO $linkpdo){ |
|
| 302 | 302 | |
| 303 | - $req = $linkpdo->prepare('INSERT INTO studies (name, patient_code_prefix) VALUES(:studyName, :patientCodePrefix) '); |
|
| 303 | + $req = $linkpdo->prepare('INSERT INTO studies (name, patient_code_prefix) VALUES(:studyName, :patientCodePrefix) '); |
|
| 304 | 304 | |
| 305 | - $req->execute(array( |
|
| 306 | - 'studyName' => $studyName, |
|
| 307 | - 'patientCodePrefix' => $patientCodePrefix |
|
| 308 | - )); |
|
| 305 | + $req->execute(array( |
|
| 306 | + 'studyName' => $studyName, |
|
| 307 | + 'patientCodePrefix' => $patientCodePrefix |
|
| 308 | + )); |
|
| 309 | 309 | |
| 310 | - } |
|
| 310 | + } |
|
| 311 | 311 | |
| 312 | 312 | } |
| 313 | 313 | \ No newline at end of file |
@@ -23,24 +23,24 @@ discard block |
||
| 23 | 23 | public $study; |
| 24 | 24 | public $patientCodePrefix; |
| 25 | 25 | |
| 26 | - public function __construct(String $study, PDO $linkpdo){ |
|
| 26 | + public function __construct(String $study, PDO $linkpdo) { |
|
| 27 | 27 | |
| 28 | 28 | $this->linkpdo=$linkpdo; |
| 29 | - $connecter = $this->linkpdo->prepare('SELECT * FROM studies WHERE name=:study'); |
|
| 29 | + $connecter=$this->linkpdo->prepare('SELECT * FROM studies WHERE name=:study'); |
|
| 30 | 30 | $connecter->execute(array( |
| 31 | 31 | "study" => $study, |
| 32 | 32 | )); |
| 33 | - $result = $connecter->fetch(PDO::FETCH_ASSOC); |
|
| 33 | + $result=$connecter->fetch(PDO::FETCH_ASSOC); |
|
| 34 | 34 | |
| 35 | 35 | $this->study=$result['name']; |
| 36 | - $this->patientCodePrefix = $result['patient_code_prefix']; |
|
| 36 | + $this->patientCodePrefix=$result['patient_code_prefix']; |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function getPatientsLinkedToUserCenters($username) |
| 42 | 42 | { |
| 43 | - $patients = $this->linkpdo->prepare(' SELECT patients.code |
|
| 43 | + $patients=$this->linkpdo->prepare(' SELECT patients.code |
|
| 44 | 44 | FROM patients |
| 45 | 45 | WHERE patients.center IN (SELECT affiliated_centers.center |
| 46 | 46 | FROM affiliated_centers |
@@ -57,24 +57,24 @@ discard block |
||
| 57 | 57 | 'study' => $this->study |
| 58 | 58 | )); |
| 59 | 59 | |
| 60 | - $patientsCodes = $patients->fetchAll(PDO::FETCH_COLUMN); |
|
| 60 | + $patientsCodes=$patients->fetchAll(PDO::FETCH_COLUMN); |
|
| 61 | 61 | |
| 62 | - $patientObjectsArray = []; |
|
| 62 | + $patientObjectsArray=[]; |
|
| 63 | 63 | |
| 64 | 64 | foreach ($patientsCodes as $patientCode) { |
| 65 | - $patientObjectsArray[] = new Patient($patientCode, $this->linkpdo); |
|
| 65 | + $patientObjectsArray[]=new Patient($patientCode, $this->linkpdo); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | return $patientObjectsArray; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - public function getAllCreatedVisits(bool $deleted=false){ |
|
| 71 | + public function getAllCreatedVisits(bool $deleted=false) { |
|
| 72 | 72 | |
| 73 | 73 | $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
| 74 | 74 | |
| 75 | - $visitsObjectArray = []; |
|
| 75 | + $visitsObjectArray=[]; |
|
| 76 | 76 | |
| 77 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 77 | + foreach ($possibleStudyGroups as $studyGroup) { |
|
| 78 | 78 | $createdVisits=$studyGroup->getStudyVisitManager()->getCreatedVisits($deleted); |
| 79 | 79 | array_push($visitsObjectArray, ...$createdVisits); |
| 80 | 80 | } |
@@ -83,13 +83,13 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public function getAllAwaitingUploadImagingVisit(){ |
|
| 86 | + public function getAllAwaitingUploadImagingVisit() { |
|
| 87 | 87 | |
| 88 | 88 | $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
| 89 | - $visitsObjectArray = []; |
|
| 89 | + $visitsObjectArray=[]; |
|
| 90 | 90 | |
| 91 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 92 | - if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 91 | + foreach ($possibleStudyGroups as $studyGroup) { |
|
| 92 | + if (in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET))) { |
|
| 93 | 93 | $awaitingUploadVisits=$studyGroup->getStudyVisitManager()->getAwaitingUploadVisit(); |
| 94 | 94 | array_push($visitsObjectArray, ...$awaitingUploadVisits); |
| 95 | 95 | } |
@@ -101,13 +101,13 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - public function getAllAwaitingReviewImagingVisit($username = null){ |
|
| 104 | + public function getAllAwaitingReviewImagingVisit($username=null) { |
|
| 105 | 105 | |
| 106 | 106 | $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
| 107 | - $visitsObjectArray = []; |
|
| 107 | + $visitsObjectArray=[]; |
|
| 108 | 108 | |
| 109 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 110 | - if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 109 | + foreach ($possibleStudyGroups as $studyGroup) { |
|
| 110 | + if (in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET))) { |
|
| 111 | 111 | $awaitingReviewVisits=$studyGroup->getStudyVisitManager()->getAwaitingReviewVisit($username); |
| 112 | 112 | array_push($visitsObjectArray, ...$awaitingReviewVisits); |
| 113 | 113 | } |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - public function getAllUploadedImagingVisits(){ |
|
| 122 | + public function getAllUploadedImagingVisits() { |
|
| 123 | 123 | |
| 124 | 124 | $possibleStudyGroups=$this->getAllPossibleVisitGroups(); |
| 125 | - $visitsObjectArray = []; |
|
| 125 | + $visitsObjectArray=[]; |
|
| 126 | 126 | |
| 127 | - foreach($possibleStudyGroups as $studyGroup){ |
|
| 128 | - if(in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET)) ){ |
|
| 127 | + foreach ($possibleStudyGroups as $studyGroup) { |
|
| 128 | + if (in_array($studyGroup->groupModality, array(Visit_Group::GROUP_MODALITY_CT, Visit_Group::GROUP_MODALITY_MR, Visit_Group::GROUP_MODALITY_PET))) { |
|
| 129 | 129 | $uploadedVisits=$studyGroup->getStudyVisitManager()->getUploadedVisits(); |
| 130 | 130 | array_push($visitsObjectArray, ...$uploadedVisits); |
| 131 | 131 | } |
@@ -137,22 +137,22 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - public function isHavingAwaitingReviewImagingVisit($username=null){ |
|
| 140 | + public function isHavingAwaitingReviewImagingVisit($username=null) { |
|
| 141 | 141 | $awaitingVisits=$this->getAllAwaitingReviewImagingVisit($username); |
| 142 | - $havingAwaitingReview= (sizeof($awaitingVisits) > 0); |
|
| 142 | + $havingAwaitingReview=(sizeof($awaitingVisits) > 0); |
|
| 143 | 143 | return $havingAwaitingReview; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | - public function getAllPossibleVisitGroups(){ |
|
| 148 | + public function getAllPossibleVisitGroups() { |
|
| 149 | 149 | |
| 150 | - $allGroupsType = $this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study'); |
|
| 150 | + $allGroupsType=$this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study'); |
|
| 151 | 151 | $allGroupsType->execute(array('study' => $this->study)); |
| 152 | 152 | $allGroupsIds=$allGroupsType->fetchall(PDO::FETCH_COLUMN); |
| 153 | 153 | |
| 154 | 154 | $visitGroupArray=[]; |
| 155 | - foreach ($allGroupsIds as $groupId){ |
|
| 155 | + foreach ($allGroupsIds as $groupId) { |
|
| 156 | 156 | $visitGroupArray[]=new Visit_Group($this->linkpdo, $groupId); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | public function getSpecificGroup(String $groupModality) : Visit_Group { |
| 164 | 164 | |
| 165 | - $groupQuery = $this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study AND group_modality=:groupModality'); |
|
| 165 | + $groupQuery=$this->linkpdo->prepare('SELECT id FROM visit_group WHERE study = :study AND group_modality=:groupModality'); |
|
| 166 | 166 | $groupQuery->execute(array('study' => $this->study, 'groupModality'=> $groupModality)); |
| 167 | 167 | $groupId=$groupQuery->fetch(PDO::FETCH_COLUMN); |
| 168 | 168 | |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | return new Export_Study_Data($this); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - public function getAllPatientsInStudy(){ |
|
| 190 | - $allPatientQuery = $this->linkpdo->prepare('SELECT code FROM patients WHERE study = :study'); |
|
| 189 | + public function getAllPatientsInStudy() { |
|
| 190 | + $allPatientQuery=$this->linkpdo->prepare('SELECT code FROM patients WHERE study = :study'); |
|
| 191 | 191 | $allPatientQuery->execute(array('study' => $this->study)); |
| 192 | 192 | $allPatients=$allPatientQuery->fetchall(PDO::FETCH_COLUMN); |
| 193 | 193 | |
| 194 | 194 | $patientObjectArray=[]; |
| 195 | - foreach ($allPatients as $patient){ |
|
| 195 | + foreach ($allPatients as $patient) { |
|
| 196 | 196 | $patientObjectArray[]=new Patient($patient, $this->linkpdo); |
| 197 | 197 | } |
| 198 | 198 | |
@@ -200,13 +200,13 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - public function getDocumentation(String $role){ |
|
| 204 | - if($role==User::SUPERVISOR){ |
|
| 205 | - $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 203 | + public function getDocumentation(String $role) { |
|
| 204 | + if ($role == User::SUPERVISOR) { |
|
| 205 | + $documentationQuery=$this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 206 | 206 | WHERE study = :study"); |
| 207 | 207 | |
| 208 | - }else{ |
|
| 209 | - $documentationQuery = $this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 208 | + }else { |
|
| 209 | + $documentationQuery=$this->linkpdo->prepare("SELECT id_documentation FROM documentation |
|
| 210 | 210 | WHERE study = :study |
| 211 | 211 | AND ".$role."= 1 AND deleted=0"); |
| 212 | 212 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $documentationAnswers=$documentationQuery->fetchAll(PDO::FETCH_COLUMN); |
| 217 | 217 | |
| 218 | 218 | $documentationObjects=[]; |
| 219 | - foreach ($documentationAnswers as $documentationId){ |
|
| 219 | + foreach ($documentationAnswers as $documentationId) { |
|
| 220 | 220 | $documentationObjects[]=new Documentation($this->linkpdo, $documentationId); |
| 221 | 221 | } |
| 222 | 222 | return $documentationObjects; |
@@ -226,41 +226,41 @@ discard block |
||
| 226 | 226 | * Return userObject array for all users having role in the study |
| 227 | 227 | * @return User[] |
| 228 | 228 | */ |
| 229 | - public function getUsersWithRoleInStudy(){ |
|
| 230 | - $req = $this->linkpdo->prepare('SELECT DISTINCT users.username FROM roles,users |
|
| 229 | + public function getUsersWithRoleInStudy() { |
|
| 230 | + $req=$this->linkpdo->prepare('SELECT DISTINCT users.username FROM roles,users |
|
| 231 | 231 | WHERE roles.username=users.username |
| 232 | 232 | AND roles.study=:study'); |
| 233 | 233 | $req->execute(array('study' => $this->study)); |
| 234 | 234 | $answers=$req->fetchAll(PDO::FETCH_COLUMN); |
| 235 | 235 | |
| 236 | 236 | $usersObjects=[]; |
| 237 | - foreach ($answers as $username){ |
|
| 237 | + foreach ($answers as $username) { |
|
| 238 | 238 | $usersObjects[]=new User($username, $this->linkpdo); |
| 239 | 239 | } |
| 240 | 240 | return $usersObjects; |
| 241 | 241 | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - public function getUsersByRoleInStudy(String $role){ |
|
| 245 | - $req = $this->linkpdo->prepare('SELECT username FROM roles |
|
| 244 | + public function getUsersByRoleInStudy(String $role) { |
|
| 245 | + $req=$this->linkpdo->prepare('SELECT username FROM roles |
|
| 246 | 246 | WHERE study=:study AND name=:role '); |
| 247 | 247 | $req->execute(array('study' => $this->study, 'role'=>$role)); |
| 248 | 248 | $answers=$req->fetchAll(PDO::FETCH_COLUMN); |
| 249 | 249 | |
| 250 | 250 | $usersObjects=[]; |
| 251 | - foreach ($answers as $username){ |
|
| 251 | + foreach ($answers as $username) { |
|
| 252 | 252 | $usersObjects[]=new User($username, $this->linkpdo); |
| 253 | 253 | } |
| 254 | 254 | return $usersObjects; |
| 255 | 255 | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - public function getAllRolesByUsers(){ |
|
| 259 | - $roles_query = $this->linkpdo->prepare('SELECT * FROM roles WHERE study=:study'); |
|
| 258 | + public function getAllRolesByUsers() { |
|
| 259 | + $roles_query=$this->linkpdo->prepare('SELECT * FROM roles WHERE study=:study'); |
|
| 260 | 260 | $roles_query->execute(array('study'=>$this->study)); |
| 261 | 261 | $definedRoles=$roles_query->fetchall(PDO::FETCH_ASSOC); |
| 262 | 262 | |
| 263 | - foreach ($definedRoles as $role){ |
|
| 263 | + foreach ($definedRoles as $role) { |
|
| 264 | 264 | $rolesList[$role['username']][]=$role['name']; |
| 265 | 265 | } |
| 266 | 266 | return $rolesList; |
@@ -270,16 +270,16 @@ discard block |
||
| 270 | 270 | return new Statistics($this, $modality); |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - public function changeStudyActivation(bool $activated){ |
|
| 274 | - $req = $this->linkpdo->prepare('UPDATE studies SET |
|
| 273 | + public function changeStudyActivation(bool $activated) { |
|
| 274 | + $req=$this->linkpdo->prepare('UPDATE studies SET |
|
| 275 | 275 | active = :active |
| 276 | 276 | WHERE name = :study'); |
| 277 | - $req->execute(array( 'study'=> $this->study, 'active'=>intval($activated))); |
|
| 277 | + $req->execute(array('study'=> $this->study, 'active'=>intval($activated))); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | - public function isOriginalOrthancNeverKnown($anonFromOrthancStudyId){ |
|
| 280 | + public function isOriginalOrthancNeverKnown($anonFromOrthancStudyId) { |
|
| 281 | 281 | |
| 282 | - $connecter = $this->linkpdo->prepare('SELECT Study_Orthanc_ID FROM visits |
|
| 282 | + $connecter=$this->linkpdo->prepare('SELECT Study_Orthanc_ID FROM visits |
|
| 283 | 283 | INNER JOIN visit_type ON |
| 284 | 284 | (visit_type.id=visits.visit_type_id |
| 285 | 285 | AND visit_type.group_id IN (SELECT id FROM visit_group WHERE study = :study)) |
@@ -292,15 +292,15 @@ discard block |
||
| 292 | 292 | "study" => $this->study, |
| 293 | 293 | "Anon_From_Orthanc_ID"=>$anonFromOrthancStudyId |
| 294 | 294 | )); |
| 295 | - $result = $connecter->fetchAll(PDO::FETCH_COLUMN); |
|
| 295 | + $result=$connecter->fetchAll(PDO::FETCH_COLUMN); |
|
| 296 | 296 | |
| 297 | - if(count($result)>0) return false; else return true; |
|
| 297 | + if (count($result) > 0) return false; else return true; |
|
| 298 | 298 | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - public static function createStudy(string $studyName, $patientCodePrefix, PDO $linkpdo){ |
|
| 301 | + public static function createStudy(string $studyName, $patientCodePrefix, PDO $linkpdo) { |
|
| 302 | 302 | |
| 303 | - $req = $linkpdo->prepare('INSERT INTO studies (name, patient_code_prefix) VALUES(:studyName, :patientCodePrefix) '); |
|
| 303 | + $req=$linkpdo->prepare('INSERT INTO studies (name, patient_code_prefix) VALUES(:studyName, :patientCodePrefix) '); |
|
| 304 | 304 | |
| 305 | 305 | $req->execute(array( |
| 306 | 306 | 'studyName' => $studyName, |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | |
| 139 | 139 | if(empty($dataStudies)){ |
| 140 | 140 | return false; |
| 141 | - }else{ |
|
| 141 | + } else{ |
|
| 142 | 142 | return true; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -18,129 +18,129 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | Class Study_Details{ |
| 21 | - private $linkpdo; |
|
| 22 | - public $studyUID; |
|
| 23 | - public $idVisit; |
|
| 24 | - public $uploaderUsername; |
|
| 25 | - public $uploadDate; |
|
| 21 | + private $linkpdo; |
|
| 22 | + public $studyUID; |
|
| 23 | + public $idVisit; |
|
| 24 | + public $uploaderUsername; |
|
| 25 | + public $uploadDate; |
|
| 26 | 26 | |
| 27 | - public $studyAcquisitionDate; |
|
| 28 | - public $studyAcquisitionTime; |
|
| 29 | - public $studyAcquisitionDateTime; |
|
| 30 | - public $studyOrthancId; |
|
| 31 | - public $studyDescription; |
|
| 32 | - public $patientOrthancId; |
|
| 33 | - public $patientName; |
|
| 34 | - public $patientId; |
|
| 27 | + public $studyAcquisitionDate; |
|
| 28 | + public $studyAcquisitionTime; |
|
| 29 | + public $studyAcquisitionDateTime; |
|
| 30 | + public $studyOrthancId; |
|
| 31 | + public $studyDescription; |
|
| 32 | + public $patientOrthancId; |
|
| 33 | + public $patientName; |
|
| 34 | + public $patientId; |
|
| 35 | 35 | |
| 36 | - public $nbOfSeries; |
|
| 37 | - public $diskSize; |
|
| 38 | - public $uncompressedDiskSize; |
|
| 39 | - public $deleted; |
|
| 40 | - public $numberOfInstances; |
|
| 36 | + public $nbOfSeries; |
|
| 37 | + public $diskSize; |
|
| 38 | + public $uncompressedDiskSize; |
|
| 39 | + public $deleted; |
|
| 40 | + public $numberOfInstances; |
|
| 41 | 41 | |
| 42 | - public static function getStudyObjectByUID(string $studyUID, PDO $linkpdo){ |
|
| 42 | + public static function getStudyObjectByUID(string $studyUID, PDO $linkpdo){ |
|
| 43 | 43 | |
| 44 | - $studyQuery = $linkpdo->prepare ( 'SELECT study_orthanc_id FROM orthanc_studies |
|
| 44 | + $studyQuery = $linkpdo->prepare ( 'SELECT study_orthanc_id FROM orthanc_studies |
|
| 45 | 45 | WHERE study_uid=:studyUID' ); |
| 46 | 46 | |
| 47 | - $studyQuery->execute(array( |
|
| 48 | - "studyUID" => $studyUID |
|
| 49 | - )); |
|
| 47 | + $studyQuery->execute(array( |
|
| 48 | + "studyUID" => $studyUID |
|
| 49 | + )); |
|
| 50 | 50 | |
| 51 | - $orthancID=$studyQuery->fetch(PDO::FETCH_COLUMN); |
|
| 51 | + $orthancID=$studyQuery->fetch(PDO::FETCH_COLUMN); |
|
| 52 | 52 | |
| 53 | - return new Study_Details($orthancID, $linkpdo); |
|
| 53 | + return new Study_Details($orthancID, $linkpdo); |
|
| 54 | 54 | |
| 55 | - } |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - public function __construct($studyOrthancId, $linkpdo){ |
|
| 58 | - $this->linkpdo=$linkpdo; |
|
| 59 | - $this->studyOrthancId=$studyOrthancId; |
|
| 57 | + public function __construct($studyOrthancId, $linkpdo){ |
|
| 58 | + $this->linkpdo=$linkpdo; |
|
| 59 | + $this->studyOrthancId=$studyOrthancId; |
|
| 60 | 60 | |
| 61 | - $studyQuery = $this->linkpdo->prepare ( 'SELECT * FROM orthanc_studies |
|
| 61 | + $studyQuery = $this->linkpdo->prepare ( 'SELECT * FROM orthanc_studies |
|
| 62 | 62 | WHERE study_orthanc_id=:studyOrthancID' ); |
| 63 | 63 | |
| 64 | - $studyQuery->execute(array( |
|
| 65 | - "studyOrthancID" => $this->studyOrthancId |
|
| 66 | - )); |
|
| 67 | - |
|
| 68 | - $studyData=$studyQuery->fetch(PDO::FETCH_ASSOC); |
|
| 69 | - |
|
| 70 | - $this->studyAcquisitionDate=$studyData['acquisition_date']; |
|
| 71 | - $this->studyAcquisitionTime=$studyData['acquisition_time']; |
|
| 72 | - $this->studyAcquisitionDateTime=$studyData['acquisition_datetime']; |
|
| 73 | - $this->studyUID=$studyData['study_uid']; |
|
| 74 | - $this->studyDescription=$studyData['study_description']; |
|
| 75 | - $this->patientOrthancId=$studyData['patient_orthanc_id']; |
|
| 76 | - $this->patientName=$studyData['patient_name']; |
|
| 77 | - $this->patientId=$studyData['patient_id']; |
|
| 78 | - $this->nbOfSeries=$studyData['number_of_series']; |
|
| 79 | - $this->diskSize=$studyData['disk_size']; |
|
| 80 | - $this->uncompressedDiskSize=$studyData['uncompressed_disk_size']; |
|
| 81 | - $this->numberOfInstances=$studyData['number_of_instances']; |
|
| 82 | - $this->deleted=$studyData['deleted']; |
|
| 83 | - $this->idVisit=$studyData['id_visit']; |
|
| 84 | - |
|
| 85 | - $this->uploaderUsername=$studyData['uploader']; |
|
| 86 | - $this->uploadDate=$studyData['upload_date']; |
|
| 87 | - |
|
| 88 | - } |
|
| 64 | + $studyQuery->execute(array( |
|
| 65 | + "studyOrthancID" => $this->studyOrthancId |
|
| 66 | + )); |
|
| 67 | + |
|
| 68 | + $studyData=$studyQuery->fetch(PDO::FETCH_ASSOC); |
|
| 69 | + |
|
| 70 | + $this->studyAcquisitionDate=$studyData['acquisition_date']; |
|
| 71 | + $this->studyAcquisitionTime=$studyData['acquisition_time']; |
|
| 72 | + $this->studyAcquisitionDateTime=$studyData['acquisition_datetime']; |
|
| 73 | + $this->studyUID=$studyData['study_uid']; |
|
| 74 | + $this->studyDescription=$studyData['study_description']; |
|
| 75 | + $this->patientOrthancId=$studyData['patient_orthanc_id']; |
|
| 76 | + $this->patientName=$studyData['patient_name']; |
|
| 77 | + $this->patientId=$studyData['patient_id']; |
|
| 78 | + $this->nbOfSeries=$studyData['number_of_series']; |
|
| 79 | + $this->diskSize=$studyData['disk_size']; |
|
| 80 | + $this->uncompressedDiskSize=$studyData['uncompressed_disk_size']; |
|
| 81 | + $this->numberOfInstances=$studyData['number_of_instances']; |
|
| 82 | + $this->deleted=$studyData['deleted']; |
|
| 83 | + $this->idVisit=$studyData['id_visit']; |
|
| 84 | + |
|
| 85 | + $this->uploaderUsername=$studyData['uploader']; |
|
| 86 | + $this->uploadDate=$studyData['upload_date']; |
|
| 87 | + |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - public function getChildSeries(){ |
|
| 90 | + public function getChildSeries(){ |
|
| 91 | 91 | |
| 92 | - $idFetcher = $this->linkpdo->prepare("SELECT orthanc_series.series_orthanc_id FROM orthanc_series, orthanc_studies |
|
| 92 | + $idFetcher = $this->linkpdo->prepare("SELECT orthanc_series.series_orthanc_id FROM orthanc_series, orthanc_studies |
|
| 93 | 93 | WHERE orthanc_series.study_orthanc_id=orthanc_studies.study_orthanc_id |
| 94 | 94 | AND orthanc_studies.study_orthanc_id=:studyOrthancID"); |
| 95 | 95 | |
| 96 | - $idFetcher->execute(array( |
|
| 97 | - "studyOrthancID" => $this->studyOrthancId |
|
| 98 | - )); |
|
| 96 | + $idFetcher->execute(array( |
|
| 97 | + "studyOrthancID" => $this->studyOrthancId |
|
| 98 | + )); |
|
| 99 | 99 | |
| 100 | - $orthancSeriesIDs=$idFetcher->fetchAll(PDO::FETCH_COLUMN); |
|
| 100 | + $orthancSeriesIDs=$idFetcher->fetchAll(PDO::FETCH_COLUMN); |
|
| 101 | 101 | |
| 102 | - $childSeriesObject=[]; |
|
| 103 | - foreach ($orthancSeriesIDs as $orthancSerieID){ |
|
| 104 | - $childSeriesObject[]=new Series_Details($orthancSerieID, $this->linkpdo); |
|
| 105 | - } |
|
| 102 | + $childSeriesObject=[]; |
|
| 103 | + foreach ($orthancSeriesIDs as $orthancSerieID){ |
|
| 104 | + $childSeriesObject[]=new Series_Details($orthancSerieID, $this->linkpdo); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - return $childSeriesObject; |
|
| 107 | + return $childSeriesObject; |
|
| 108 | 108 | |
| 109 | - } |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - public function changeDeletionStatus($deleted){ |
|
| 112 | - |
|
| 113 | - //Activate only if no other activated study |
|
| 114 | - if($deleted==false && $this->isExistingActivatedStudyForVisit()==true){ |
|
| 115 | - throw new Exception("already existing activated study"); |
|
| 116 | - return; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - $changeStatusUpload=$this->linkpdo->prepare('UPDATE orthanc_studies SET deleted = :deleted WHERE id_visit = :idvisit AND study_orthanc_id=:studyOrthancID'); |
|
| 120 | - $changeStatusUpload->execute(array('idvisit'=> $this->idVisit, |
|
| 121 | - 'studyOrthancID'=>$this->studyOrthancId, 'deleted'=>intval($deleted) ) ); |
|
| 122 | - |
|
| 123 | - //reactivate all series of this study |
|
| 124 | - $childSeries=$this->getChildSeries(); |
|
| 125 | - foreach ($childSeries as $serie){ |
|
| 126 | - $serie->changeDeletionStatus(false); |
|
| 127 | - } |
|
| 128 | - } |
|
| 111 | + public function changeDeletionStatus($deleted){ |
|
| 112 | + |
|
| 113 | + //Activate only if no other activated study |
|
| 114 | + if($deleted==false && $this->isExistingActivatedStudyForVisit()==true){ |
|
| 115 | + throw new Exception("already existing activated study"); |
|
| 116 | + return; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + $changeStatusUpload=$this->linkpdo->prepare('UPDATE orthanc_studies SET deleted = :deleted WHERE id_visit = :idvisit AND study_orthanc_id=:studyOrthancID'); |
|
| 120 | + $changeStatusUpload->execute(array('idvisit'=> $this->idVisit, |
|
| 121 | + 'studyOrthancID'=>$this->studyOrthancId, 'deleted'=>intval($deleted) ) ); |
|
| 122 | + |
|
| 123 | + //reactivate all series of this study |
|
| 124 | + $childSeries=$this->getChildSeries(); |
|
| 125 | + foreach ($childSeries as $serie){ |
|
| 126 | + $serie->changeDeletionStatus(false); |
|
| 127 | + } |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - private function isExistingActivatedStudyForVisit(){ |
|
| 130 | + private function isExistingActivatedStudyForVisit(){ |
|
| 131 | 131 | |
| 132 | - $studyQuery = $this->linkpdo->prepare('SELECT study_orthanc_id FROM orthanc_studies |
|
| 132 | + $studyQuery = $this->linkpdo->prepare('SELECT study_orthanc_id FROM orthanc_studies |
|
| 133 | 133 | WHERE orthanc_studies.id_visit=:idVisit AND deleted=0; |
| 134 | 134 | '); |
| 135 | - $studyQuery->execute(array('idVisit' => $this->idVisit )); |
|
| 135 | + $studyQuery->execute(array('idVisit' => $this->idVisit )); |
|
| 136 | 136 | |
| 137 | - $dataStudies = $studyQuery->fetchAll(PDO::FETCH_COLUMN); |
|
| 137 | + $dataStudies = $studyQuery->fetchAll(PDO::FETCH_COLUMN); |
|
| 138 | 138 | |
| 139 | - if(empty($dataStudies)){ |
|
| 140 | - return false; |
|
| 141 | - }else{ |
|
| 142 | - return true; |
|
| 143 | - } |
|
| 139 | + if(empty($dataStudies)){ |
|
| 140 | + return false; |
|
| 141 | + }else{ |
|
| 142 | + return true; |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - } |
|
| 145 | + } |
|
| 146 | 146 | } |
| 147 | 147 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * Access data of a dicom study in database |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -Class Study_Details{ |
|
| 20 | +Class Study_Details { |
|
| 21 | 21 | private $linkpdo; |
| 22 | 22 | public $studyUID; |
| 23 | 23 | public $idVisit; |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | public $deleted; |
| 40 | 40 | public $numberOfInstances; |
| 41 | 41 | |
| 42 | - public static function getStudyObjectByUID(string $studyUID, PDO $linkpdo){ |
|
| 42 | + public static function getStudyObjectByUID(string $studyUID, PDO $linkpdo) { |
|
| 43 | 43 | |
| 44 | - $studyQuery = $linkpdo->prepare ( 'SELECT study_orthanc_id FROM orthanc_studies |
|
| 44 | + $studyQuery=$linkpdo->prepare('SELECT study_orthanc_id FROM orthanc_studies |
|
| 45 | 45 | WHERE study_uid=:studyUID' ); |
| 46 | 46 | |
| 47 | 47 | $studyQuery->execute(array( |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function __construct($studyOrthancId, $linkpdo){ |
|
| 57 | + public function __construct($studyOrthancId, $linkpdo) { |
|
| 58 | 58 | $this->linkpdo=$linkpdo; |
| 59 | 59 | $this->studyOrthancId=$studyOrthancId; |
| 60 | 60 | |
| 61 | - $studyQuery = $this->linkpdo->prepare ( 'SELECT * FROM orthanc_studies |
|
| 61 | + $studyQuery=$this->linkpdo->prepare('SELECT * FROM orthanc_studies |
|
| 62 | 62 | WHERE study_orthanc_id=:studyOrthancID' ); |
| 63 | 63 | |
| 64 | 64 | $studyQuery->execute(array( |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public function getChildSeries(){ |
|
| 90 | + public function getChildSeries() { |
|
| 91 | 91 | |
| 92 | - $idFetcher = $this->linkpdo->prepare("SELECT orthanc_series.series_orthanc_id FROM orthanc_series, orthanc_studies |
|
| 92 | + $idFetcher=$this->linkpdo->prepare("SELECT orthanc_series.series_orthanc_id FROM orthanc_series, orthanc_studies |
|
| 93 | 93 | WHERE orthanc_series.study_orthanc_id=orthanc_studies.study_orthanc_id |
| 94 | 94 | AND orthanc_studies.study_orthanc_id=:studyOrthancID"); |
| 95 | 95 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $orthancSeriesIDs=$idFetcher->fetchAll(PDO::FETCH_COLUMN); |
| 101 | 101 | |
| 102 | 102 | $childSeriesObject=[]; |
| 103 | - foreach ($orthancSeriesIDs as $orthancSerieID){ |
|
| 103 | + foreach ($orthancSeriesIDs as $orthancSerieID) { |
|
| 104 | 104 | $childSeriesObject[]=new Series_Details($orthancSerieID, $this->linkpdo); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -108,37 +108,37 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - public function changeDeletionStatus($deleted){ |
|
| 111 | + public function changeDeletionStatus($deleted) { |
|
| 112 | 112 | |
| 113 | 113 | //Activate only if no other activated study |
| 114 | - if($deleted==false && $this->isExistingActivatedStudyForVisit()==true){ |
|
| 114 | + if ($deleted == false && $this->isExistingActivatedStudyForVisit() == true) { |
|
| 115 | 115 | throw new Exception("already existing activated study"); |
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $changeStatusUpload=$this->linkpdo->prepare('UPDATE orthanc_studies SET deleted = :deleted WHERE id_visit = :idvisit AND study_orthanc_id=:studyOrthancID'); |
| 120 | 120 | $changeStatusUpload->execute(array('idvisit'=> $this->idVisit, |
| 121 | - 'studyOrthancID'=>$this->studyOrthancId, 'deleted'=>intval($deleted) ) ); |
|
| 121 | + 'studyOrthancID'=>$this->studyOrthancId, 'deleted'=>intval($deleted))); |
|
| 122 | 122 | |
| 123 | 123 | //reactivate all series of this study |
| 124 | 124 | $childSeries=$this->getChildSeries(); |
| 125 | - foreach ($childSeries as $serie){ |
|
| 125 | + foreach ($childSeries as $serie) { |
|
| 126 | 126 | $serie->changeDeletionStatus(false); |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - private function isExistingActivatedStudyForVisit(){ |
|
| 130 | + private function isExistingActivatedStudyForVisit() { |
|
| 131 | 131 | |
| 132 | - $studyQuery = $this->linkpdo->prepare('SELECT study_orthanc_id FROM orthanc_studies |
|
| 132 | + $studyQuery=$this->linkpdo->prepare('SELECT study_orthanc_id FROM orthanc_studies |
|
| 133 | 133 | WHERE orthanc_studies.id_visit=:idVisit AND deleted=0; |
| 134 | 134 | '); |
| 135 | - $studyQuery->execute(array('idVisit' => $this->idVisit )); |
|
| 135 | + $studyQuery->execute(array('idVisit' => $this->idVisit)); |
|
| 136 | 136 | |
| 137 | - $dataStudies = $studyQuery->fetchAll(PDO::FETCH_COLUMN); |
|
| 137 | + $dataStudies=$studyQuery->fetchAll(PDO::FETCH_COLUMN); |
|
| 138 | 138 | |
| 139 | - if(empty($dataStudies)){ |
|
| 139 | + if (empty($dataStudies)) { |
|
| 140 | 140 | return false; |
| 141 | - }else{ |
|
| 141 | + }else { |
|
| 142 | 142 | return true; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | $visitAccessCheck=$userObject->isVisitAllowed($id_visit, User::REVIEWER); |
| 32 | 32 | |
| 33 | 33 | if($visitAccessCheck) { |
| 34 | - //Instanciate the specific object for review management |
|
| 35 | - $visitObject=new Visit($id_visit, $linkpdo); |
|
| 34 | + //Instanciate the specific object for review management |
|
| 35 | + $visitObject=new Visit($id_visit, $linkpdo); |
|
| 36 | 36 | $ReviewObect=$visitObject->getFromProcessor(false, $username); |
| 37 | 37 | $ReviewObect->saveForm($data, $data['validate'], $linkpdo); |
| 38 | 38 | $answer="Saved"; |
@@ -40,6 +40,6 @@ discard block |
||
| 40 | 40 | echo(json_encode($answer)); |
| 41 | 41 | |
| 42 | 42 | } else{ |
| 43 | - header('HTTP/1.0 403 Forbidden'); |
|
| 43 | + header('HTTP/1.0 403 Forbidden'); |
|
| 44 | 44 | } |
| 45 | 45 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | require_once($_SERVER['DOCUMENT_ROOT'].'/rest/check_login.php'); |
| 22 | 22 | |
| 23 | 23 | // get posted data in a PHP Object |
| 24 | -$data = json_decode(file_get_contents("php://input"), true); |
|
| 24 | +$data=json_decode(file_get_contents("php://input"), true); |
|
| 25 | 25 | |
| 26 | 26 | $type_visit=$data['type_visit']; |
| 27 | 27 | $patient_num=$data['patient_num']; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // Check reviewer's permissions |
| 31 | 31 | $visitAccessCheck=$userObject->isVisitAllowed($id_visit, User::REVIEWER); |
| 32 | 32 | |
| 33 | -if($visitAccessCheck) { |
|
| 33 | +if ($visitAccessCheck) { |
|
| 34 | 34 | //Instanciate the specific object for review management |
| 35 | 35 | $visitObject=new Visit($id_visit, $linkpdo); |
| 36 | 36 | $ReviewObect=$visitObject->getFromProcessor(false, $username); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | header("Content-Type: application/json; charset=UTF-8"); |
| 40 | 40 | echo(json_encode($answer)); |
| 41 | 41 | |
| 42 | -} else{ |
|
| 42 | +}else { |
|
| 43 | 43 | header('HTTP/1.0 403 Forbidden'); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -30,22 +30,22 @@ |
||
| 30 | 30 | |
| 31 | 31 | if($visitAccessCheck){ |
| 32 | 32 | |
| 33 | - $result=[]; |
|
| 33 | + $result=[]; |
|
| 34 | 34 | |
| 35 | - $visitObject=new Visit($id_visit, $linkpdo); |
|
| 36 | - try{ |
|
| 37 | - $reviewObject=$visitObject->queryExistingReviewForReviewer($username); |
|
| 38 | - $result=$reviewObject->getSpecificData(); |
|
| 39 | - echo(json_encode($result)); |
|
| 35 | + $visitObject=new Visit($id_visit, $linkpdo); |
|
| 36 | + try{ |
|
| 37 | + $reviewObject=$visitObject->queryExistingReviewForReviewer($username); |
|
| 38 | + $result=$reviewObject->getSpecificData(); |
|
| 39 | + echo(json_encode($result)); |
|
| 40 | 40 | |
| 41 | - }catch (Exception $e){ |
|
| 42 | - error_log($e->getMessage()); |
|
| 43 | - header('HTTP/1.0 404 Not Found'); |
|
| 44 | - } |
|
| 41 | + }catch (Exception $e){ |
|
| 42 | + error_log($e->getMessage()); |
|
| 43 | + header('HTTP/1.0 404 Not Found'); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | }else{ |
| 48 | - header('HTTP/1.0 403 Forbidden'); |
|
| 49 | - die('You are not allowed to access this file.'); |
|
| 48 | + header('HTTP/1.0 403 Forbidden'); |
|
| 49 | + die('You are not allowed to access this file.'); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | \ No newline at end of file |
@@ -22,29 +22,29 @@ |
||
| 22 | 22 | header("Content-Type: application/json; charset=UTF-8"); |
| 23 | 23 | |
| 24 | 24 | // get posted data in a PHP Object |
| 25 | -$data = json_decode(file_get_contents("php://input"), true); |
|
| 25 | +$data=json_decode(file_get_contents("php://input"), true); |
|
| 26 | 26 | |
| 27 | 27 | $id_visit=$data['id_visit']; |
| 28 | 28 | |
| 29 | 29 | $visitAccessCheck=$userObject->isVisitAllowed($id_visit, User::REVIEWER); |
| 30 | 30 | |
| 31 | -if($visitAccessCheck){ |
|
| 31 | +if ($visitAccessCheck) { |
|
| 32 | 32 | |
| 33 | 33 | $result=[]; |
| 34 | 34 | |
| 35 | 35 | $visitObject=new Visit($id_visit, $linkpdo); |
| 36 | - try{ |
|
| 36 | + try { |
|
| 37 | 37 | $reviewObject=$visitObject->queryExistingReviewForReviewer($username); |
| 38 | 38 | $result=$reviewObject->getSpecificData(); |
| 39 | 39 | echo(json_encode($result)); |
| 40 | 40 | |
| 41 | - }catch (Exception $e){ |
|
| 41 | + }catch (Exception $e) { |
|
| 42 | 42 | error_log($e->getMessage()); |
| 43 | 43 | header('HTTP/1.0 404 Not Found'); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | -}else{ |
|
| 47 | +}else { |
|
| 48 | 48 | header('HTTP/1.0 403 Forbidden'); |
| 49 | 49 | die('You are not allowed to access this file.'); |
| 50 | 50 | |
@@ -38,13 +38,13 @@ |
||
| 38 | 38 | $result=$reviewObject->getSpecificData(); |
| 39 | 39 | echo(json_encode($result)); |
| 40 | 40 | |
| 41 | - }catch (Exception $e){ |
|
| 41 | + } catch (Exception $e){ |
|
| 42 | 42 | error_log($e->getMessage()); |
| 43 | 43 | header('HTTP/1.0 404 Not Found'); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | -}else{ |
|
| 47 | +} else{ |
|
| 48 | 48 | header('HTTP/1.0 403 Forbidden'); |
| 49 | 49 | die('You are not allowed to access this file.'); |
| 50 | 50 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | //Delete temp file at the end of reading |
| 53 | 53 | unlink($tempfile); |
| 54 | 54 | |
| 55 | -}else{ |
|
| 55 | +} else{ |
|
| 56 | 56 | header('HTTP/1.0 403 Forbidden'); |
| 57 | 57 | die('You are not allowed to access this file.'); |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | //If permission granted and visit active and review available and QC done |
| 35 | 35 | if($visitPermissions) { |
| 36 | 36 | |
| 37 | - //Get Array of Orthanc Series ID |
|
| 38 | - $resultatsIDs = $visitObject->getSeriesOrthancID(); |
|
| 39 | - //Generate zip from orthanc and output it to the navigator |
|
| 37 | + //Get Array of Orthanc Series ID |
|
| 38 | + $resultatsIDs = $visitObject->getSeriesOrthancID(); |
|
| 39 | + //Generate zip from orthanc and output it to the navigator |
|
| 40 | 40 | $orthanc=new Orthanc(); |
| 41 | 41 | $tempfile=$orthanc->getZipTempFile($resultatsIDs); |
| 42 | 42 | |
@@ -54,6 +54,6 @@ discard block |
||
| 54 | 54 | unlink($tempfile); |
| 55 | 55 | |
| 56 | 56 | }else{ |
| 57 | - header('HTTP/1.0 403 Forbidden'); |
|
| 58 | - die('You are not allowed to access this file.'); |
|
| 57 | + header('HTTP/1.0 403 Forbidden'); |
|
| 58 | + die('You are not allowed to access this file.'); |
|
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | require_once($_SERVER['DOCUMENT_ROOT'].'/rest/check_login.php'); |
| 22 | 22 | |
| 23 | 23 | // get posted data in a PHP Object |
| 24 | -$data = json_decode(file_get_contents("php://input"), true); |
|
| 24 | +$data=json_decode(file_get_contents("php://input"), true); |
|
| 25 | 25 | |
| 26 | 26 | $id_visit=$data['id_visit']; |
| 27 | 27 | |
@@ -32,17 +32,17 @@ discard block |
||
| 32 | 32 | $visitPermissions=$userObject->isVisitAllowed($id_visit, User::REVIEWER); |
| 33 | 33 | |
| 34 | 34 | //If permission granted and visit active and review available and QC done |
| 35 | -if($visitPermissions) { |
|
| 35 | +if ($visitPermissions) { |
|
| 36 | 36 | |
| 37 | 37 | //Get Array of Orthanc Series ID |
| 38 | - $resultatsIDs = $visitObject->getSeriesOrthancID(); |
|
| 38 | + $resultatsIDs=$visitObject->getSeriesOrthancID(); |
|
| 39 | 39 | //Generate zip from orthanc and output it to the navigator |
| 40 | 40 | $orthanc=new Orthanc(); |
| 41 | 41 | $tempfile=$orthanc->getZipTempFile($resultatsIDs); |
| 42 | 42 | |
| 43 | - $file = @fopen($tempfile,"rb"); |
|
| 44 | - if($file){ |
|
| 45 | - while(!feof($file)) |
|
| 43 | + $file=@fopen($tempfile, "rb"); |
|
| 44 | + if ($file) { |
|
| 45 | + while (!feof($file)) |
|
| 46 | 46 | { |
| 47 | 47 | print(@fread($file, 1024*8)); |
| 48 | 48 | flush(); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | //Delete temp file at the end of reading |
| 54 | 54 | unlink($tempfile); |
| 55 | 55 | |
| 56 | -}else{ |
|
| 56 | +}else { |
|
| 57 | 57 | header('HTTP/1.0 403 Forbidden'); |
| 58 | 58 | die('You are not allowed to access this file.'); |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | require_once($_SERVER['DOCUMENT_ROOT'].'/vendor/autoload.php'); |
| 23 | 23 | |
| 24 | 24 | if (!isset($_SERVER['PHP_AUTH_USER'])) { |
| 25 | - header('WWW-Authenticate: Basic realm="Gaelo"'); |
|
| 26 | - header('HTTP/1.0 401 Unauthorized'); |
|
| 27 | - exit; |
|
| 25 | + header('WWW-Authenticate: Basic realm="Gaelo"'); |
|
| 26 | + header('HTTP/1.0 401 Unauthorized'); |
|
| 27 | + exit; |
|
| 28 | 28 | |
| 29 | 29 | } |
| 30 | 30 | |
@@ -38,21 +38,21 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | if(!$passwordCheck){ |
| 40 | 40 | |
| 41 | - if(!$userObject->isExistingUser){ |
|
| 42 | - header('HTTP/1.1 420 Non existing user'); |
|
| 41 | + if(!$userObject->isExistingUser){ |
|
| 42 | + header('HTTP/1.1 420 Non existing user'); |
|
| 43 | 43 | |
| 44 | - }else if(!$userObject->passwordCorrect && $userObject->userStatus == User::ACTIVATED && $userObject->passwordDateValide){ |
|
| 45 | - header('HTTP/1.1 420 Wrong Password '.$userObject->loginAttempt."/3 wrong attempt"); |
|
| 44 | + }else if(!$userObject->passwordCorrect && $userObject->userStatus == User::ACTIVATED && $userObject->passwordDateValide){ |
|
| 45 | + header('HTTP/1.1 420 Wrong Password '.$userObject->loginAttempt."/3 wrong attempt"); |
|
| 46 | 46 | |
| 47 | - } else if(!$userObject->passwordDateValide){ |
|
| 48 | - header('HTTP/1.1 420 Outdated Password, go to website to renew it'); |
|
| 47 | + } else if(!$userObject->passwordDateValide){ |
|
| 48 | + header('HTTP/1.1 420 Outdated Password, go to website to renew it'); |
|
| 49 | 49 | |
| 50 | - } else if($userObject->userStatus != User::ACTIVATED){ |
|
| 51 | - header('HTTP/1.1 420 Account '.$userObject->userStatus); |
|
| 52 | - } |
|
| 50 | + } else if($userObject->userStatus != User::ACTIVATED){ |
|
| 51 | + header('HTTP/1.1 420 Account '.$userObject->userStatus); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - exit(); |
|
| 54 | + exit(); |
|
| 55 | 55 | |
| 56 | 56 | }else{ |
| 57 | - header("HTTP/1.1 200 OK"); |
|
| 57 | + header("HTTP/1.1 200 OK"); |
|
| 58 | 58 | } |
@@ -36,23 +36,23 @@ |
||
| 36 | 36 | $userObject=new User($username, $linkpdo); |
| 37 | 37 | $passwordCheck=$userObject->isPasswordCorrectAndActivitedAccount($password); |
| 38 | 38 | |
| 39 | -if(!$passwordCheck){ |
|
| 39 | +if (!$passwordCheck) { |
|
| 40 | 40 | |
| 41 | - if(!$userObject->isExistingUser){ |
|
| 41 | + if (!$userObject->isExistingUser) { |
|
| 42 | 42 | header('HTTP/1.1 420 Non existing user'); |
| 43 | 43 | |
| 44 | - }else if(!$userObject->passwordCorrect && $userObject->userStatus == User::ACTIVATED && $userObject->passwordDateValide){ |
|
| 44 | + }else if (!$userObject->passwordCorrect && $userObject->userStatus == User::ACTIVATED && $userObject->passwordDateValide) { |
|
| 45 | 45 | header('HTTP/1.1 420 Wrong Password '.$userObject->loginAttempt."/3 wrong attempt"); |
| 46 | 46 | |
| 47 | - } else if(!$userObject->passwordDateValide){ |
|
| 47 | + }else if (!$userObject->passwordDateValide) { |
|
| 48 | 48 | header('HTTP/1.1 420 Outdated Password, go to website to renew it'); |
| 49 | 49 | |
| 50 | - } else if($userObject->userStatus != User::ACTIVATED){ |
|
| 50 | + }else if ($userObject->userStatus != User::ACTIVATED) { |
|
| 51 | 51 | header('HTTP/1.1 420 Account '.$userObject->userStatus); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | exit(); |
| 55 | 55 | |
| 56 | -}else{ |
|
| 56 | +}else { |
|
| 57 | 57 | header("HTTP/1.1 200 OK"); |
| 58 | 58 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | if(!$userObject->isExistingUser){ |
| 42 | 42 | header('HTTP/1.1 420 Non existing user'); |
| 43 | 43 | |
| 44 | - }else if(!$userObject->passwordCorrect && $userObject->userStatus == User::ACTIVATED && $userObject->passwordDateValide){ |
|
| 44 | + } else if(!$userObject->passwordCorrect && $userObject->userStatus == User::ACTIVATED && $userObject->passwordDateValide){ |
|
| 45 | 45 | header('HTTP/1.1 420 Wrong Password '.$userObject->loginAttempt."/3 wrong attempt"); |
| 46 | 46 | |
| 47 | 47 | } else if(!$userObject->passwordDateValide){ |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | exit(); |
| 55 | 55 | |
| 56 | -}else{ |
|
| 56 | +} else{ |
|
| 57 | 57 | header("HTTP/1.1 200 OK"); |
| 58 | 58 | } |
@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | * @param Patient $patient |
| 19 | 19 | */ |
| 20 | 20 | function build_patient_visit_table(Patient $patient) { |
| 21 | - if ($patient->patientWithdraw) |
|
| 22 | - $patientStatus = "Withdrawn"; |
|
| 23 | - else |
|
| 24 | - $patientStatus = "Included"; |
|
| 21 | + if ($patient->patientWithdraw) |
|
| 22 | + $patientStatus = "Withdrawn"; |
|
| 23 | + else |
|
| 24 | + $patientStatus = "Included"; |
|
| 25 | 25 | |
| 26 | - $patientCenter=$patient->getPatientCenter(); |
|
| 27 | - ?> |
|
| 26 | + $patientCenter=$patient->getPatientCenter(); |
|
| 27 | + ?> |
|
| 28 | 28 | <div style="overflow-x:auto;"> |
| 29 | 29 | <table id='tab_patient' class='table table-striped table-sm table-border'> |
| 30 | 30 | <tr> |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | <td>Quality control</td> |
| 89 | 89 | </tr> |
| 90 | 90 | <?php |
| 91 | - foreach ($visitObjects as $visitObject) { |
|
| 92 | - $numberOfSeries = count($visitObject->getSeriesOrthancID()); |
|
| 91 | + foreach ($visitObjects as $visitObject) { |
|
| 92 | + $numberOfSeries = count($visitObject->getSeriesOrthancID()); |
|
| 93 | 93 | |
| 94 | - if ($numberOfSeries == 0) $numberOfSeries = "Not Uploaded"; |
|
| 95 | - ?> |
|
| 94 | + if ($numberOfSeries == 0) $numberOfSeries = "Not Uploaded"; |
|
| 95 | + ?> |
|
| 96 | 96 | <tr> |
| 97 | 97 | <td><?=$visitObject->visitGroupObject->groupModality?></td> |
| 98 | 98 | <td class="visitLink" data-visitid=<?=$visitObject->id_visit?> ><?=htmlspecialchars($visitObject->visitType)?></td> |
@@ -103,20 +103,20 @@ discard block |
||
| 103 | 103 | <td><?=$numberOfSeries?></td> |
| 104 | 104 | <td><?=$visitObject->acquisitionDate?></td> |
| 105 | 105 | <?php |
| 106 | - if ($role == User::INVESTIGATOR && (in_array($visitObject->stateQualityControl, array(Visit::QC_NOT_DONE, Visit::QC_CORRECTIVE_ACTION_ASKED)) ) ) { |
|
| 107 | - ?> |
|
| 106 | + if ($role == User::INVESTIGATOR && (in_array($visitObject->stateQualityControl, array(Visit::QC_NOT_DONE, Visit::QC_CORRECTIVE_ACTION_ASKED)) ) ) { |
|
| 107 | + ?> |
|
| 108 | 108 | <td> |
| 109 | 109 | <a href=scripts/delete_visit.php?id_visit=<?=$visitObject->id_visit?> class="ajaxLinkConfirm"> |
| 110 | 110 | <img class="icon" src="assets/images/corbeille.png" alt="Delete"> |
| 111 | 111 | </a> |
| 112 | 112 | </td> |
| 113 | 113 | <?php |
| 114 | - } |
|
| 115 | - ?> |
|
| 114 | + } |
|
| 115 | + ?> |
|
| 116 | 116 | </tr> |
| 117 | 117 | <?php |
| 118 | - } |
|
| 119 | - ?> |
|
| 118 | + } |
|
| 119 | + ?> |
|
| 120 | 120 | </table> |
| 121 | 121 | </div> |
| 122 | 122 | <?php |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | function build_patient_visit_table(Patient $patient) { |
| 21 | 21 | if ($patient->patientWithdraw) |
| 22 | - $patientStatus = "Withdrawn"; |
|
| 22 | + $patientStatus="Withdrawn"; |
|
| 23 | 23 | else |
| 24 | - $patientStatus = "Included"; |
|
| 24 | + $patientStatus="Included"; |
|
| 25 | 25 | |
| 26 | 26 | $patientCenter=$patient->getPatientCenter(); |
| 27 | 27 | ?> |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | </tr> |
| 90 | 90 | <?php |
| 91 | 91 | foreach ($visitObjects as $visitObject) { |
| 92 | - $numberOfSeries = count($visitObject->getSeriesOrthancID()); |
|
| 92 | + $numberOfSeries=count($visitObject->getSeriesOrthancID()); |
|
| 93 | 93 | |
| 94 | - if ($numberOfSeries == 0) $numberOfSeries = "Not Uploaded"; |
|
| 94 | + if ($numberOfSeries == 0) $numberOfSeries="Not Uploaded"; |
|
| 95 | 95 | ?> |
| 96 | 96 | <tr> |
| 97 | 97 | <td><?=$visitObject->visitGroupObject->groupModality?></td> |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | <td><?=$numberOfSeries?></td> |
| 104 | 104 | <td><?=$visitObject->acquisitionDate?></td> |
| 105 | 105 | <?php |
| 106 | - if ($role == User::INVESTIGATOR && (in_array($visitObject->stateQualityControl, array(Visit::QC_NOT_DONE, Visit::QC_CORRECTIVE_ACTION_ASKED)) ) ) { |
|
| 106 | + if ($role == User::INVESTIGATOR && (in_array($visitObject->stateQualityControl, array(Visit::QC_NOT_DONE, Visit::QC_CORRECTIVE_ACTION_ASKED)))) { |
|
| 107 | 107 | ?> |
| 108 | 108 | <td> |
| 109 | 109 | <a href=scripts/delete_visit.php?id_visit=<?=$visitObject->id_visit?> class="ajaxLinkConfirm"> |
@@ -18,10 +18,11 @@ discard block |
||
| 18 | 18 | * @param Patient $patient |
| 19 | 19 | */ |
| 20 | 20 | function build_patient_visit_table(Patient $patient) { |
| 21 | - if ($patient->patientWithdraw) |
|
| 22 | - $patientStatus = "Withdrawn"; |
|
| 23 | - else |
|
| 24 | - $patientStatus = "Included"; |
|
| 21 | + if ($patient->patientWithdraw) { |
|
| 22 | + $patientStatus = "Withdrawn"; |
|
| 23 | + } else { |
|
| 24 | + $patientStatus = "Included"; |
|
| 25 | + } |
|
| 25 | 26 | |
| 26 | 27 | $patientCenter=$patient->getPatientCenter(); |
| 27 | 28 | ?> |
@@ -91,7 +92,9 @@ discard block |
||
| 91 | 92 | foreach ($visitObjects as $visitObject) { |
| 92 | 93 | $numberOfSeries = count($visitObject->getSeriesOrthancID()); |
| 93 | 94 | |
| 94 | - if ($numberOfSeries == 0) $numberOfSeries = "Not Uploaded"; |
|
| 95 | + if ($numberOfSeries == 0) { |
|
| 96 | + $numberOfSeries = "Not Uploaded"; |
|
| 97 | + } |
|
| 95 | 98 | ?> |
| 96 | 99 | <tr> |
| 97 | 100 | <td><?=$visitObject->visitGroupObject->groupModality?></td> |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | <div id="header-content"> |
| 18 | 18 | <a href="/main"> |
| 19 | 19 | <img id="logo-gaelo" src="assets/images/gaelo-logo-rectangle.png" alt="GaelO"> |
| 20 | - <div id="name-div"><?php if(defined('GAELO_PLATEFORM_NAME')) echo(htmlspecialchars(GAELO_PLATEFORM_NAME)); else echo('GaelO')?></div> |
|
| 20 | + <div id="name-div"><?php if (defined('GAELO_PLATEFORM_NAME')) echo(htmlspecialchars(GAELO_PLATEFORM_NAME)); else echo('GaelO')?></div> |
|
| 21 | 21 | </a> |
| 22 | 22 | </div> |
| 23 | 23 | </header> |
| 24 | 24 | \ No newline at end of file |
@@ -17,7 +17,9 @@ |
||
| 17 | 17 | <div id="header-content"> |
| 18 | 18 | <a href="/main"> |
| 19 | 19 | <img id="logo-gaelo" src="assets/images/gaelo-logo-rectangle.png" alt="GaelO"> |
| 20 | - <div id="name-div"><?php if(defined('GAELO_PLATEFORM_NAME')) echo(htmlspecialchars(GAELO_PLATEFORM_NAME)); else echo('GaelO')?></div> |
|
| 20 | + <div id="name-div"><?php if(defined('GAELO_PLATEFORM_NAME')) { |
|
| 21 | + echo(htmlspecialchars(GAELO_PLATEFORM_NAME)); |
|
| 22 | +} else echo('GaelO')?></div> |
|
| 21 | 23 | </a> |
| 22 | 24 | </div> |
| 23 | 25 | </header> |
| 24 | 26 | \ No newline at end of file |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | <head> |
| 21 | 21 | <meta charset="utf-8"> |
| 22 | 22 | <title>Change your password</title> |
| 23 | - <?php require $_SERVER['DOCUMENT_ROOT'].'/includes/jsLibrairies.php';?> |
|
| 23 | + <?php require $_SERVER['DOCUMENT_ROOT'].'/includes/jsLibrairies.php'; ?> |
|
| 24 | 24 | |
| 25 | 25 | <script type="text/javascript"> |
| 26 | 26 | //Send form in Ajax and process JSON answers |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | </head> |
| 82 | 82 | |
| 83 | 83 | <body> |
| 84 | -<?php require $_SERVER['DOCUMENT_ROOT'].'/includes/header.php';?> |
|
| 84 | +<?php require $_SERVER['DOCUMENT_ROOT'].'/includes/header.php'; ?> |
|
| 85 | 85 | |
| 86 | 86 | <div class="alert alert-danger text-center" id="error" style="display: none;" ></div> |
| 87 | 87 | <div class="alert alert-success text-center" id="success" style="display: none;" ></div> |