Ver código fonte

获取报告接口

chw 3 dias atrás
pai
commit
8673e59c92

+ 10 - 0
server/application/api/controller/link/LinkController.php

@@ -79,6 +79,16 @@ class LinkController extends ZskkDefaultController
         return $this->success($list);
     }
 
+    /*
+     * 唐山获取报告
+     */
+    public function reportListOuter(LinkService $linkService)
+    {
+        $param = Request::param();
+        $list = $linkService->getNewPatientList($param);
+        return $this->success($list);
+    }
+
     public function getAnotherPatientList(LinkService $linkService)
     {
         $param = Request::param();

+ 88 - 0
server/application/api/servies/link/LinkService.php

@@ -480,6 +480,94 @@ class LinkService extends ZskkDefaultService {
         return $info;
     }
 
+    /*
+     * 唐山获取 报告对接
+     * $param type code
+     * type 查询类型、code 参数
+     */
+    public function getNewPatientList($param)
+    {
+        $param['code'] = openssl_decrypt(base64_decode($param['code']), 'AES-128-ECB', 'ghbfdmlyhxdxlyjl');
+
+        if(empty($param['code']))
+        {
+            $this->throwError('数据解密失败','1210');
+        }
+        if(empty($param['type']) || !in_array($param['type'],[1,2,3,4,5,6,7,8,9]))
+        {
+            $this->throwError('没有相应的类型','1211');
+        }
+
+        $code = $param['code'];
+        $where = $institution = $whereTime =  [];
+
+        switch ($param['type']){
+            case '1':
+                //病历号
+                $where['patient_num'] = $code;
+                break;
+            case '2':
+                //检查号
+                $where['accession_num'] = $code;
+                break;
+            case '3':
+                //住院号
+                $where['hopitalized_no'] = $code;
+                break;
+            case '4':
+                //身份证
+                $where['card_num'] = $code;
+                break;
+            case '5':
+                //手机号
+                $where['phone'] = $code;
+                break;
+            case '6':
+                //姓名
+                $where['name'] = $code;
+                break;
+            case '7':
+                //门诊号
+                $where['out_patient'] = $code;
+                break;
+            case '8':
+                //医院HIS病人ID
+                $where['his_patient_id'] = $code;
+                break;
+            case '9':
+                //检查时间
+                $where['exam_datetime'] = $code;
+                break;
+        }
+        if(empty($where)) {return [];}
+
+        $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 getAnotherPatientList($param)
     {

+ 2 - 0
server/route/route.php

@@ -43,6 +43,7 @@ Route::get('makeYdUrl', 'app\api\controller\butt\ButtController/makeYdUrl');
 Route::get('sendYqSms', 'app\api\controller\xz\XzController/sendSms');
 Route::get('sendWechatEmail', 'app\api\controller\butt\ButtController/sendWechatEmail');
 Route::get('saveAnalysis', 'app\api\controller\butt\ButtController/saveAnalysis');
+Route::get('getStudyUrl', 'app\api\controller\butt\ButtController/getStudyUrl');
 Route::group('', function () {
     Route::get('getInsNum', 'app\api\controller\butt\ButtController/ins_num');;
     Route::post('getAiNode', 'app\api\controller\butt\ButtController/getAiNode');;
@@ -251,6 +252,7 @@ Route::group('', function () {
     Route::post('getPatientList', 'app\api\controller\link\LinkController/getPatientList');
     Route::post('getAnotherPatientList', 'app\api\controller\link\LinkController/getAnotherPatientList');
     Route::post('getPatientInfo', 'app\api\controller\link\LinkController/getPatientInfo');
+    Route::get('reportListOuter', 'app\api\controller\link\LinkController/reportListOuter');
     Route::get('getJm', 'app\api\controller\link\LinkController/getJm');
 })->header('Access-Control-Allow-Headers','X-Requested-With,Content-Type,zskk-random,zskk_institution,zskk-signature,zskk-timestamp,zskk-token,zskk-version')
     ->allowCrossDomain();