package thyyxxk.webserver.controller.executeItem;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.aop.interfaces.NeedMenu;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.executeItem.GenerateYzVo;
import thyyxxk.webserver.entity.inpatient.ZyActpatient;
import thyyxxk.webserver.enums.authorize.MenuEnum;
import thyyxxk.webserver.service.executeItem.GenerateYzService;
import thyyxxk.webserver.utils.ResultVoUtil;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * @Description: 医嘱生成
 * @Author:lihong
 * @Date: 2024/1/8
 */
@RestController
@RequestMapping("/generateYz")
public class GenerateYzController {

    @Resource
    private GenerateYzService service;

    /**
     * @description: 查询病人列表
     * @author: lihong
     * @date: 2024/1/8 15:06
     * @param: wardCode
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List < thyyxxk.webserver.entity.inpatient.ZyActpatient>>
     **/
    @PostMapping("/queryGenerateYzList")
    @NeedMenu(MenuEnum.generateYz)
    public ResultVo<List<ZyActpatient>> queryGenerateYzList(@RequestBody ZyActpatient zyActpatient) {
        return ResultVoUtil.success(service.queryGenerateYzList(zyActpatient.getWardCode()));
    }

    /**
     * @description: 生成药品或诊疗
     * @author: lihong
     * @date: 2024/1/8 15:49
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List < thyyxxk.webserver.entity.inpatient.ZyActpatient>>
     **/
    @PostMapping("/generateYpOrZl")
    @NeedMenu(MenuEnum.generateYz)
    public ResultVo<Set<String>> generateYpOrZl(@RequestBody GenerateYzVo param) {
        return service.generateYpOrZl(param);
    }


}
