|
@@ -72,10 +72,24 @@ class Dcquery extends Controller
|
|
|
}
|
|
|
public function get_studyinfo(){
|
|
|
$study_id = $_REQUEST['study_id'];
|
|
|
- $study_info = DB::table('studies')->where('id',$study_id)->find();
|
|
|
- $patient_info = DB::table('patient_infos')->where('id',$study_info['patient_id'])->find();
|
|
|
- $study_info['patient_info'] = $patient_info;
|
|
|
- return $study_info;
|
|
|
+ $info = array();
|
|
|
+ $study_info = DB::table('studies')->where('id',$study_id)->field('studyuid,patient_id')->find();
|
|
|
+ $info['transactionId'] = $study_info['studyuid'];
|
|
|
+ $patient_info = DB::table('patient_infos')->where('id',$study_info['patient_id'])->field('name')->find();
|
|
|
+ $info['patientName'] = $patient_info['name'];
|
|
|
+ $series_list = DB::table('series')->where('study_id',$study_id)->field('id,seriesuid,description')->select();
|
|
|
+ $series = array();
|
|
|
+ foreach($series_list as $k=>$v){
|
|
|
+ $image = DB::table('images')->where('series_id',$v['id'])->field('columns,image_number as instanceNumber,rows,image_id as sopInstanceUid,url')->select();
|
|
|
+ foreach($image as $key=>$value){
|
|
|
+ $image[$key]['url'] = 'http://dcm.pacsonline.cn/'.$value['url'];
|
|
|
+ }
|
|
|
+ $series[$k]['instances'] = $image;
|
|
|
+ $series[$k]['seriesInstanceUid'] = $v['seriesuid'];
|
|
|
+ $series[$k]['seriesDescription'] = $v['description'];
|
|
|
+ }
|
|
|
+ $info['seriesList'] = $series;
|
|
|
+ return json_encode($info);
|
|
|
}
|
|
|
|
|
|
}
|