package com.lantone.web.med;

import com.diagbot.dto.RespDTO;
import com.lantone.dto.med.TermConceptDTO;
import com.lantone.facade.med.TermMatchingFacade;
import com.lantone.vo.med.TermMatchingVO;
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;

/**
 * @author wangfeng
 * @Description:
 * @date 2021-06-10 19:43
 */
@RestController
@RequestMapping("/term")
@Api(value = "术语匹配相关API", tags = { "术语匹配相关API" })
@SuppressWarnings("unchecked")
public class TermMatchingController {
    @Autowired
    private TermMatchingFacade termMatchingFacade;

    @ApiOperation(value = "术语匹配搜索[wangfeng]",
            notes = "type： 类型：1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>" +
                    "inputStr： 检索内容<br>")
    @PostMapping("/termMatching")
    public RespDTO<List<TermConceptDTO>> getTermMatching(@Valid @RequestBody TermMatchingVO termMatchingVO) {
        List<TermConceptDTO> data = termMatchingFacade.getTermMatchingAll(termMatchingVO);
        return RespDTO.onSuc(data);
    }
}
