123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?php
- namespace app\api\controller\exam;
- use app\api\controller\ZskkDefaultController;
- use app\api\servies\report\ReportService;
- use app\api\validate\exam\ExamValidate;
- use app\api\servies\exam\ExamService;
- use think\Exception;
- class ExamController extends ZskkDefaultController
- {
- protected $needToken = true;
- protected $logName = "ExamController";
- /**
- * @author liuguiyan
- */
- public function examList(ExamService $service)
- {
- try{
- $params = $this->getParams();
- ExamValidate::check($params);
- $token = $this->getToken();
- $data = $service->getExamLIst($params,$token);
- return $this->success($data);
- } catch (Exception $exception){
- $this->throwError('系统异常',0001);
- }
- }
- // public function remoteList(ExamService $service)
- // {
- // try{
- // $params = $this->getParams();
- // ExamValidate::checkId($params);
- // $token = $this->getToken();
- // $data = $service->getRemoteLIst($params,$token);
- // return $this->success($data);
- // } catch (Exception $exception){
- // $this->throwError('系统异常',0001);
- // }
- // }
- public function createExam(ExamService $service)
- {
- try{
- $params = $this->getParams();
- ExamValidate::checkCreate($params);
- $data = $service->saveExam($params);
- return $this->success($data);
- } catch (Exception $exception){
- $this->throwError($exception->getMessage(),0001);
- }
- }
- public function getReport(ExamService $service)
- {
- try{
- $params = $this->getParams();
- $token = $this->getToken();
- $doctor = $this->getCache($token);
- $data = $service->getReport($params,$doctor);
- return $this->success($data);
- } catch (Exception $exception){
- $this->throwError($exception->getMessage(),0001);
- }
- }
- public function changeDoctor(ExamService $service)
- {
- try{
- $params = $this->getParams();
- $token = $this->getToken();
- $doctor = $this->getCache($token);
- $data = $service->changeDoctor($params,$doctor);
- return $this->success($data);
- } catch (Exception $exception){
- $this->throwError($exception->getMessage(),0001);
- }
- }
- public function getFilmAnnex(ExamService $service)
- {
- try{
- $params = $this->getParams();
- $data = $service->getFilmAnnex($params['exam_id'],$params['exam_datetime'],$params['code']);
- return $this->success($data);
- } catch (Exception $exception){
- $this->throwError($exception->getMessage(),0001);
- }
- }
- public function del_exam(ExamService $service)
- {
- try{
- $params = $this->getParams();
- $data = $service->del_exam($params,$this->getToken());
- return $this->success($data);
- } catch (Exception $exception){
- $this->throwError($exception->getMessage(),0001);
- }
- }
- public function sendDcm(ReportService $reportService)
- {
- $params = $this->getParams();
- // $data = $reportService->testGetDcmZip($params['study_id'],'','ai',$params['exam_id'],$params['exam_class']);
- $data = $reportService->sendDcm(json_encode($params),$params['study_id'],$params['exam_id'],$params['exam_class']);
- return $this->success($data);
- }
- public function getSyncAi(ExamService $service)
- {
- $params = $this->getParams();
- $data = $service->getSyncAi($params);
- return $this->success($data);
- }
- }
|