ButtDao.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <?php
  2. namespace app\api\dao\butt;
  3. use app\api\actions\ZskkCache;
  4. use app\api\dao\ZskkDefaultDao;
  5. use app\api\model\hr\HrModel;
  6. use app\api\model\monitor\MonitorexamModel;
  7. use app\api\model\monitor\MonitorreportModel;
  8. use app\api\model\report\ReportModel;
  9. /**
  10. * 后台控制器基类
  11. * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
  12. */
  13. class ButtDao extends ZskkDefaultDao {
  14. protected $flag = true;
  15. protected $logName = "ButtDao";
  16. protected $report = null;
  17. protected $hrModel = null;
  18. protected $monitorreportModel = null;
  19. public function __construct(ReportModel $reportModel,HrModel $hrModel,MonitorreportModel $monitorreportModel)
  20. {
  21. parent::__construct();
  22. $this->report = $reportModel;
  23. $this->hrModel = $hrModel;
  24. $this->monitorreportModel = $monitorreportModel;
  25. }
  26. public function getExams($institutionId,$num,$where,$timeWhere='',$status='')
  27. {
  28. $info = $this->report->getExams($institutionId,$num,$where,$timeWhere,$status);
  29. return $info;
  30. }
  31. public function getReports($institutionId,$page,$num,$timeWhere='')
  32. {
  33. $info = $this->report->getReports($institutionId,$page,$num,$timeWhere);
  34. return $info;
  35. }
  36. public function getConfirmExams($institutionId,$num)
  37. {
  38. $info = $this->report->getConfirmExams($institutionId,$num);
  39. return $info;
  40. }
  41. public function getExamById($id)
  42. {
  43. $info = $this->report->getExamById($id);
  44. return $info;
  45. }
  46. public function getDcotorId($name,$institution_id)
  47. {
  48. if($name == ''){
  49. return '';
  50. }
  51. $sql = "SELECT id FROM doctors where instr('$name',realname) and institution_id='$institution_id' and realname <> ''";
  52. $info = $this->report->getDoctorId($sql);
  53. $id = '';
  54. if(!empty($info)){
  55. $id = $info[0]['id'];
  56. }
  57. return $id;
  58. }
  59. public function getDcotorByNull($institution)
  60. {
  61. $data = $this->report->getDoctorByNull($institution);
  62. return $data;
  63. }
  64. public function makeDcotor($doctor)
  65. {
  66. $info = $this->report->makeDoctor($doctor);
  67. return $info;
  68. }
  69. public function checkReport($id)
  70. {
  71. $info = $this->report->checkReport($id);
  72. return $info;
  73. }
  74. public function saveReport($report,$id=null)
  75. {
  76. $info = $this->report->saveReport($report,$id);
  77. return $info;
  78. }
  79. public function saveAiReport($data)
  80. {
  81. $info = $this->report->saveAiReport($data);
  82. return $info;
  83. }
  84. public function getBodyByProject($project)
  85. {
  86. $info = $this->report->getBodyByProject($project);
  87. return $info;
  88. }
  89. public function getStudyByExamId($examId)
  90. {
  91. $info = $this->report->getStudyByExamId($examId);
  92. return $info;
  93. }
  94. public function updateExam($exam,$id)
  95. {
  96. $info = $this->report->updateExamInfo($exam,$id);
  97. return $info;
  98. }
  99. public function getPatientId($examId)
  100. {
  101. $id = $this->report->getPatientId($examId);
  102. return $id;
  103. }
  104. public function updatePatient($patient,$id)
  105. {
  106. $info = $this->report->updatePatient($patient,$id);
  107. return $info;
  108. }
  109. public function getIns($id)
  110. {
  111. $info = $this->report->getIns($id);
  112. return $info;
  113. }
  114. public function getHistorySend($exam,$study)
  115. {
  116. $info = $this->report->getHistorySend($exam,$study);
  117. return $info;
  118. }
  119. public function getUserWechat()
  120. {
  121. $info = $this->report->getUserWechat();
  122. return $info;
  123. }
  124. public function getExamData()
  125. {
  126. $info = $this->report->getExamData();
  127. return $info;
  128. }
  129. public function getExamReport($where,$field,$whereTime)
  130. {
  131. $info = $this->report->getExamReport($where,$field,$whereTime);
  132. return $info;
  133. }
  134. public function getExamLimitReport($where,$field,$where2,$num)
  135. {
  136. $info = $this->report->getExamLimitReport($where,$field,$where2,$num);
  137. return $info;
  138. }
  139. public function getPicNumber()
  140. {
  141. $info = $this->report->getPicNumber();
  142. return $info;
  143. }
  144. public function getYestNumber()
  145. {
  146. $info = $this->report->getYestNumber();
  147. return $info;
  148. }
  149. public function getInsInfo()
  150. {
  151. $info = $this->report->getInsInfo();
  152. return $info;
  153. }
  154. public function getAllInsInfo()
  155. {
  156. $info = $this->report->getAllInsInfo();
  157. return $info;
  158. }
  159. public function insertDing($data)
  160. {
  161. $info = $this->report->insertDing($data);
  162. return $info;
  163. }
  164. public function get2Ins()
  165. {
  166. $num = $this->report->get2Ins();
  167. return $num;
  168. }
  169. public function get3Ins()
  170. {
  171. $num = $this->report->get3Ins();
  172. return $num;
  173. }
  174. public function getInstitutionId($study_id)
  175. {
  176. $id = $this->report->getInstitutionId($study_id);
  177. return $id;
  178. }
  179. public function getPatientByStudyId($study_id)
  180. {
  181. $id = $this->report->getPatientByStudyId($study_id);
  182. return $id;
  183. }
  184. public function getPatientNameByStudyId($study_id)
  185. {
  186. $id = $this->report->getPatientNameByStudyId($study_id);
  187. return $id;
  188. }
  189. public function getExamBySearch($where,$institution)
  190. {
  191. $info = $this->report->getExamBySearch($where,$institution);
  192. return $info;
  193. }
  194. public function getExamByPatient($where)
  195. {
  196. $info = $this->report->getExamByPatient($where);
  197. return $info;
  198. }
  199. public function save_video_url($data)
  200. {
  201. $info = $this->report->save_video_url($data);
  202. return $info;
  203. }
  204. public function getHrItems($project)
  205. {
  206. return $this->hrModel->where('name',$project)->find();
  207. }
  208. public function getWorkList()
  209. {
  210. $info = $this->report->getWorkList();
  211. return $info;
  212. }
  213. public function getNotInsReport($where_status,$where_institution,$time,$field)
  214. {
  215. $info = $this->report->getNotInsReport($where_status,$where_institution,$time,$field);
  216. return $info;
  217. }
  218. public function getRisVersion()
  219. {
  220. $info = $this->report->getRisVersion();
  221. return $info;
  222. }
  223. public function saveCache($k,$v,$time=86400*2)
  224. {
  225. $cache = $this->setCache($k,$v,$time);
  226. return $cache;
  227. }
  228. public function getInsIds()
  229. {
  230. $ids = $this->report->getInsIds();
  231. return $ids;
  232. }
  233. public function getExamMaxTime($id)
  234. {
  235. $time = $this->report->getExamMaxTime($id);
  236. return $time;
  237. }
  238. public function get7OutExam($id)
  239. {
  240. $count = $this->report->get7OutExam($id);
  241. return $count;
  242. }
  243. public function getProjectName($id)
  244. {
  245. $name = $this->report->getProjectName($id);
  246. return $name;
  247. }
  248. public function getVersionInfo($project)
  249. {
  250. $info = $this->report->getVersionInfo($project);
  251. return $info;
  252. }
  253. public function getBindInfo($ins,$start,$finish)
  254. {
  255. $info = $this->report->getBindInfo($ins,$start,$finish);
  256. return $info;
  257. }
  258. public function getExamByIds($ids)
  259. {
  260. $info = $this->report->getExamByIds($ids);
  261. return $info;
  262. }
  263. public function getInsById($id)
  264. {
  265. $info = $this->report->getInsById($id);
  266. return $info;
  267. }
  268. public function checkAnnes($where)
  269. {
  270. $info = $this->report->checkAnnes($where);
  271. return $info;
  272. }
  273. public function saveAnnex($data)
  274. {
  275. $info = $this->report->saveAnnex($data);
  276. return $info;
  277. }
  278. public function updateAnnex($data,$where)
  279. {
  280. $info = $this->report->updateAnnex($data,$where);
  281. return $info;
  282. }
  283. public function getRegisterExam($where)
  284. {
  285. $info = $this->report->getRegisterExam($where);
  286. return $info;
  287. }
  288. public function getField($ins)
  289. {
  290. $info = $this->report->getField($ins);
  291. return $info;
  292. }
  293. public function getExam($where,$field)
  294. {
  295. $id = $this->report->getExamInfo($where,$field);
  296. return $id;
  297. }
  298. public function getPrint($where)
  299. {
  300. $info = $this->report->getPrint($where);
  301. return $info;
  302. }
  303. public function updatePrintSync($data,$where)
  304. {
  305. $info = $this->report->updatePrintSync($data,$where);
  306. return $info;
  307. }
  308. public function savePrintSync($data)
  309. {
  310. $info = $this->report->savePrintSync($data);
  311. return $info;
  312. }
  313. public function checkPrint($where,$time)
  314. {
  315. $info = $this->report->checkPrint($where,$time);
  316. return $info;
  317. }
  318. public function printZz($where)
  319. {
  320. $info = $this->report->printZz($where);
  321. return $info;
  322. }
  323. public function getExamFromReport($id)
  324. {
  325. $info = $this->report->getExamFromReport($id);
  326. return $info;
  327. }
  328. public function insertExam($data)
  329. {
  330. $info = $this->report->insertExam($data);
  331. return $info;
  332. }
  333. public function saveFileData($data)
  334. {
  335. $info = $this->report->saveFileData($data);
  336. return $info;
  337. }
  338. public function insertPatient($data)
  339. {
  340. $info = $this->report->insertPatient($data);
  341. return $info;
  342. }
  343. public function getPayExam($where,$time)
  344. {
  345. $info = $this->report->getPayExam($where,$time);
  346. return $info;
  347. }
  348. public function getPayExams($where,$field)
  349. {
  350. $info = $this->report->getPayExams($where,$field);
  351. return $info;
  352. }
  353. public function changeSyncStatus($id)
  354. {
  355. $info = $this->report->changeSyncStatus($id);
  356. return $info;
  357. }
  358. public function changePayStatus($patientNum,$ins)
  359. {
  360. $info = $this->report->changePayStatus($patientNum,$ins);
  361. return $info;
  362. }
  363. public function getMiddleInfo($where)
  364. {
  365. $info = $this->report->getMiddleInfo($where);
  366. return $info;
  367. }
  368. public function changeMiddleStatus($where,$update)
  369. {
  370. $info = $this->report->changeMiddleStatus($where,$update);
  371. return $info;
  372. }
  373. public function saveMiddle($data)
  374. {
  375. $info = $this->report->saveMiddle($data);
  376. return $info;
  377. }
  378. public function getNoteUrl($id)
  379. {
  380. $info = $this->report->getNoteUrl($id);
  381. return $info;
  382. }
  383. public function insertSpecialLog($url, $diff)
  384. {
  385. $this->report->insertSpecialLog($url, $diff);
  386. }
  387. public function getAllIns()
  388. {
  389. $info = $this->report->getAllIns();
  390. return $info;
  391. }
  392. public function getYestExams()
  393. {
  394. $info = $this->report->getYestExams();
  395. return $info;
  396. }
  397. public function getYestCompleteExams()
  398. {
  399. $info = $this->report->getYestCompleteExams();
  400. return $info;
  401. }
  402. public function saveMonitorReport($arr)
  403. {
  404. $this->monitorreportModel->insert($arr);
  405. }
  406. }