Bi.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <?php
  2. declare (strict_types=1);
  3. namespace app\zskk\controller;
  4. use app\admin\servies\bi\BaseQcBiServies;
  5. use app\common\controller\ZskkApiController;
  6. use app\zskk\model\Medicalinformation;
  7. use app\zskk\servies\BiServies;
  8. use fast\Http;
  9. use think\Config;
  10. use think\exception\HttpResponseException;
  11. use think\facade\Cache;
  12. use think\facade\Db;
  13. use think\Response;
  14. use Throwable;
  15. class Bi extends ZskkApiController
  16. {
  17. public function __construct()
  18. {
  19. set_time_limit(0);
  20. ini_set('memory_limit', '1080M');
  21. }
  22. public function getInstitution()
  23. {
  24. var_dump(2);die;
  25. $count = Db::table('institution')->count();
  26. return '参与互认机构'.$count.'家';
  27. }
  28. //诊断词云
  29. public function getMedicalData(BiServies $biServies): void
  30. {
  31. if(Cache::get(__FUNCTION__))
  32. {
  33. $data = Cache::get(__FUNCTION__);
  34. }else{
  35. $data = $biServies->getMedicalData();
  36. Cache::set(__FUNCTION__,$data);
  37. }
  38. $this->biSuccess($data);
  39. }
  40. //全部机构的上传检验、检查项目数量
  41. public function getAllNum(BiServies $biServies): void
  42. {
  43. if(Cache::get(__FUNCTION__))
  44. {
  45. $data = Cache::get(__FUNCTION__);
  46. }else{
  47. $data = $biServies->getAllNum();
  48. Cache::set(__FUNCTION__,$data);
  49. }
  50. $this->biSuccess($data);
  51. }
  52. //检查项目分类统计
  53. public function getExamData(BiServies $biServies): void
  54. {
  55. if(Cache::get(__FUNCTION__))
  56. {
  57. $data = Cache::get(__FUNCTION__);
  58. }else{
  59. $data = $biServies->getExamData();
  60. Cache::set(__FUNCTION__,$data);
  61. }
  62. $this->biSuccess($data);
  63. }
  64. //重复检查的患者比率
  65. public function getRepeatExam(BiServies $biServies): void
  66. {
  67. if(Cache::get(__FUNCTION__))
  68. {
  69. $data = Cache::get(__FUNCTION__);
  70. }else{
  71. $data = $biServies->getRepeatExam();
  72. Cache::set(__FUNCTION__,$data);
  73. }
  74. // $data = ['percent'=>'41'];
  75. $this->biSuccess($data);
  76. }
  77. //重复检验的患者比率
  78. public function getRepeatInspect(BiServies $biServies): void
  79. {
  80. if(Cache::get(__FUNCTION__))
  81. {
  82. $data = Cache::get(__FUNCTION__);
  83. }else{
  84. $data = $biServies->getRepeatInspect();
  85. Cache::set(__FUNCTION__,$data);
  86. }
  87. // $data = ['percent'=>'37'];
  88. $this->biSuccess($data);
  89. }
  90. //所有项目中不互认原因构成比
  91. public function getBhrReason(BiServies $biServies): void
  92. {
  93. if(Cache::get(__FUNCTION__))
  94. {
  95. $data = Cache::get(__FUNCTION__);
  96. }else{
  97. $data = $biServies->getAllBhrReason();
  98. Cache::set(__FUNCTION__,$data);
  99. }
  100. $this->biSuccess($data);
  101. }
  102. //重复检查的患者中重复项目的构成比
  103. public function getRepeatExamProject(BiServies $biServies): void
  104. {
  105. if(Cache::get(__FUNCTION__))
  106. {
  107. $data = Cache::get(__FUNCTION__);
  108. }else{
  109. $data = $biServies->getRepeatExamProject();
  110. Cache::set(__FUNCTION__,$data);
  111. }
  112. $this->biSuccess($data);
  113. }
  114. //重复检验的患者中重复项目的构成比
  115. public function getRepeatInspectProject(BiServies $biServies): void
  116. {
  117. if(Cache::get(__FUNCTION__))
  118. {
  119. $data = Cache::get(__FUNCTION__);
  120. }else{
  121. $data = $biServies->getRepeatInspectProject();
  122. Cache::set(__FUNCTION__,$data);
  123. }
  124. $this->biSuccess($data);
  125. }
  126. //重复检查排在前20的医生
  127. public function getRepeatExamDoctor(BiServies $biServies): void
  128. {
  129. if(Cache::get(__FUNCTION__))
  130. {
  131. $data = Cache::get(__FUNCTION__);
  132. }else{
  133. $data = $biServies->getRepeatExamDoctor();
  134. Cache::set(__FUNCTION__,$data);
  135. }
  136. $this->biSuccess($data);
  137. }
  138. //重复检验排在前20的医生
  139. public function getRepeatInspectDoctor(BiServies $biServies): void
  140. {
  141. if(Cache::get(__FUNCTION__))
  142. {
  143. $data = Cache::get(__FUNCTION__);
  144. }else{
  145. $data = $biServies->getRepeatInspectDoctor();
  146. Cache::set(__FUNCTION__,$data);
  147. }
  148. $this->biSuccess($data);
  149. }
  150. //被互认最多的检查项目前50项构成比
  151. public function getHrExam(BiServies $biServies): void
  152. {
  153. if(Cache::get(__FUNCTION__))
  154. {
  155. $data = Cache::get(__FUNCTION__);
  156. }else{
  157. $data = $biServies->getHrExamItem();
  158. Cache::set(__FUNCTION__,$data);
  159. }
  160. $this->biSuccess($data);
  161. }
  162. //被互认最多的检验项目前50项构成比
  163. public function getHrInspect(BiServies $biServies): void
  164. {
  165. if(Cache::get(__FUNCTION__))
  166. {
  167. $data = Cache::get(__FUNCTION__);
  168. }else{
  169. $data = $biServies->getHrInspectItem();
  170. Cache::set(__FUNCTION__,$data);
  171. }
  172. $this->biSuccess($data);
  173. }
  174. //有互认提示但未查看,重复检验的医生构成比
  175. public function unLookRepeatInspectDoctor(BiServies $biServies): void
  176. {
  177. if(Cache::get(__FUNCTION__))
  178. {
  179. $data = Cache::get(__FUNCTION__);
  180. }else{
  181. $data = $biServies->unLookRepeatInspectDoctor();
  182. Cache::set(__FUNCTION__,$data);
  183. }
  184. $this->biSuccess($data);
  185. }
  186. //有互认提示但未查看,重复检查的医生构成比
  187. public function unLookRepeatExamDoctor(BiServies $biServies): void
  188. {
  189. if(Cache::get(__FUNCTION__))
  190. {
  191. $data = Cache::get(__FUNCTION__);
  192. }else{
  193. $data = $biServies->unLookRepeatExamDoctor();
  194. Cache::set(__FUNCTION__,$data);
  195. }
  196. $this->biSuccess($data);
  197. }
  198. //有互认提示并已查看,重复检查的医生构成比
  199. public function lookRepeatExamDoctor(BiServies $biServies): void
  200. {
  201. if(Cache::get(__FUNCTION__))
  202. {
  203. $data = Cache::get(__FUNCTION__);
  204. }else{
  205. $data = $biServies->lookRepeatExamDoctor();
  206. Cache::set(__FUNCTION__,$data);
  207. }
  208. $this->biSuccess($data);
  209. }
  210. public function getLeida(BiServies $biServies): void
  211. {
  212. if(Cache::get(__FUNCTION__))
  213. {
  214. $data = Cache::get(__FUNCTION__);
  215. }else{
  216. $data = $biServies->getLeida();
  217. Cache::set(__FUNCTION__,$data);
  218. }
  219. $this->biSuccess($data);
  220. // $data = [
  221. // 'indicator' => [
  222. // ['key' => 'key1', 'max' => 10000, 'name' => 'Name1'],
  223. // ['key' => 'key2', 'max' => 10000, 'name' => 'Name2'],
  224. // ['key' => 'key3', 'max' => 10000, 'name' => 'Name3'],
  225. // ['key' => 'key4', 'max' => 10000, 'name' => 'Name4'],
  226. // ['key' => 'key5', 'max' => 10000, 'name' => 'Name5'],
  227. // ['key' => 'key6', 'max' => 10000, 'name' => 'Name6'],
  228. // ],
  229. // 'val' => [
  230. // [
  231. // 'name' => '上传',
  232. // 'key1' => 2342,
  233. // 'key2' => 2452,
  234. // 'key3' => 4335,
  235. // 'key4' => 7469,
  236. // 'key5' => 6572,
  237. // 'key6' => 9864,
  238. // ],
  239. // [
  240. // 'name' => '互认',
  241. // 'key1' => 1342,
  242. // 'key2' => 5452,
  243. // 'key3' => 3335,
  244. // 'key4' => 4469,
  245. // 'key5' => 6572,
  246. // 'key6' => 2864,
  247. // ]
  248. // ]
  249. // ];
  250. // $this->biSuccess($data);
  251. }
  252. public function getBhrInstitution(BiServies $biServies): void
  253. {
  254. $data = $biServies->getBhrInstitution();
  255. $this->biSuccess($data);
  256. }
  257. }