package com.diagbot.web;


import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.GetDiseaseIcdDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.TranDiseaseIcdFacade;
import com.diagbot.vo.GetDiseaseIcdVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 各医院对应的诊断icd 前端控制器
 * </p>
 *
 * @author wangyu
 * @since 2019-02-14
 */
@RestController
@RequestMapping("/diseaseIcd")
@Api(value = "对应的诊断icd API", tags = { "对应的诊断icd API" })
public class TranDiseaseIcdController {
    @Autowired
    TranDiseaseIcdFacade tranDiseaseIcdFacade;

    @ApiOperation(value = "各医院对应的诊断icd——查询[by:wangyu]",
            notes = "questions：疾病id，必填<br>" +
                    "hospitalCode:医院编号，必填<br>")
    @PostMapping("/getDiseaseIcds")
    @SysLogger("getDiseaseIcds")
    /*@ApiIgnore*/
    public RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody @Valid GetDiseaseIcdVO getDiseaseIcdVO){
        List<GetDiseaseIcdDTO> data = tranDiseaseIcdFacade.getDiseaseIcds(getDiseaseIcdVO);
        return RespDTO.onSuc(data);
    }
}
