package thyyxxk.webserver.controller.inpatient.charge;

import org.springframework.beans.factory.annotation.Autowired;
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.entity.ResultVo;
import thyyxxk.webserver.entity.inpatient.charge.forceinout.PatInquiry;
import thyyxxk.webserver.entity.inpatient.charge.forceinout.SimplePatient;
import thyyxxk.webserver.service.inpatient.charge.ForceInAndOutService;
import thyyxxk.webserver.utils.ResultVoUtil;

import java.util.List;

@RestController
@RequestMapping("/forceInAndOut")
public class ForceInAndOutController {
    private final ForceInAndOutService service;

    @Autowired
    public ForceInAndOutController(ForceInAndOutService service) {
        this.service = service;
    }

    @PostMapping("/getActpatient")
    public ResultVo<List<SimplePatient>> getActpatient(@RequestBody PatInquiry inquiry) {
        return ResultVoUtil.success(service.getActpatient(inquiry));
    }

    @PostMapping("/pullBack")
    public ResultVo<String> pullBack(@RequestBody SimplePatient patient) {
        return ResultVoUtil.success(service.pullBack(patient));
    }

    @PostMapping("/checkKickOutCondition")
    public ResultVo<String> checkKickOutCondition(@RequestBody SimplePatient patient) {
        return ResultVoUtil.success(service.checkKckOutCondition(patient));
    }

    @PostMapping("/kickOut")
    public ResultVo<String> kickOut(@RequestBody SimplePatient patient) {
        return ResultVoUtil.success(service.kickOut(patient));
    }

    @PostMapping("/revokeSettlement")
    public ResultVo<String> revokeSettlement(@RequestBody SimplePatient patient) {
        return ResultVoUtil.success(service.revokeSettlement(patient));
    }

    @PostMapping("/revokeMedinsurSetl")
    public ResultVo<String> revokeMedinsurSetl(@RequestBody SimplePatient patient) {
        return ResultVoUtil.success(service.revokeMedinsurSetl(patient));
    }
}
