|
|
@@ -283,8 +283,8 @@ class LinkService extends ZskkDefaultService {
|
|
|
];
|
|
|
$report = $this->linkDao->getReportData(['exam_id'=>$v['id']]);
|
|
|
$info = [];
|
|
|
- $institution = $this->linkDao->getInsData(['id'=>$v['institution_id']],'name');
|
|
|
- switch ($report['report_result'])
|
|
|
+ $institution = $this->linkDao->getInsData(['id'=>$v['institution_id']]);
|
|
|
+ switch ($report['report_result'] ?? '')
|
|
|
{
|
|
|
case '1':
|
|
|
$result = '阴性';
|
|
|
@@ -297,15 +297,15 @@ class LinkService extends ZskkDefaultService {
|
|
|
}
|
|
|
$info['EXAM_REPORT'][] = [
|
|
|
'ACCESSION_NUM'=>$v['accession_num'],
|
|
|
- 'AUDITNAME'=>$report['review_doctor_name'],
|
|
|
+ 'AUDITNAME'=>$report['review_doctor_name'] ?? '',
|
|
|
'BODYSITE'=>$v['body_part'],
|
|
|
'DEPTNAME'=>$v['application_department'],
|
|
|
'DEVICETYPE_CODE'=>$v['exam_class'],
|
|
|
'EXAM_ITEMNAME'=>$v['exam_project'],
|
|
|
- 'OBSERVATIONS_COMMENT'=>$report['description'],
|
|
|
- 'OBSERVATIONS_RESULT'=>$report['impression'],
|
|
|
+ 'OBSERVATIONS_COMMENT'=>$report['description'] ?? '',
|
|
|
+ 'OBSERVATIONS_RESULT'=>$report['impression'] ?? '',
|
|
|
'ORGNAME'=>$institution['name'],
|
|
|
- 'REPORTTIME'=>$report['report_datetime'],
|
|
|
+ 'REPORTTIME'=>$report['report_datetime'] ?? '',
|
|
|
'RESULT_STATUS'=>$result,
|
|
|
'STUDYTIME'=>$v['exam_datetime'],
|
|
|
'STUDY_ID'=>$v['study_id'],
|
|
|
@@ -351,4 +351,146 @@ class LinkService extends ZskkDefaultService {
|
|
|
return [];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public function getPatientList($param)
|
|
|
+ {
|
|
|
+ $param['code'] = openssl_decrypt(base64_decode($param['code']), 'AES-128-ECB', Config::get('chengde')['key']);
|
|
|
+ $param['institution_id'] = openssl_decrypt(base64_decode($param['institution_id']), 'AES-128-ECB', Config::get('chengde')['key']);
|
|
|
+ if(empty($param['institution_id']) || empty($param['code']))
|
|
|
+ {
|
|
|
+ $this->throwError('数据解密失败','1210');
|
|
|
+ }
|
|
|
+ if(empty($param['type']) || empty($param['code']))
|
|
|
+ {
|
|
|
+ $this->throwError('没有相应的类型','1211');
|
|
|
+ }
|
|
|
+ $insIds = explode(',',$param['institution_id']);
|
|
|
+ $type = explode(',',$param['type']);
|
|
|
+ $code = explode(',',$param['code']);
|
|
|
+ $where = [];
|
|
|
+ $institution[] = ['institution_id','in',$insIds];
|
|
|
+ $whereTime = [];
|
|
|
+ if(count($type) == 1&& count($code) !== 1)
|
|
|
+ {
|
|
|
+ //1个type多个code
|
|
|
+ if(!(Config::get('institution_docking')[$type[0]] ?? null))
|
|
|
+ {
|
|
|
+ $this->throwError('没有相应的类型','1211');
|
|
|
+ }
|
|
|
+ $field = Config::get('institution_docking')[$type[0]];
|
|
|
+ if($field == 'name')
|
|
|
+ {
|
|
|
+ $field = 'e.name';
|
|
|
+ }
|
|
|
+ $where[] = [$field,'in',$code];
|
|
|
+ }else{
|
|
|
+ foreach ($type as $k=>$v)
|
|
|
+ {
|
|
|
+ $field = Config::get('institution_docking')[$v];
|
|
|
+ if(empty($field) /*|| empty($code[$k])*/){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if($field == 'name')
|
|
|
+ {
|
|
|
+ $field = 'e.name';
|
|
|
+ }
|
|
|
+ if($field == 'exam_datetime')
|
|
|
+ {
|
|
|
+ $whereTime['exam_datetime'] = $code[$k];
|
|
|
+ }else{
|
|
|
+ if(empty($code[$k]))
|
|
|
+ {
|
|
|
+ if(!empty($code[0]))
|
|
|
+ {
|
|
|
+ $where[$field] = $code[0];
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $where[$field] = $code[$k];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(empty($where) && empty($whereTime))
|
|
|
+ {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ if(($param['check'] ?? null))
|
|
|
+ {
|
|
|
+ switch ($param['check'])
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ $value = 'card_num';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $value = 'phone';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $value = '';
|
|
|
+ $this->throwError('验证错误','1223');
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $data = $this->linkDao->getExamsCheck($where,$institution,$value);
|
|
|
+ if(empty($data))
|
|
|
+ {
|
|
|
+ $this->throwError('验证错误','1223');
|
|
|
+ }
|
|
|
+ $str = substr($data,-4);
|
|
|
+ if($param['checkcode'] !== $str)
|
|
|
+ {
|
|
|
+ $this->throwError('验证码错误','1224');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $info = $this->linkDao->getPatientReportList($where,$institution,$whereTime,[]);
|
|
|
+ foreach ($info as $k=>$v)
|
|
|
+ {
|
|
|
+ $info[$k]['insConfig'] = '';
|
|
|
+ $info[$k]['config_number'] = '';
|
|
|
+ $config = Config::get('hospital_config');
|
|
|
+ foreach ($config as $key=>$value)
|
|
|
+ {
|
|
|
+ if(isset($v[$key]) && !empty($v[$key]))
|
|
|
+ {
|
|
|
+ $info[$k]['insConfig'] = $value;
|
|
|
+ $info[$k]['config_number'] = $v[$key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!empty($v['patient_source']))
|
|
|
+ {
|
|
|
+ $sourceArr = Config::get('patient_source');
|
|
|
+ $sourceInfo = $sourceArr[$v['patient_source']] ?? [];
|
|
|
+ if(!empty($sourceInfo))
|
|
|
+ {
|
|
|
+ $info[$k]['insConfig'] = $sourceInfo['name'];
|
|
|
+ $info[$k]['config_number'] = $v[$sourceInfo['field']];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getPatientInfo($params)
|
|
|
+ {
|
|
|
+ $info = $this->linkDao->getConfirmReportInfo($params['exam_id']);
|
|
|
+ foreach ($info as $k=>$v)
|
|
|
+ {
|
|
|
+ $info[$k]['insConfig'] = '';
|
|
|
+ $info[$k]['config_number'] = '';
|
|
|
+ $config = Config::get('hospital_config');
|
|
|
+ foreach ($config as $key=>$value)
|
|
|
+ {
|
|
|
+ if(isset($v[$key]) && !empty($v[$key]))
|
|
|
+ {
|
|
|
+ $info[$k]['insConfig'] = $value;
|
|
|
+ $info[$k]['config_number'] = $v[$key];
|
|
|
+ }
|
|
|
+ $info[$k]['age'] = str_replace('W','周',str_replace('D','天',str_replace('M','月',str_replace('Y','岁',ltrim($info[$k]['age'],'0')))));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getJm($param)
|
|
|
+ {
|
|
|
+ return base64_encode(openssl_encrypt($param['code'], 'AES-128-ECB', Config::get('chengde')['key']));
|
|
|
+ }
|
|
|
}
|