package thyyxxk.webserver.controller.inpatient.casefrontsheet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
import thyyxxk.webserver.service.inpatient.casefrontsheet.JieShouHuiZhenService;

import java.util.List;

/**
 * <p>
 * 描述： 接受会诊申请
 * </p>
 *
 * @author xc
 * @date 2021-07-27 10:30
 */
@RestController
@RequestMapping("/huiZhen")
public class JieShouHuiZhenController {
    private final JieShouHuiZhenService service;

    @Autowired
    public JieShouHuiZhenController(JieShouHuiZhenService service) {
        this.service = service;
    }

    @GetMapping("/getHuiZhenData")
    public ResultVo<List<JieShouHuiZhenPojo>> getHuiZhenData(@RequestParam("startTime") String startTime,
                                                             @RequestParam("endTime") String endTime,
                                                             @RequestParam("history") Boolean history) {
        return service.getHuiZhenData(startTime, endTime, history);
    }


    @GetMapping("/getHuanZheXinXi")
    public ResultVo<JieShouHuiZhenPojo> getHuanZheXinXi(@RequestParam("admissTimes") Integer admissTimes,
                                                        @RequestParam("reqTimes") Integer reqTimes,
                                                        @RequestParam("inpatientNo") String inpatientNo) {
        return service.getHuanZheXinXi(admissTimes, reqTimes, inpatientNo);
    }

    @PostMapping("/wanChenHuiZhen")
    public ResultVo<String> wanChenHuiZhen(@RequestBody JieShouHuiZhenPojo param) {
        return service.wanChenHuiZhen(param);
    }

    @GetMapping("/getDeptName")
    @PassToken
    public ResultVo<String> getDeptName(@RequestParam("deptCode") String deptCode) {
        return service.getDeptName(deptCode);
    }

}
