|
@@ -207,6 +207,17 @@ class LinkService extends ZskkDefaultService {
|
|
|
public function getMiddleProjectList()
|
|
public function getMiddleProjectList()
|
|
|
{
|
|
{
|
|
|
$list = $this->linkDao->getMiddleProjectList();
|
|
$list = $this->linkDao->getMiddleProjectList();
|
|
|
|
|
+ foreach ($list as $k=>$v)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(!empty($v['name']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $name = $v['name'];
|
|
|
|
|
+ $nameLen = mb_strlen($name, 'UTF-8');
|
|
|
|
|
+ if ($nameLen > 1) {
|
|
|
|
|
+ $list[$k]['name'] = mb_substr($name, 0, 1, 'UTF-8') . str_repeat('*', $nameLen - 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return $list;
|
|
return $list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -355,8 +366,8 @@ class LinkService extends ZskkDefaultService {
|
|
|
public function getPatientList($param)
|
|
public function getPatientList($param)
|
|
|
{
|
|
{
|
|
|
$param['code'] = openssl_decrypt(base64_decode($param['code']), 'AES-128-ECB', Config::get('chengde')['key']);
|
|
$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']))
|
|
|
|
|
|
|
+// $param['institution_id'] = openssl_decrypt(base64_decode($param['institution_id']), 'AES-128-ECB', Config::get('chengde')['key']);
|
|
|
|
|
+ if(empty($param['code']))
|
|
|
{
|
|
{
|
|
|
$this->throwError('数据解密失败','1210');
|
|
$this->throwError('数据解密失败','1210');
|
|
|
}
|
|
}
|
|
@@ -364,11 +375,12 @@ class LinkService extends ZskkDefaultService {
|
|
|
{
|
|
{
|
|
|
$this->throwError('没有相应的类型','1211');
|
|
$this->throwError('没有相应的类型','1211');
|
|
|
}
|
|
}
|
|
|
- $insIds = explode(',',$param['institution_id']);
|
|
|
|
|
|
|
+// $insIds = explode(',',$param['institution_id']);
|
|
|
$type = explode(',',$param['type']);
|
|
$type = explode(',',$param['type']);
|
|
|
$code = explode(',',$param['code']);
|
|
$code = explode(',',$param['code']);
|
|
|
$where = [];
|
|
$where = [];
|
|
|
- $institution[] = ['institution_id','in',$insIds];
|
|
|
|
|
|
|
+ $institution = [];
|
|
|
|
|
+// $institution[] = ['institution_id','in',$insIds];
|
|
|
$whereTime = [];
|
|
$whereTime = [];
|
|
|
if(count($type) == 1&& count($code) !== 1)
|
|
if(count($type) == 1&& count($code) !== 1)
|
|
|
{
|
|
{
|
|
@@ -468,6 +480,136 @@ class LinkService extends ZskkDefaultService {
|
|
|
return $info;
|
|
return $info;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public function getAnotherPatientList($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['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[] = ['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');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $must_where = [];
|
|
|
|
|
+ if(isset($param['must']) && !empty($param['must']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $must = $param['must'];
|
|
|
|
|
+ $must_type = Config::get('institution_docking')[$must['key']];
|
|
|
|
|
+ if($must_type == 'name')
|
|
|
|
|
+ {
|
|
|
|
|
+ $must_type = 'e.name';
|
|
|
|
|
+ }
|
|
|
|
|
+ $must_code = $must['value'];
|
|
|
|
|
+ $must_where = [$must_type=>$must_code];
|
|
|
|
|
+ }
|
|
|
|
|
+ $info = $this->linkDao->getPatientReportList($where,$institution,$whereTime,$must_where);
|
|
|
|
|
+ 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)
|
|
public function getPatientInfo($params)
|
|
|
{
|
|
{
|
|
|
$info = $this->linkDao->getConfirmReportInfo($params['exam_id']);
|
|
$info = $this->linkDao->getConfirmReportInfo($params['exam_id']);
|