<?php

namespace App\Controller;

use App\Model\BasicNation;
use App\Request\BasicDataRequest;
use App\Request\DiseaseRequest;
use App\Services\BasicDataService;
use App\Services\DiseaseService;
use App\Services\SafeService;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;

/**
 * 基础数据
 */
class BasicDataController extends AbstractController
{
    /**
     * 获取医院数据
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function getHospital(): ResponseInterface
    {
        $request = $this->container->get(BasicDataRequest::class);
        $request->scene('getHospital')->validateResolved();

        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getHospital();
        return $this->response->json($data);
    }

    /**
     * 获取自定义科室数据
     * @return ResponseInterface
     */
    public function getCustomDepartment(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getCustomDepartment();
        return $this->response->json($data);
    }

    /**
     * 获取银行列表
     * @return ResponseInterface
     */
    public function getBank(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getBank();
        return $this->response->json($data);
    }

    /**
     * 获取操作手册列表
     * @return ResponseInterface
     */
    public function getOperationManual(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getOperationManual();
        return $this->response->json($data);
    }

    /**
     * 获取操作手册详情
     * @return ResponseInterface
     */
    public function getOperationManualInfo(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getOperationManualInfo();
        return $this->response->json($data);
    }

    /**
     * 搜索疾病分类
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function getDiseaseSearch(): ResponseInterface
    {
        $request = $this->container->get(BasicDataRequest::class);
        $request->scene('getDiseaseSearch')->validateResolved();

        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getDiseaseSearch();
        return $this->response->json($data);
    }

    /**
     * 获取常见疾病分类
     * @return ResponseInterface
     */
    public function getDiseaseHot(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getDiseaseHot();
        return $this->response->json($data);
    }

    /**
     * 专长列表
     * @return ResponseInterface
     */
    public function getDiseaseExpertiseList(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getDiseaseExpertiseList();
        return $this->response->json($data);
    }

    /**
     * 搜索商品
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function getProductSearch(): ResponseInterface
    {
        $request = $this->container->get(BasicDataRequest::class);
        $request->scene('getProductSearch')->validateResolved();

        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getProductSearch();
        return $this->response->json($data);
    }

    /**
     * 搜索平台疾病分类
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function getDiseaseIcdSearch(): ResponseInterface
    {
        $request = $this->container->get(BasicDataRequest::class);
        $request->scene('getDiseaseIcdSearch')->validateResolved();

        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getDiseaseIcdSearch();
        return $this->response->json($data);
    }

    /**
     * 获取民族数据
     * @return ResponseInterface
     */
    public function getNation(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getNation();
        return $this->response->json($data);
    }

    /**
     * 获取职业数据
     * @return ResponseInterface
     */
    public function getJob(): ResponseInterface
    {
        $BasicDataService = new BasicDataService();
        $data = $BasicDataService->getJob();
        return $this->response->json($data);
    }
}