|
@@ -59,13 +59,13 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
{
|
|
|
// 获取数据
|
|
|
$field = [
|
|
|
- 'e.patient_num','e.exam_class', 'e.exam_datetime', 'e.exam_status','re.body_part',"CONCAT(study_id,'&node_type=',node_type) as study_id",'e.node_type','e.institution_id',
|
|
|
+ 'e.patient_num','e.exam_class', 'e.exam_datetime', 'e.exam_status','re.body_part',"CONCAT(study_id,'&node_type=',node_type) AS study_id",'e.node_type','e.institution_id',
|
|
|
'e.name', 'e.sex', 'e.age', 'e.phone','e.exam_project','e.hopitalized_no','e.accession_num','e.write_report',
|
|
|
- 'r.id as report_id, r.impression', 'r.description', 'r.report_result', 'r.report_doctor_id','r.report_doctor_name', 'r.report_datetime', 'r.review_doctor_id','r.review_doctor_name', 'r.review_datetime', 'r.confirm_doctor_id','r.confirm_doctor_name', 'r.confirm_datetime', 'r.report_result','r.remote_application_id','r.qr_code',
|
|
|
+ 'r.id AS report_id, r.impression', 'r.description', 'r.report_result', 'r.report_doctor_id','r.report_doctor_name', 'r.report_datetime', 'r.review_doctor_id','r.review_doctor_name', 'r.review_datetime', 'r.confirm_doctor_id','r.confirm_doctor_name', 'r.confirm_datetime', 'r.report_result','r.remote_application_id','r.qr_code',
|
|
|
're.exam_sub_class','hr_status',
|
|
|
- 'dp.is_use_autograph as report_use_autograph','dp.autograph as report_autograph','dp.autograph_type as report_autograph_type',
|
|
|
- 'dv.is_use_autograph as review_use_autograph','dv.autograph as review_autograph','dv.autograph_type as review_autograph_type',
|
|
|
- 'dc.is_use_autograph as confirm_use_autograph','dc.autograph as confirm_autograph','dc.autograph_type as confirm_autograph_type',
|
|
|
+ 'dp.is_use_autograph AS report_use_autograph','dp.autograph AS report_autograph','dp.autograph_type AS report_autograph_type',
|
|
|
+ 'dv.is_use_autograph AS review_use_autograph','dv.autograph AS review_autograph','dv.autograph_type AS review_autograph_type',
|
|
|
+ 'dc.is_use_autograph AS confirm_use_autograph','dc.autograph AS confirm_autograph','dc.autograph_type AS confirm_autograph_type',
|
|
|
];
|
|
|
$detail =ExamModel::alias('e')
|
|
|
->join(['register'=>'re'],'re.exam_id=e.id','LEFT')
|
|
@@ -86,11 +86,11 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
$field = [
|
|
|
'e.patient_num','e.exam_class', 'e.exam_datetime','e.body_part','e.study_id','e.hopitalized_no',
|
|
|
'e.name', 'e.sex', 'e.age', 'e.phone','e.report_status','e.local_institution_name','e.req_doctor_name','e.remote_department',
|
|
|
- 'r.id as report_id, r.impression', 'r.description', 'r.report_result', 'r.report_doctor_id','r.report_doctor_name', 'r.report_datetime', 'r.review_doctor_id','r.review_doctor_name', 'r.review_datetime', 'r.confirm_doctor_id','r.confirm_doctor_name', 'r.confirm_datetime', 'r.report_result','r.remote_application_id','r.qr_code',
|
|
|
+ 'r.id AS report_id, r.impression', 'r.description', 'r.report_result', 'r.report_doctor_id','r.report_doctor_name', 'r.report_datetime', 'r.review_doctor_id','r.review_doctor_name', 'r.review_datetime', 'r.confirm_doctor_id','r.confirm_doctor_name', 'r.confirm_datetime', 'r.report_result','r.remote_application_id','r.qr_code',
|
|
|
'e.exam_project','e.accession_num',
|
|
|
- 'dp.is_use_autograph as report_use_autograph','dp.autograph as report_autograph','dp.autograph_type as report_autograph_type',
|
|
|
- 'dv.is_use_autograph as review_use_autograph','dv.autograph as review_autograph','dv.autograph_type as review_autograph_type',
|
|
|
- 'dc.is_use_autograph as confirm_use_autograph','dc.autograph as confirm_autograph','dc.autograph_type as confirm_autograph_type','e.local_institution_id as institution_id'
|
|
|
+ 'dp.is_use_autograph AS report_use_autograph','dp.autograph AS report_autograph','dp.autograph_type AS report_autograph_type',
|
|
|
+ 'dv.is_use_autograph AS review_use_autograph','dv.autograph AS review_autograph','dv.autograph_type AS review_autograph_type',
|
|
|
+ 'dc.is_use_autograph AS confirm_use_autograph','dc.autograph AS confirm_autograph','dc.autograph_type AS confirm_autograph_type','e.local_institution_id AS institution_id'
|
|
|
];
|
|
|
$detail = RemoteModel::alias('e')
|
|
|
->join(['report' => 'r'],"r.remote_application_id =e.id",'LEFT')
|
|
@@ -144,7 +144,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
$data = RecordModel::alias('r')
|
|
|
->join(['doctors'=>'d'], 'r.doctor_id = d.id')
|
|
|
->where('r.report_id', $reportId)
|
|
|
- ->field('r.impression, r.description, r.report_result, r.createdAt as handle_time, d.realname, r.type')
|
|
|
+ ->field('r.impression, r.description, r.report_result, r.createdAt AS handle_time, d.realname, r.type')
|
|
|
->order('r.createdat')
|
|
|
->select();
|
|
|
return $data;
|
|
@@ -301,8 +301,8 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
//远程
|
|
|
$field = [
|
|
|
'e.accession_num', 'e.exam_project', 'e.exam_class', 'e.patient_num', 'e.exam_datetime','e.hopitalized_no',
|
|
|
- 'e.name', 'e.sex', 'e.age', 'e.phone','e.exam_sub_class',"'' as patient_area","'' as out_patient",
|
|
|
- 'e.remote_institution_name as institution_name',
|
|
|
+ 'e.name', 'e.sex', 'e.age', 'e.phone','e.exam_sub_class',"'' AS patient_area","'' AS out_patient",
|
|
|
+ 'e.remote_institution_name AS institution_name',
|
|
|
'r.impression', 'r.description', 'r.report_doctor_id','r.report_doctor_name', 'r.report_datetime', 'r.review_doctor_id','r.review_doctor_name', 'r.review_datetime','r.qr_code','r.confirm_doctor_name'
|
|
|
];
|
|
|
$detail = PublicApplicationModel::alias('e')
|
|
@@ -316,7 +316,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
're.clin_doctors_name','re.register_name','re.technician_name','e.application_department',
|
|
|
'e.accession_num', 'e.exam_project', 'e.exam_class', 'e.patient_num', 'e.hopitalized_no', 'e.bed_no', 'e.exam_datetime','e.institution_id',
|
|
|
'e.name', 'e.sex', 'e.age', 'e.phone','e.exam_sub_class','e.patient_area',"e.out_patient",
|
|
|
- 'i.name as institution_name','e.body_part','i.review_print','i.hr_info','r.hr_status',
|
|
|
+ 'i.name AS institution_name','e.body_part','i.review_print','i.hr_info','r.hr_status',
|
|
|
'r.impression', 'r.description', 'r.report_doctor_id','r.report_doctor_name', 'r.report_datetime', 'r.review_doctor_id','r.review_doctor_name', 'r.review_datetime','r.qr_code','r.confirm_doctor_name'
|
|
|
];
|
|
|
$detail =$this->alias('r')
|
|
@@ -459,7 +459,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
->where('institution_id',$institutionId)
|
|
|
->where($timeWhere)
|
|
|
->where('exam_status',9)
|
|
|
- ->field('e.*,r.id as report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt as report_create,r.updatedAt as report_update')
|
|
|
+ ->field('e.*,r.id AS report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt AS report_create,r.updatedAt AS report_update')
|
|
|
->order('e.createdAt desc')
|
|
|
->page($page,$num)
|
|
|
->select();
|
|
@@ -771,24 +771,24 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
public function getWorkList()
|
|
|
{
|
|
|
$field = [
|
|
|
- 'accession_num as AccessionNumber',
|
|
|
- "e.birthday as DateOfBirth", //生日
|
|
|
- "e.patient_num as PatientID", //患者ID
|
|
|
- "e.name as Surname", //姓
|
|
|
- "'' as Forename", //名
|
|
|
- "'' as Title", //Title
|
|
|
- "e.sex as Sex", //患者性别
|
|
|
- "e.exam_class as Modality", //检查类型
|
|
|
- "'' as ExamDescription", //检查描述
|
|
|
- "'' as ExamRoom", //检查科室
|
|
|
- "i.name as HospitalName", //医院名称
|
|
|
- "'' as PerformingPhysician", //执行医生
|
|
|
- "'' as ProcedureID", //过程ID
|
|
|
- "'' as ProcedureStepID", //过程ID2
|
|
|
- "e.studyuid as StudyUID", //StudyUid
|
|
|
- "'' as ScheduledAET", // AETiTLE
|
|
|
- "'' as ReferringPhysician", //指派医生
|
|
|
- 'e.exam_datetime as ExamDateAndTime',
|
|
|
+ 'accession_num AS AccessionNumber',
|
|
|
+ "e.birthday AS DateOfBirth", //生日
|
|
|
+ "e.patient_num AS PatientID", //患者ID
|
|
|
+ "e.name AS Surname", //姓
|
|
|
+ "'' AS Forename", //名
|
|
|
+ "'' AS Title", //Title
|
|
|
+ "e.sex AS Sex", //患者性别
|
|
|
+ "e.exam_class AS Modality", //检查类型
|
|
|
+ "'' AS ExamDescription", //检查描述
|
|
|
+ "'' AS ExamRoom", //检查科室
|
|
|
+ "i.name AS HospitalName", //医院名称
|
|
|
+ "'' AS PerformingPhysician", //执行医生
|
|
|
+ "'' AS ProcedureID", //过程ID
|
|
|
+ "'' AS ProcedureStepID", //过程ID2
|
|
|
+ "e.studyuid AS StudyUID", //StudyUid
|
|
|
+ "'' AS ScheduledAET", // AETiTLE
|
|
|
+ "'' AS ReferringPhysician", //指派医生
|
|
|
+ 'e.exam_datetime AS ExamDateAndTime',
|
|
|
];
|
|
|
$info = ExamModel::alias('e')
|
|
|
->join(['institution'=>'i'],'i.id=e.institution_id')
|
|
@@ -861,7 +861,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
|
|
|
public function getRisVersion()
|
|
|
{
|
|
|
- $info = VersionModel::field("MAX(versionTime) as time,project")->group('project')->select()->toArray();
|
|
|
+ $info = VersionModel::field("MAX(versionTime) AS time,project")->group('project')->select()->toArray();
|
|
|
return $info;
|
|
|
}
|
|
|
|
|
@@ -1119,12 +1119,12 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
public function getDmReport($date1, $date2)
|
|
|
{
|
|
|
$field = [
|
|
|
- 'e.ID','r.id as REPORT_ID','patient_source as PAT_FROM_TYPE','patient_num as PAT_NUM','exam_project as TESTLIST',
|
|
|
- 'e.NAME','SEX','BIRTHDAY',"'' as ADDRESS",'phone as TEL','institution_id as ORG_CODE',
|
|
|
- 'e.application_department as DEP_NAME',"'' as DEP_CODE",'application_doctor as DUTY_DOCTOR_NAME',"'' as DUTY_DOCTOR_ID",
|
|
|
- "'' as CHIEF_COMPLAINT",'clin_diag as DIAGNOSIS',"'' as STUDY_BODYPART",'exam_class as IMAGE_TYPE_NAME',
|
|
|
- 'description as FINDING','impression as CONCLUSION','confirm_datetime as HAPPEN_TIME','r.createdAt as SYSTEMTIME',
|
|
|
- 'e.institution_id as HOSPITAL_CODE','r.updatedAt as UPDATE_TIME'
|
|
|
+ 'e.ID','r.id AS REPORT_ID','patient_source AS PAT_FROM_TYPE','patient_num AS PAT_NUM','exam_project AS TESTLIST',
|
|
|
+ 'e.NAME','SEX','BIRTHDAY',"'' AS ADDRESS",'phone AS TEL','institution_id AS ORG_CODE',
|
|
|
+ 'e.application_department AS DEP_NAME',"'' AS DEP_CODE",'application_doctor AS DUTY_DOCTOR_NAME',"'' AS DUTY_DOCTOR_ID",
|
|
|
+ "'' AS CHIEF_COMPLAINT",'clin_diag AS DIAGNOSIS',"'' AS STUDY_BODYPART",'exam_class AS IMAGE_TYPE_NAME',
|
|
|
+ 'description AS FINDING','impression AS CONCLUSION','confirm_datetime AS HAPPEN_TIME','r.createdAt AS SYSTEMTIME',
|
|
|
+ 'e.institution_id AS HOSPITAL_CODE','r.updatedAt AS UPDATE_TIME'
|
|
|
];
|
|
|
$data = ExamModel::alias('e')
|
|
|
->join(['report'=>'r'],'r.exam_id=e.id and r.type=1')
|
|
@@ -1144,7 +1144,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
->where('institution_id',$institution)
|
|
|
->whereBetween('r.confirm_datetime',[$date1,$date2])
|
|
|
->where('exam_status',9)
|
|
|
- ->field('e.*,r.id as report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt as report_create,r.updatedAt as report_update')
|
|
|
+ ->field('e.*,r.id AS report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt AS report_create,r.updatedAt AS report_update')
|
|
|
->order('e.createdAt desc')
|
|
|
->page($page,$num)
|
|
|
->select();
|
|
@@ -1161,7 +1161,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
->where('re.local_institution_id',$institution)
|
|
|
->whereBetween('r.confirm_datetime',[$date1,$date2])
|
|
|
->where('re.report_status',9)
|
|
|
- ->field('e.*,r.id as report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt as report_create,r.updatedAt as report_update,re.local_institution_id,re.local_institution_name,re.req_doctor_id,re.req_doctor_name,re.req_date_time,re.remote_institution_id,re.remote_institution_name,re.remote_doctor_id,re.remote_doctor_name')
|
|
|
+ ->field('e.*,r.id AS report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt AS report_create,r.updatedAt AS report_update,re.local_institution_id,re.local_institution_name,re.req_doctor_id,re.req_doctor_name,re.req_date_time,re.remote_institution_id,re.remote_institution_name,re.remote_doctor_id,re.remote_doctor_name')
|
|
|
->order('re.req_date_time desc')
|
|
|
->page($page,$num)
|
|
|
->select();
|
|
@@ -1176,7 +1176,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
->join(['exams'=>'e'],'r.exam_id=e.id')
|
|
|
->where('e.institution_id',$institution)
|
|
|
->whereBetween('r.confirm_datetime',[$date1,$date2])
|
|
|
- ->field('e.*,r.id as report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt as report_create,r.updatedAt as report_update,r.type')
|
|
|
+ ->field('e.*,r.id AS report_id,r.impression,r.description,r.report_datetime,r.report_doctor_name,r.review_doctor_name,r.review_datetime,r.confirm_doctor_name,r.confirm_datetime,r.report_result,r.createdAt AS report_create,r.updatedAt AS report_update,r.type')
|
|
|
->order('r.confirm_datetime desc')
|
|
|
->page($page,$num)
|
|
|
->select();
|
|
@@ -1186,7 +1186,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
->whereBetween('r.confirm_datetime',[$date1,$date2])
|
|
|
->count();
|
|
|
}
|
|
|
- foreach ($info as $k=>$v)
|
|
|
+ foreach ($info AS $k=>$v)
|
|
|
{
|
|
|
$info[$k]['impression'] = strip_tags($v['impression']);
|
|
|
$info[$k]['description'] = strip_tags($v['description']);
|
|
@@ -1216,7 +1216,7 @@ class ReportModel extends ZskkDefaultModel {
|
|
|
{
|
|
|
return [];
|
|
|
}
|
|
|
- $data = PatientbindModel::where('user_id',$wx_id)->order('createdAt desc')->field(['user_id as id','patientName','idCard','phone'])->find();
|
|
|
+ $data = PatientbindModel::where('user_id',$wx_id)->order('createdAt desc')->field(['user_id AS id','patientName','idCard','phone'])->find();
|
|
|
if(empty($data))
|
|
|
{
|
|
|
return ['patient'=>[],'exams'=>[],'wx_id'=>$wx_id];
|