Browse Source

添加查询接口

lgy 2 weeks ago
parent
commit
7b16844083

+ 18 - 0
jcjyhr/app/zskk/controller/Api.php

@@ -324,4 +324,22 @@ class Api extends ApiController
 
 
         var_dump($a[0]);
         var_dump($a[0]);
     }
     }
+
+    public function getInsData(PatientServies $patientServies)
+    {
+        $params = $this->request->get();
+        $whereIns = [];
+        if(!empty($params['orgcode']))
+        {
+            $whereIns['ORGCODE'] = $params['orgcode'];
+        }
+        $where = '';
+        if(!empty($params['time']))
+        {
+            $time = $params['time'];
+            $time = explode(',',$time);
+            $where = "CREATE_TIME BETWEEN '$time[0]' AND '$time[1]'";
+        }
+        $patientServies->getInsData($whereIns,$where);
+    }
 }
 }

+ 11 - 0
jcjyhr/app/zskk/model/Patient.php

@@ -426,4 +426,15 @@ class Patient extends ZskkModel
         $model = new TestInspectionRecognition();
         $model = new TestInspectionRecognition();
         return $model->where('TYPE',$param['type'] ?? 1)->select()->toArray();
         return $model->where('TYPE',$param['type'] ?? 1)->select()->toArray();
     }
     }
+
+    public function getAllData($whereIns,$whereTime)
+    {
+        $exam = new ExamReport();
+        $inspect = new InspectReport();
+        $e1 = $exam->where($whereIns)->where($whereTime)->count();
+        $e2 = $exam->where($whereIns)->where($whereTime)->where("STUDY_ID !=''")->count();
+        $e3 = $exam->where($whereIns)->where($whereTime)->where('OBSERVATIONS_COMMENT is not null')->count();
+        $i1 = $inspect->where($whereIns)->where($whereTime)->count();
+        return ['e1'=>$e1,'e2'=>$e2,'e3'=>$e3,'i1'=>$i1];
+    }
 }
 }

+ 13 - 0
jcjyhr/app/zskk/servies/PatientServies.php

@@ -1613,4 +1613,17 @@ class PatientServies
         return $inspect;
         return $inspect;
     }
     }
 
 
+    public function getInsData($whereIns, $whereTime)
+    {
+        $data = $this->patientModel->getAllData($whereIns,$whereTime);
+        echo "检查总数".$data['e1'];
+        echo "<br>";
+        echo "匹配影像数量".$data['e2'];
+        echo "<br>";
+        echo "报告数量".$data['e3'];
+        echo "<br>";
+        echo "检验总数".$data['i1'];
+        echo "<br>";
+
+    }
 }
 }