|
@@ -47,10 +47,10 @@ class Inspectregister extends Base
|
|
$doctor = Cache::get($sessionid);
|
|
$doctor = Cache::get($sessionid);
|
|
$info = array();
|
|
$info = array();
|
|
// 科室
|
|
// 科室
|
|
- $department = DB::table('department')->where('institution_id',$doctor['institution_id'])->cache(300)->field('id','department_name')->select();
|
|
|
|
|
|
+ $department = DB::table('department')->where('institution_id',$doctor['institution_id'])->field('id','department_name')->select();
|
|
$info['department'] = $department;
|
|
$info['department'] = $department;
|
|
// 机构
|
|
// 机构
|
|
- $doctor_department = DB::table('department')->where('id',$doctor['department_id'])->cache(300)->field('id,department_name')->find();
|
|
|
|
|
|
+ $doctor_department = DB::table('department')->where('id',$doctor['department_id'])->field('id,department_name')->find();
|
|
$info['execute_department'] = $doctor_department;
|
|
$info['execute_department'] = $doctor_department;
|
|
log::record('--------返回信息-----------------');
|
|
log::record('--------返回信息-----------------');
|
|
log::record($info);
|
|
log::record($info);
|
|
@@ -93,7 +93,7 @@ class Inspectregister extends Base
|
|
try{
|
|
try{
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
$examid = $_REQUEST['param']['id'];
|
|
$examid = $_REQUEST['param']['id'];
|
|
- $examinfo = DB::table('exams')->where('id',$examid)->field(['id','exam_status','accession_num','exam_class','exam_sub_class','body_part','device','exam_datetime','anamnesis','family_ill','dept_id','charge','exam_project','illness_desc','phys_sign','clin_symp','remark','clin_diag','hopitalized_no','bed_no','patient_id'])->find();
|
|
|
|
|
|
+ $examinfo = DB::table('exams')->where('id',$examid)->field(['id','exam_status','accession_num','exam_class','exam_sub_class','body_part','device','exam_datetime','anamnesis','family_ill','dept_id','charge','exam_project','illness_desc','phys_sign','clin_symp','remark','clin_diag','hopitalized_no','bed_no','patient_id','application_department','application_doctor'])->find();
|
|
$examinfo['family_ill'] = explode(',',$examinfo['family_ill']);
|
|
$examinfo['family_ill'] = explode(',',$examinfo['family_ill']);
|
|
$examinfo['anamnesis'] = explode(',',$examinfo['anamnesis']);
|
|
$examinfo['anamnesis'] = explode(',',$examinfo['anamnesis']);
|
|
$exam_class = DB::table('constant')->where('id',$examinfo['exam_class'])->field('constant_value as name')->cache(300)->find();
|
|
$exam_class = DB::table('constant')->where('id',$examinfo['exam_class'])->field('constant_value as name')->cache(300)->find();
|
|
@@ -288,10 +288,17 @@ class Inspectregister extends Base
|
|
public function department(){
|
|
public function department(){
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
$doctor = Cache::get($sessionid);
|
|
$doctor = Cache::get($sessionid);
|
|
- $department = DB::table('department')->where('is_report',1)->where('institution_id',$doctor['institution_id'])->cache(300)->select();
|
|
|
|
|
|
+ $department = DB::table('department')->where('institution_id',$doctor['institution_id'])->field('id,department_name')->select();
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>$department]);
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>$department]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function doctors()
|
|
|
|
+ {
|
|
|
|
+ $param = $_REQUEST['param'];
|
|
|
|
+ $doctor = DB::table('doctors')->where('department_id',$param['id'])->field('realname')->select();
|
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','info'=>$doctor]);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 预约登记保存
|
|
* 预约登记保存
|
|
*
|
|
*
|
|
@@ -378,11 +385,11 @@ class Inspectregister extends Base
|
|
}
|
|
}
|
|
if(isset($param['exam_id']) && !empty($param['exam_id'])){
|
|
if(isset($param['exam_id']) && !empty($param['exam_id'])){
|
|
$pid = DB::table('exams')->where('id',$param['exam_id'])->field('patient_id,exam_status')->find();
|
|
$pid = DB::table('exams')->where('id',$param['exam_id'])->field('patient_id,exam_status')->find();
|
|
- if($pid['exam_status'] >= 3){
|
|
|
|
|
|
+ /*if($pid['exam_status'] >= 3){
|
|
return json_encode(['status'=>'fail','code'=>'1130','msg'=>'已经检查完毕,不允许在此修改']);
|
|
return json_encode(['status'=>'fail','code'=>'1130','msg'=>'已经检查完毕,不允许在此修改']);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
//存在并且有值 则修改
|
|
//存在并且有值 则修改
|
|
- $patient = DB::table('patient_infos')->where('temp_patient_id',$pid['patient_id'])->update($patient_info);
|
|
|
|
|
|
+ $patient = DB::table('patient_infos')->where('id',$pid['patient_id'])->update($patient_info);
|
|
}else{
|
|
}else{
|
|
$p = DB::table('patient_infos')->where('temp_patient_id',$param['pnum'])->find();
|
|
$p = DB::table('patient_infos')->where('temp_patient_id',$param['pnum'])->find();
|
|
if($p){
|
|
if($p){
|
|
@@ -394,9 +401,7 @@ class Inspectregister extends Base
|
|
$exam_info['patient_id'] = $patient_info['id'];
|
|
$exam_info['patient_id'] = $patient_info['id'];
|
|
}
|
|
}
|
|
//检查信息和申请信息
|
|
//检查信息和申请信息
|
|
- $exam_info['id'] = UUIDs::uuid16();
|
|
|
|
$exam_info['institution_id'] = $doctor['institution_id'];
|
|
$exam_info['institution_id'] = $doctor['institution_id'];
|
|
- $exam_info['exam_status'] = 1; // 登记完成
|
|
|
|
$exam_info['register_datetime'] = date('Y-m-d : H:i:s');
|
|
$exam_info['register_datetime'] = date('Y-m-d : H:i:s');
|
|
$exam_info['phone'] = $doctor['phone'];
|
|
$exam_info['phone'] = $doctor['phone'];
|
|
$exam_info['patient_num'] = isset($param['pnum']) ? $param['pnum'] : '';
|
|
$exam_info['patient_num'] = isset($param['pnum']) ? $param['pnum'] : '';
|
|
@@ -420,9 +425,13 @@ class Inspectregister extends Base
|
|
$exam_info['clin_diag'] = isset($param['clin_diag']) ? $param['clin_diag'] : '';
|
|
$exam_info['clin_diag'] = isset($param['clin_diag']) ? $param['clin_diag'] : '';
|
|
$exam_info['register'] = $doctor['id'];
|
|
$exam_info['register'] = $doctor['id'];
|
|
$exam_info['createdAt'] = date('Y-m-d H:i:s',time());
|
|
$exam_info['createdAt'] = date('Y-m-d H:i:s',time());
|
|
|
|
+ $exam_info['application_department'] = isset($param['application_department']) ? $param['application_department'] : '';
|
|
|
|
+ $exam_info['application_doctor'] = isset($param['application_doctor']) ? $param['application_doctor'] : '';
|
|
if(isset($param['exam_id']) && !empty($param['exam_id'])){
|
|
if(isset($param['exam_id']) && !empty($param['exam_id'])){
|
|
$exam = DB::table('exams')->where('id',$param['exam_id'])->update($exam_info);
|
|
$exam = DB::table('exams')->where('id',$param['exam_id'])->update($exam_info);
|
|
}else{
|
|
}else{
|
|
|
|
+ $exam_info['id'] = UUIDs::uuid16();
|
|
|
|
+ $exam_info['exam_status'] = 1; // 登记完成
|
|
$exam_info['createdAt'] = date('Y-m-d H:i:s',time());
|
|
$exam_info['createdAt'] = date('Y-m-d H:i:s',time());
|
|
$exam = DB::table('exams')->insert($exam_info);
|
|
$exam = DB::table('exams')->insert($exam_info);
|
|
}
|
|
}
|
|
@@ -597,4 +606,5 @@ class Inspectregister extends Base
|
|
$illness = DB::table('constant')->where('parent_id','illness')->cache(300)->field('constant_key,constant_value')->select();
|
|
$illness = DB::table('constant')->where('parent_id','illness')->cache(300)->field('constant_key,constant_value')->select();
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>$illness]);
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>$illness]);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|