ExamController.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 remoteList(ExamService $service)
  28. // {
  29. // try{
  30. // $params = $this->getParams();
  31. // ExamValidate::checkId($params);
  32. // $token = $this->getToken();
  33. // $data = $service->getRemoteLIst($params,$token);
  34. // return $this->success($data);
  35. // } catch (Exception $exception){
  36. // $this->throwError('系统异常',0001);
  37. // }
  38. // }
  39. public function createExam(ExamService $service)
  40. {
  41. try{
  42. $params = $this->getParams();
  43. ExamValidate::checkCreate($params);
  44. $data = $service->saveExam($params);
  45. return $this->success($data);
  46. } catch (Exception $exception){
  47. $this->throwError($exception->getMessage(),0001);
  48. }
  49. }
  50. public function getReport(ExamService $service)
  51. {
  52. try{
  53. $params = $this->getParams();
  54. $token = $this->getToken();
  55. $doctor = $this->getCache($token);
  56. $data = $service->getReport($params,$doctor);
  57. return $this->success($data);
  58. } catch (Exception $exception){
  59. $this->throwError($exception->getMessage(),0001);
  60. }
  61. }
  62. public function changeDoctor(ExamService $service)
  63. {
  64. try{
  65. $params = $this->getParams();
  66. $token = $this->getToken();
  67. $doctor = $this->getCache($token);
  68. $data = $service->changeDoctor($params,$doctor);
  69. return $this->success($data);
  70. } catch (Exception $exception){
  71. $this->throwError($exception->getMessage(),0001);
  72. }
  73. }
  74. public function getFilmAnnex(ExamService $service)
  75. {
  76. try{
  77. $params = $this->getParams();
  78. $data = $service->getFilmAnnex($params['exam_id'],$params['exam_datetime'],$params['code']);
  79. return $this->success($data);
  80. } catch (Exception $exception){
  81. $this->throwError($exception->getMessage(),0001);
  82. }
  83. }
  84. public function del_exam(ExamService $service)
  85. {
  86. try{
  87. $params = $this->getParams();
  88. $data = $service->del_exam($params,$this->getToken());
  89. return $this->success($data);
  90. } catch (Exception $exception){
  91. $this->throwError($exception->getMessage(),0001);
  92. }
  93. }
  94. public function sendDcm(ReportService $reportService)
  95. {
  96. $params = $this->getParams();
  97. // $data = $reportService->testGetDcmZip($params['study_id'],'','ai',$params['exam_id'],$params['exam_class']);
  98. $data = $reportService->sendDcm(json_encode($params),$params['study_id'],$params['exam_id'],$params['exam_class']);
  99. return $this->success($data);
  100. }
  101. public function getSyncAi(ExamService $service)
  102. {
  103. $params = $this->getParams();
  104. $data = $service->getSyncAi($params);
  105. return $this->success($data);
  106. }
  107. }