package thyyxxk.webserver.controller.zhuyuanyizheng;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
import thyyxxk.webserver.entity.inpatient.patient.Patient;
import thyyxxk.webserver.entity.zhuyuanyisheng.patInfoquery.PatInfoQueryParam;
import thyyxxk.webserver.service.zhuyuanyisheng.PatientInfoQueryService;

import java.util.List;

@RestController
@RequestMapping("/patInfo")
public class PatInfoQueryController {
    private final PatientInfoQueryService service;

    @Autowired
    public PatInfoQueryController(PatientInfoQueryService service) {
        this.service = service;
    }

    @GetMapping("/getHospWardAndDept")
    public ResultVo<List<GetDropdownBox>> getHospWardAndDept() {
        return service.getHospWardAndDept();
    }

    @PostMapping("/getPatientInfo")
    public ResultVo<List<Patient>> getPatientInfo(@RequestBody PatInfoQueryParam param) {
        return service.getPatientInfo(param);
    }

    @GetMapping("/diagnosis")
    public ResultVo<List<GetDropdownBox>> diagnosis(@RequestParam("code") String code) {
        return service.diagnosis(code);
    }

    @GetMapping("/employeeList")
    public ResultVo<List<GetDropdownBox>> employeeList(@RequestParam("code") String code) {
        return service.employeeList(code);
    }

    @GetMapping("/getSurgery")
    public ResultVo<List<GetDropdownBox>> getSurgery(@RequestParam("code") String code) {
        return service.getSurgery(code);
    }
}
