package com.lantone.client.hystrix;

import com.diagbot.dto.RespDTO;
import com.lantone.client.CdssCoreClient;
import com.lantone.dto.med.IndexBatchDTO;
import com.lantone.dto.med.KllisDetailDTO;
import com.lantone.facade.med.KlConceptFacade;
import com.lantone.vo.med.ConceptVO;
import com.lantone.vo.med.FilterVO;
import com.lantone.vo.med.IndexByApprovalVO;
import com.lantone.vo.med.KllisDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

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

//import com.lantone.dto.ConceptScaleDTO;

/**
 * @Description: 病历质控客户端（请求失败熔断）
 * @author: gaodm
 * @time: 2020/7/28 9:29
 */
@Component
@Slf4j
public class CdssCoreHystrix implements CdssCoreClient {


    @Autowired
    private KlConceptFacade klConceptFacade;

    /**
     * 国药准字匹配
     *
     * @param indexByApprovalVO
     * @return
     */
    @Override
    public RespDTO<List<IndexBatchDTO>> indexByApproval(IndexByApprovalVO indexByApprovalVO) {
        List<com.lantone.dto.med.IndexBatchDTO> data = klConceptFacade.indexByApproval(indexByApprovalVO);
        return RespDTO.onSuc(data);
    }


    /**
     * 术语关联医学术语检索
     *
     * @param filterVO
     * @return
     */
    @Override
    public RespDTO<List<IndexBatchDTO>> filter(FilterVO filterVO) {
        List<com.lantone.dto.med.IndexBatchDTO> data = klConceptFacade.filter(filterVO);
        return RespDTO.onSuc(data);
    }

    /**
     * 术语批量校验
     *
     * @param conceptVO
     * @return
     */
    @Override
    public RespDTO<List<IndexBatchDTO>> getConceptNames(ConceptVO conceptVO) {
        List<com.lantone.dto.med.IndexBatchDTO> data = klConceptFacade.getConceptNames(conceptVO);
        return RespDTO.onSuc(data);
    }

    /**
     * 化验小项术语批量查询获取范围
     *
     * @param kllisDetailVO
     * @return
     */
    @Override
    public RespDTO<Map<String, KllisDetailDTO>> getLisDetaisByNames(KllisDetailVO kllisDetailVO) {
        return RespDTO.onSuc(klConceptFacade.getLisDetaisByNamesFac(kllisDetailVO));
    }


}