package thyyxxk.webserver.controller.medicaladvice.medicamanage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.datamodify.YzActOrder;
import thyyxxk.webserver.entity.inpatient.patient.Patient;
import thyyxxk.webserver.entity.inpatient.patient.YzQueryBase;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.YzOrderParam;
import thyyxxk.webserver.service.medicaladvice.medicamanage.MedicalManagementService;
import thyyxxk.webserver.utils.ResultVoUtil;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author:lihong
 * @Date: 2023/3/13
 */
@RestController
@RequestMapping("/medicalAdvice/medicaManagement")
public class MedicalManagementController {
    @Autowired
    private MedicalManagementService service;

    @PostMapping("/cqYzPrint")
    public ResultVo<Map<String,Object>> cqYzPrint(@RequestBody YzOrderParam param) {
        return service.cqYzPrint(param);
    }
    @PostMapping("/lsYzPrint")
    public ResultVo<Map<String,Object>> lsYzPrint(@RequestBody YzOrderParam param) {
        return service.lsYzPrint(param);
    }

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


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






    @GetMapping("/queryPatientInfo")
    public ResultVo<List<Patient>> queryPatientInfo(@RequestParam("patNo")String patNo, @RequestParam("ward")String ward, @RequestParam("inOutStatusFlag")String inOutStatusFlag) {
        return ResultVoUtil.success(service.queryPatientInfo(patNo,ward,inOutStatusFlag));
    }

    @PostMapping("/getTotalPageNUm")
    public ResultVo<Map> getTotalPageNUm(@RequestBody YzOrderParam param) {
        return ResultVoUtil.success(service.getTotalPageNUm(param));
    }

    @PostMapping("/queryYz")
    public ResultVo<Map<String,Object>> queryYz(@RequestBody YzQueryBase yzQueryBase) {
        return ResultVoUtil.success(service.queryYz(yzQueryBase));
    }
    /**
     * @description: 查询医嘱核对数据
     * @author: lihong
     * @date: 2023/12/12 14:40
     * @param: yzQueryBase
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.XinZhenYzActOrder>>
     **/
    @PostMapping("/queryYzCheckData")
    public ResultVo<List<YzActOrder>> queryYzCheckData(@RequestBody YzQueryBase yzQueryBase) {
        return ResultVoUtil.success(service.queryYzCheckData(yzQueryBase));
    }

    /**
     * @description:获取病人基本信息
     * @author: lihong
     * @date: 2023/4/28 9:41
     * @param: patient
     * @return: thyyxxk.webserver.entity.ResultVo<thyyxxk.webserver.entity.inpatient.patient.Patient>
     **/
    @PostMapping("/getPatientBaseInfo")
    public ResultVo<Patient> getPatientBaseInfo(@RequestBody Patient patient){
        return ResultVoUtil.success(service.getPatientBaseInfo(patient.getInpatientNo(),patient.getAdmissTimes(),patient.getInOutStatusFlag()));
    }

}
