123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <?php
- namespace app\index\controller;
- use app\common\controller\Frontend;
- use think\Lang;
- use app\index\service\BiService;
- use think\Response;
- /**
- * Ajax异步请求接口
- * @internal
- */
- class Bi extends Frontend
- {
- protected $noNeedLogin = ['lang'];
- protected $noNeedRight = ['*'];
- protected $layout = '';
- public $institution = '';
- public function __construct()
- {
- $this->institution = '43600001';
- header('Access-Control-Allow-Origin:*');//允许跨域
- if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
- header('Access-Control-Allow-Headers:x-requested-with,content-type,token');//浏览器页面ajax跨域请求会请求2次,第一次会发送OPTIONS预请求,不进行处理,直接exit返回,但因为下次发送真正的请求头部有带token,所以这里设置允许下次请求头带token否者下次请求无法成功
- }
- }
- // 获取医院id
- public function _getInstitutionId()
- {
- return $this->institution;
- }
- // 成功返回封装函数
- public function _success($data)
- {
- return new Response(json_encode([
- "code" => 0,
- "data" => $data
- ]));
- }
- // 当前20条检查数据
- public function getExams(BiService $service)
- {
- return $this->_success($service->getExams($this->_getInstitutionId()));
- }
- // 七天检查数据 弃用 ?
- public function getStudy(BiService $service)
- {
- return $this->_success($service->getStudy($this->_getInstitutionId()));
- }
- // 七天远程诊断数据 弃用 ?
- public function getRemote(BiService $service) {
- return $this->_success($service->getRemote($this->_getInstitutionId()));
- }
- // 七天远程阳性数据 弃用 ?
- public function getPositive(BiService $service) {
- return $this->_success($service->getPositive($this->_getInstitutionId()));
- }
- // 科室检查统计
- public function getModality(BiService $service)
- {
- return $this->_success($service->getModality($this->_getInstitutionId()));
- }
- // 科室检查统计
- public function getModalityToday(BiService $service)
- {
- return $this->_success($service->getModalityToday($this->_getInstitutionId()));
- }
- // 科室检查统计
- public function getDepartment(BiService $service)
- {
- return $this->_success($service->getDepartment($this->_getInstitutionId()));
- }
-
- // 科室检查统计
- public function getDepartmentToday(BiService $service)
- {
- return $this->_success($service->getDepartmentToday($this->_getInstitutionId()));
- }
- // 患者年龄统计
- public function getAge(BiService $service)
- {
- return $this->_success($service->getAge($this->_getInstitutionId()));
- }
- // 患者年龄统计
- // todo
- public function getAgeToday(BiService $service)
- {
- return $this->_success($service->getAgeToday($this->_getInstitutionId()));
- }
- // 主页数据
- public function getMain(BiService $service)
- {
- return $this->_success($service->getMain($this->_getInstitutionId()));
- }
- // 主页数据
- public function getMainToday(BiService $service)
- {
- return $this->_success($service->getMainToday($this->_getInstitutionId()));
- }
-
- // 运营数据
- public function getOperate(BiService $service)
- {
- return $this->_success($service->getOperate($this->_getInstitutionId()));
- }
- // 运营数据
- public function getOperateToday(BiService $service)
- {
- return $this->_success($service->getOperateToday($this->_getInstitutionId()));
- }
- // 检查部位
- public function getArea(BiService $service)
- {
- return $this->_success($service->getArea($this->_getInstitutionId()));
- }
- // 检查部位
- public function getAreaToday(BiService $service)
- {
- return $this->_success($service->getAreaToday($this->_getInstitutionId()));
- }
- // 患者来源
- public function getSource(BiService $service)
- {
- return $this->_success($service->getSource($this->_getInstitutionId()));
- }
- // 患者来源
- public function getSourceToday(BiService $service)
- {
- return $this->_success($service->getSourceToday($this->_getInstitutionId()));
- }
- // 科室人员
- public function getDoctor(BiService $service)
- {
- return $this->_success($service->getDoctor($this->_getInstitutionId()));
- }
- // 科室人员
- public function getDeviceList(BiService $service)
- {
- return $this->_success($service->getDeviceList($this->_getInstitutionId()));
- }
- // 科室人员
- public function getDevice(BiService $service)
- {
- return $this->_success($service->getDevice($this->_getInstitutionId()));
- }
- // 科室人员
- public function getDeviceToday(BiService $service)
- {
- return $this->_success($service->getDeviceToday($this->_getInstitutionId()));
- }
- // 科室人员
- public function getExamProject($device = 'all', BiService $service)
- {
- return $this->_success($service->getExamProject($device, $this->_getInstitutionId()));
- }
-
- // 科室人员
- public function getExamProjectToday($device = 'all',BiService $service)
- {
- return $this->_success($service->getExamProjectToday($device, $this->_getInstitutionId()));
- }
-
- // 设备的检查人次
- // 设备的检查部位人次
- // 检查部位
- // 部位数量
-
- // 导出excel
- public function downExcel(BiService $service)
- {
- return $this->_success($service->downExcel($this->_getInstitutionId()));
- }
- }
|