|
@@ -27,12 +27,12 @@ class WriteReport extends Base
|
|
|
$institution = DB::table('institution')->where('id',$doctor['institution_id'])->field('name,report_subtitle')->find();
|
|
|
$param = $_REQUEST['param'];
|
|
|
$id = $param['id'];
|
|
|
- $info = DB::table('exam')->where('id',$id)->field(['id','study_id','exam_class','exam_datetime','exam_sub_class','body_part','accession_num','patient_id'])->find();
|
|
|
+ $info = DB::table('exams')->where('id',$id)->field(['id','study_id','exam_class','exam_datetime','exam_sub_class','body_part','accession_num','patient_id'])->find();
|
|
|
$exam_class = DB::table('constant')->where('id',$info['exam_class'])->field('constant_value')->find();
|
|
|
$info['exam_class'] = $exam_class['constant_value'];
|
|
|
$exam_subclass = DB::table('exam_subclass')->where('id',$info['exam_sub_class'])->field('name')->find();
|
|
|
$info['exam_sub_class'] = $exam_subclass['name'];
|
|
|
- $patient_info = DB::table('patient_info')->where('id',$info['patient_id'])->field(['id','temp_patient_id','name','sex','age'])->find();
|
|
|
+ $patient_info = DB::table('patient_infos')->where('id',$info['patient_id'])->field(['id','temp_patient_id','name','sex','age'])->find();
|
|
|
$info['pid'] = $patient_info['temp_patient_id'];
|
|
|
$info['name'] = $patient_info['name'];
|
|
|
$info['sex'] = $patient_info['sex'];
|
|
@@ -98,13 +98,13 @@ class WriteReport extends Base
|
|
|
$id = $this->uuids->uuid16();
|
|
|
//初步报告生成
|
|
|
$film_type = isset($param['film_type']) ? $param['film_type'] : '';
|
|
|
- DB::table('exam')->where('id',$param['id'])->update(['exam_status'=>7,'film_type'=>$film_type]);
|
|
|
+ DB::table('exams')->where('id',$param['id'])->update(['exam_status'=>7,'film_type'=>$film_type]);
|
|
|
$patient_info = array();
|
|
|
$patient_info['id'] = isset($param['pid']) ? $param['pid'] : '';
|
|
|
$patient_info['name'] = isset($param['name']) ? $param['name'] : '';
|
|
|
$patient_info['age'] = isset($param['age']) ? $param['age'] : '';
|
|
|
$patient_info['sex'] = isset($param['sex']) ? $param['sex'] : '';
|
|
|
- $patient = DB::table('patient_info')->where('id',$param['pid'])->update($patient_info);
|
|
|
+ $patient = DB::table('patient_infos')->where('id',$param['pid'])->update($patient_info);
|
|
|
$info = array();
|
|
|
$info['exam_id'] = $param['id'];
|
|
|
$info['impression'] = isset($param['impression']) ? $param['impression'] : '';
|
|
@@ -199,13 +199,13 @@ class WriteReport extends Base
|
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
|
$doctor = Cache::get($sessionid);
|
|
|
$id = $_REQUEST['id'];
|
|
|
- $status = DB::table('exam')->where('id',$id)->field('exam_status')->find();
|
|
|
+ $status = DB::table('exams')->where('id',$id)->field('exam_status')->find();
|
|
|
if($status['exam_status'] < 8 ){
|
|
|
return json_encode(['status'=>'fail','code'=>'1033','msg'=>'只能确认通过审核的报告']);
|
|
|
}elseif($status['exam_status'] == 9){
|
|
|
return json_encode(['status'=>'fail','code'=>'1034','msg'=>'已经确认过该报告,不可再次确认']);
|
|
|
}
|
|
|
- DB::table('exam')->where('id',$id)->update(['exam_status'=>9]);
|
|
|
+ DB::table('exams')->where('id',$id)->update(['exam_status'=>9]);
|
|
|
DB::table('report')->where('exam_id',$id)->update(['confirm_doctor_id'=>$doctor['id'],'confirm_datetime'=>date('Y-m-d H:i:s')]);
|
|
|
// 添加 确认log日志
|
|
|
$info = array();
|
|
@@ -226,7 +226,7 @@ class WriteReport extends Base
|
|
|
public function examine(){
|
|
|
try{
|
|
|
$id = $_REQUEST['id'];
|
|
|
- $status = DB::table('exam')->where('id',$id)->field('exam_status')->find();
|
|
|
+ $status = DB::table('exams')->where('id',$id)->field('exam_status')->find();
|
|
|
if($status['exam_status'] < 7){
|
|
|
return json_encode(['status'=>'fail','code'=>'1032','msg'=>'只能审核已提交的报告']);
|
|
|
}elseif($status['exam_status']>7){
|
|
@@ -259,7 +259,7 @@ class WriteReport extends Base
|
|
|
$info['description'] = isset($param['description']) ? $param['description'] : '';
|
|
|
$info['report_id'] = $report['id'];
|
|
|
DB::table('report_record')->insert($info);
|
|
|
- DB::table('exam')->where('id',$id)->update(['exam_status'=>8]);
|
|
|
+ DB::table('exams')->where('id',$id)->update(['exam_status'=>8]);
|
|
|
return json_encode(['status'=>'ok','code'=>'0000','msg'=>'已审核']);
|
|
|
}catch(\Exception $e){
|
|
|
return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
@@ -345,7 +345,7 @@ class WriteReport extends Base
|
|
|
$id = $_REQUEST['id'];
|
|
|
$info = array();
|
|
|
// 检查日期 住院号 床号
|
|
|
- $exam_info = DB::table('exam')->where('id',$id)->field('id,exam_datetime,exam_class,hopitalized_no,bed_no,exam_project,patient_id')->find();
|
|
|
+ $exam_info = DB::table('exams')->where('id',$id)->field('id,exam_datetime,exam_class,hopitalized_no,bed_no,exam_project,patient_id')->find();
|
|
|
$info['id'] = $exam_info['id'];
|
|
|
if(!empty($exam_info['exam_datetime'])){
|
|
|
$datetime = explode(' ',$exam_info['exam_datetime']);
|
|
@@ -362,7 +362,7 @@ class WriteReport extends Base
|
|
|
$exam_class = DB::table('constant')->where('id',$exam_info['exam_class'])->field('constant_value')->find();
|
|
|
$info['exam_class'] = $exam_class['constant_value'];
|
|
|
// 病历号 姓名 年龄 性别
|
|
|
- $patient_info = DB::table('patient_info')->where('id',$exam_info['patient_id'])->field('temp_patient_id,name,sex,age')->find();
|
|
|
+ $patient_info = DB::table('patient_infos')->where('id',$exam_info['patient_id'])->field('temp_patient_id,name,sex,age')->find();
|
|
|
$remote = DB::table('remote_application')->where('exam_id',$id)->field('req_doctor_id')->find();
|
|
|
$info['pnumber'] = $patient_info['temp_patient_id'];
|
|
|
$info['name'] = $patient_info['name'];
|
|
@@ -402,7 +402,7 @@ class WriteReport extends Base
|
|
|
public function change_film(){
|
|
|
$id = $_REQUEST['id'];
|
|
|
$film = $_REQUEST['film_type'];
|
|
|
- DB::table('exam')->where('id',$id)->update(['film_type'=>$film]);
|
|
|
+ DB::table('exams')->where('id',$id)->update(['film_type'=>$film]);
|
|
|
return json_encode(['status'=>'ok','code'=>'0000']);
|
|
|
}
|
|
|
}
|