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

52 lines
1.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 getFamilyPathographyList(): ResponseInterface
{
try {
$request = $this->container->get(PatientPathographyRequest::class);
}catch (\Throwable $e){
return $this->response->json(fail());
}
$request->scene('getFamilyPathographyList')->validateResolved();
$PatientPathographyService = new PatientPathographyService();
$data = $PatientPathographyService->getFamilyPathographyList();
return $this->response->json($data);
}
}