83 lines
2.5 KiB
PHP
83 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\PatientPathographyRequest;
|
|
use App\Services\PatientPathographyService;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
/**
|
|
* 家庭成员病情记录
|
|
*/
|
|
class PatientPathographyController extends AbstractController
|
|
{
|
|
/**
|
|
* 检测家庭成员是否存在病情记录
|
|
* @return ResponseInterface
|
|
*/
|
|
public function existFamilyPathography(): ResponseInterface
|
|
{
|
|
try {
|
|
$request = $this->container->get(PatientPathographyRequest::class);
|
|
$request->scene('existFamilyPathography')->validateResolved();
|
|
|
|
$PatientPathographyService = new PatientPathographyService();
|
|
$data = $PatientPathographyService->existFamilyPathography();
|
|
return $this->response->json($data);
|
|
}catch (\Throwable $e){
|
|
return $this->response->json(fail());
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 获取家庭成员病情记录列表-分页
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getFamilyPathographyPage(): ResponseInterface
|
|
{
|
|
try {
|
|
$request = $this->container->get(PatientPathographyRequest::class);
|
|
}catch (\Throwable $e){
|
|
return $this->response->json(fail());
|
|
}
|
|
|
|
$request->scene('getFamilyPathographyPage')->validateResolved();
|
|
|
|
$PatientPathographyService = new PatientPathographyService();
|
|
$data = $PatientPathographyService->getFamilyPathographyPage();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取家庭成员病情记录详情
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getFamilyPathographyInfo(): ResponseInterface
|
|
{
|
|
$PatientPathographyService = new PatientPathographyService();
|
|
$data = $PatientPathographyService->getFamilyPathographyInfo();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取家庭成员病情记录分组
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getFamilyPathographyGroup(): ResponseInterface
|
|
{
|
|
$PatientPathographyService = new PatientPathographyService();
|
|
$data = $PatientPathographyService->getFamilyPathographyGroup();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 删除家庭成员病情记录
|
|
* @return ResponseInterface
|
|
*/
|
|
public function deleteFamilyPathography(): ResponseInterface
|
|
{
|
|
$PatientPathographyService = new PatientPathographyService();
|
|
$data = $PatientPathographyService->deleteFamilyPathography();
|
|
return $this->response->json($data);
|
|
}
|
|
} |