fuyu 5 rokov pred
rodič
commit
a0763d35d5
1 zmenil súbory, kde vykonal 16 pridanie a 18 odobranie
  1. 16 18
      application/inter/controller/Dcquery.php

+ 16 - 18
application/inter/controller/Dcquery.php

@@ -118,15 +118,8 @@ class Dcquery extends Controller
     public function get_studiesinfo(){
         try{
             $study_id = $_REQUEST['study_id'];
-            if($study_id == '71e721a36ceb4bf4' || $study_id== '2c7b65989e965c2a'){
-                if(Cache::get($study_id)){
-                    return Cache::get($study_id);
-                }
-            }
-            if($study_id == '17a34f052869eefd' || $study_id == '35684ea1e75ae4d0' || $study_id == 'ef80a21d3a2db803'){
-                if(Cache::get($study_id)){
-                    return Cache::get($study_id);
-                }
+            if(Cache::get($study_id)){
+                return Cache::get($study_id);
             }
             if(isset($_REQUEST['address']) && !empty($_REQUEST['address'])){
                 $url = $_REQUEST['address'];
@@ -134,11 +127,21 @@ class Dcquery extends Controller
                 $url = '';
             }
             $info = array();
-            if(strlen($study_id) == '16'){
+            $study_id = $_REQUEST['study_id']?? false;
+            $study_uid = $_REQUEST['study_uid']?? false;
+            $acc_num = $_REQUEST['acc_num']?? false;
+            if($study_id && strlen($study_id) == '16') {
                 $study_info = DB::table('studies')->where('id',$study_id)->field('id,studyuid,studyid,patient_id')->find();
-            }else{
-                $study_info = DB::table('studies')->where('studyuid',$study_id)->field('id,studyuid,studyid,patient_id')->find();
+            } else if($study_uid) {
+                $study_info = DB::table('studies')->where('studyuid',$study_uid)->field('id,studyuid,studyid,patient_id')->find();
+            } else if($acc_num) {
+                $study_info = DB::table('studies')->where('accession_num',$acc_num)->field('id,studyuid,studyid,patient_id')->find();
             }
+            // if(strlen($study_id) == '16'){
+            //     $study_info = DB::table('studies')->where('id',$study_id)->field('id,studyuid,studyid,patient_id')->find();
+            // }else{
+            //     $study_info = DB::table('studies')->where('studyuid',$study_id)->field('id,studyuid,studyid,patient_id')->find();
+            // }
             $info['studyInstanceUid'] = $study_info['studyuid'];
             $patient_info = DB::table('patient_infos')->where('id',$study_info['patient_id'])->field('birthday,institution_id,temp_patient_id,name,age,sex')->find();
             $date = DB::table('exams')->where('patient_id',$study_info['patient_id'])->field('exam_datetime')->find();
@@ -212,12 +215,7 @@ class Dcquery extends Controller
             $info['patientId'] = $patient_info['temp_patient_id'];
             $info['institution'] = $institution['name'];
             $return['studies'][] = $info;
-            if($study_id == '71e721a36ceb4bf4' || $study_id== '2c7b65989e965c2a'){
-                Cache::set($study_id,json_encode($return),604800);
-            }
-            if($study_id == '17a34f052869eefd' || $study_id == '35684ea1e75ae4d0' || $study_id == 'ef80a21d3a2db803'){
-                Cache::set($study_id,json_encode($return));
-            }
+            Cache::set($study_id,json_encode($return), 10800);
             return json_encode($return);
         }catch(Exception $e){
             echo $e->getMessage();