hospital-applets-api/app/Controller/DetectionController.php

122 lines
3.7 KiB
PHP

<?php
namespace App\Controller;
use App\Request\DetectionRequest;
use App\Request\UserRequest;
use App\Services\DetectionService;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;
class DetectionController extends AbstractController
{
/**
* 获取合作公司检测项目列表
* @return ResponseInterface
*/
public function getDetectionProjectList(): ResponseInterface
{
$detectionService = new DetectionService();
$data = $detectionService->getDetectionProjectList();
return $this->response->json($data);
}
/**
* 获取合作公司检测项目详情
* @return ResponseInterface
*/
public function getDetectionProject(): ResponseInterface
{
$detectionService = new DetectionService();
$data = $detectionService->getDetectionProject();
return $this->response->json($data);
}
/**
* 获取检测机构合作医生列表
* @return ResponseInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function getDetectionDoctorList(): ResponseInterface
{
$request = $this->container->get(DetectionRequest::class);
$request->scene('getDetectionDoctorList')->validateResolved();
$detectionService = new DetectionService();
$data = $detectionService->getDetectionDoctorList();
return $this->response->json($data);
}
/**
* 获取检测项目用途列表
* @return ResponseInterface
*/
public function getDetectionProjectPurposeList(): ResponseInterface
{
$detectionService = new DetectionService();
$data = $detectionService->getDetectionProjectPurposeList();
return $this->response->json($data);
}
/**
* 创建检测订单
* @return ResponseInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function addDetectionOrder(): ResponseInterface
{
$request = $this->container->get(DetectionRequest::class);
$request->scene('addDetectionOrder')->validateResolved();
$detectionService = new DetectionService();
$data = $detectionService->addDetectionOrder();
return $this->response->json($data);
}
/**
* 获取患者进行中的检测订单
* @return ResponseInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function getDetectionOrderFirst(): ResponseInterface
{
$request = $this->container->get(DetectionRequest::class);
$request->scene('getDetectionOrderFirst')->validateResolved();
$detectionService = new DetectionService();
$data = $detectionService->getDetectionOrderFirst();
return $this->response->json($data);
}
/**
* 绑定检测管
* @return ResponseInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function bindDetectionTube(): ResponseInterface
{
$request = $this->container->get(DetectionRequest::class);
$request->scene('bindDetectionTube')->validateResolved();
$detectionService = new DetectionService();
$data = $detectionService->bindDetectionTube();
return $this->response->json($data);
}
/**
* 创建检测问诊订单
* @return ResponseInterface
*/
public function addDetectionInquiryOrder(): ResponseInterface
{
$detectionService = new DetectionService();
$data = $detectionService->addDetectionInquiryOrder();
return $this->response->json($data);
}
}