ExamController.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. namespace app\api\controller\exam;
  3. use app\api\controller\ZskkDefaultController;
  4. use app\api\servies\report\ReportService;
  5. use app\api\validate\exam\ExamValidate;
  6. use app\api\servies\exam\ExamService;
  7. use think\Exception;
  8. class ExamController extends ZskkDefaultController
  9. {
  10. protected $needToken = true;
  11. protected $logName = "ExamController";
  12. /**
  13. * @author liuguiyan
  14. */
  15. public function examList(ExamService $service)
  16. {
  17. // try{
  18. $params = $this->getParams();
  19. ExamValidate::check($params);
  20. $token = $this->getToken();
  21. $data = $service->getExamLIst($params,$token);
  22. return $this->success($data);
  23. // } catch (Exception $exception){
  24. // $this->throwError('系统异常',0001);
  25. // }
  26. }
  27. public function changeInsLogin(ExamService $service)
  28. {
  29. try{
  30. $token = $this->getToken();
  31. $params = $this->getParams();
  32. $data = $service->changeInsLogin($params,$token);
  33. return $this->success($data);
  34. } catch (Exception $exception){
  35. $this->throwError('系统异常',0001);
  36. }
  37. }
  38. // public function remoteList(ExamService $service)
  39. // {
  40. // try{
  41. // $params = $this->getParams();
  42. // ExamValidate::checkId($params);
  43. // $token = $this->getToken();
  44. // $data = $service->getRemoteLIst($params,$token);
  45. // return $this->success($data);
  46. // } catch (Exception $exception){
  47. // $this->throwError('系统异常',0001);
  48. // }
  49. // }
  50. public function createExam(ExamService $service)
  51. {
  52. try{
  53. $params = $this->getParams();
  54. ExamValidate::checkCreate($params);
  55. $data = $service->saveExam($params);
  56. return $this->success($data);
  57. } catch (Exception $exception){
  58. $this->throwError($exception->getMessage(),0001);
  59. }
  60. }
  61. public function getReport(ExamService $service)
  62. {
  63. try{
  64. $params = $this->getParams();
  65. $token = $this->getToken();
  66. $doctor = $this->getCache($token);
  67. $data = $service->getReport($params,$doctor);
  68. return $this->success($data);
  69. } catch (Exception $exception){
  70. $this->throwError($exception->getMessage(),0001);
  71. }
  72. }
  73. public function changeDoctor(ExamService $service)
  74. {
  75. try{
  76. $params = $this->getParams();
  77. $token = $this->getToken();
  78. $doctor = $this->getCache($token);
  79. $data = $service->changeDoctor($params,$doctor);
  80. return $this->success($data);
  81. } catch (Exception $exception){
  82. $this->throwError($exception->getMessage(),0001);
  83. }
  84. }
  85. public function getFilmAnnex(ExamService $service)
  86. {
  87. try{
  88. $params = $this->getParams();
  89. $data = $service->getFilmAnnex($params['exam_id'],$params['exam_datetime'],$params['code']);
  90. return $this->success($data);
  91. } catch (Exception $exception){
  92. $this->throwError($exception->getMessage(),0001);
  93. }
  94. }
  95. public function del_exam(ExamService $service)
  96. {
  97. try{
  98. $params = $this->getParams();
  99. $data = $service->del_exam($params,$this->getToken());
  100. return $this->success($data);
  101. } catch (Exception $exception){
  102. $this->throwError($exception->getMessage(),0001);
  103. }
  104. }
  105. public function sendDcm(ReportService $reportService)
  106. {
  107. $params = $this->getParams();
  108. // $data = $reportService->testGetDcmZip($params['study_id'],'','ai',$params['exam_id'],$params['exam_class']);
  109. $data = $reportService->sendDcm(json_encode($params),$params['study_id'],$params['exam_id'],$params['exam_class']);
  110. return $this->success($data);
  111. }
  112. public function getSyncAi(ExamService $service)
  113. {
  114. $params = $this->getParams();
  115. $data = $service->getSyncAi($params);
  116. return $this->success($data);
  117. }
  118. public function getHistory(ExamService $service)
  119. {
  120. $params = $this->getParams();
  121. $data = $service->getHistory($params);
  122. return $this->success($data);
  123. }
  124. }