ButtDao.php 12 KB

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