ButtDao.php 12 KB

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