Bi.php 7.9 KB

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