|
|
@@ -2354,4 +2354,78 @@ class ButtService extends ZskkDefaultService {
|
|
|
$report['imagenumber'] = $data['B']['BD'];
|
|
|
return $report;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * AES-128-ECB 解密方法
|
|
|
+ * @param string $str 需要解密的 Base64 编码字符串
|
|
|
+ * @return string 解密后的原始数据
|
|
|
+ */
|
|
|
+ public function aesDecrypt($str)
|
|
|
+ {
|
|
|
+ $key = 'ghbfdmlyhxdxlyjl';
|
|
|
+ if($str) {
|
|
|
+ return openssl_decrypt(base64_decode($str), 'AES-128-ECB', $key, OPENSSL_RAW_DATA);
|
|
|
+ }
|
|
|
+ return $str;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * 获取检查报告
|
|
|
+ * @param $param
|
|
|
+ * type:查询类型
|
|
|
+ * code: 加密值
|
|
|
+ * institution_id: 机构id
|
|
|
+ */
|
|
|
+ public function getStudyUrl($param)
|
|
|
+ {
|
|
|
+ $acc = $param['code'];
|
|
|
+ $acc = $this->aesDecrypt($acc);
|
|
|
+ if(empty($acc))
|
|
|
+ {
|
|
|
+ return ['code'=>1,'msg'=>$param['acc'].'密文无法解密,请联系管理员'];
|
|
|
+ }
|
|
|
+ if (empty($param['institution_id'])){
|
|
|
+ return ['code'=>1,'msg'=>'请选择机构'];
|
|
|
+ }
|
|
|
+ if (!in_array($param['type'],['1','2','3','4','5'])){
|
|
|
+ return ['code'=>1,'msg'=>'请选择查询类型'];
|
|
|
+ }
|
|
|
+ $where = [];
|
|
|
+ switch ($param['type']){
|
|
|
+ case '1':
|
|
|
+ //病历号
|
|
|
+ $where['patient_num'] = $acc;
|
|
|
+ break;
|
|
|
+ case '2':
|
|
|
+ //检查号
|
|
|
+ $where['accession_num'] = $acc;
|
|
|
+ break;
|
|
|
+ case '3':
|
|
|
+ //住院号
|
|
|
+ $where['hopitalized_no'] = $acc;
|
|
|
+ break;
|
|
|
+ case '4':
|
|
|
+ //身份证
|
|
|
+ $where['card_num'] = $acc;
|
|
|
+ break;
|
|
|
+ case '5':
|
|
|
+ //手机号
|
|
|
+ $where['phone'] = $acc;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $where['institution_id'] = $param['institution_id'];
|
|
|
+ $study = $this->butt->getExam($where,['study_id']);
|
|
|
+ if(empty($study))
|
|
|
+ {
|
|
|
+ return ['code'=>1,'msg'=>$acc.'的检查未找到'];
|
|
|
+ }
|
|
|
+ if(empty($param['url']))
|
|
|
+ {
|
|
|
+ $domain = 'http://114.118.9.145:9603';
|
|
|
+ }else{
|
|
|
+ $domain = $param['url'];
|
|
|
+ }
|
|
|
+ $study_id = $study['study_id'];
|
|
|
+ $url = "$domain/#/mobile?studyurl=$domain/query/?address=$domain/dcmdown&study_id=$study_id&type=1&node_type=1&version=V1.2.0.0";
|
|
|
+
|
|
|
+ return ['code'=>0,'url'=>$url];
|
|
|
+ }
|
|
|
}
|