123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- declare (strict_types=1);
- namespace app\admin\servies;
- use app\admin\servies\bi\BiExamServies;
- use app\admin\servies\bi\BiInspectServies;
- use app\admin\servies\bi\BiPatientServies;
- use Exception;
- class DataBiServies
- {
- /**
- * 患者主表模型
- */
- private $biPatientServies;
- /**
- * 检验主表模型
- */
- private $biInspectServies;
- /**
- * 检查主表模型
- */
- private $biExamServies;
- /**
- * 统计数据类型字典
- */
- private $TYPE_DICT = [
- "PATIENT" => 'patient',
- "EXAM" => 'exam',
- "INSPECT" => 'inspect',
- ];
- public function __construct(
- BiPatientServies $biPatientServies,
- BiInspectServies $biInspectServies,
- BiExamServies $biExamServies
- )
- {
- $this->biPatientServies = $biPatientServies;
- $this->biInspectServies = $biInspectServies;
- $this->biExamServies = $biExamServies;
- }
- /**
- * 获取数据概览返回数据
- */
- public function getBiData($params) {
- $type = $params['type'] ?? $this->TYPE_DICT['PATIENT'];
- switch ($type) {
- case $this->TYPE_DICT['PATIENT']:
- return $this->biPatientServies->getBiData($params);
- case $this->TYPE_DICT['EXAM']:
- return $this->biExamServies->getBiData($params);
- case $this->TYPE_DICT['INSPECT']:
- return $this->biInspectServies->getBiData($params);
- }
- throw new Exception("数据统计类型异常");
- }
- }
|