package com.diagbot.client;

import com.diagbot.client.hystrix.TranServiceHystrix;
import com.diagbot.dto.DoctorInfoDTO;
import com.diagbot.dto.GetDiseaseIcdDTO;
import com.diagbot.dto.GetTopPatientInfoDTO;
import com.diagbot.dto.HospitalDeptInfoDTO;
import com.diagbot.dto.HospitalInfoDTO;
import com.diagbot.dto.LisConfigDTO;
import com.diagbot.dto.PatientInfoDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.dto.TranFieldInfoDTO;
import com.diagbot.entity.DoctorInfo;
import com.diagbot.entity.HospitalDept;
import com.diagbot.entity.PatientInfo;
import com.diagbot.vo.DoctorInfoVO;
import com.diagbot.vo.GetDiseaseIcdVO;
import com.diagbot.vo.GetTopPatientInfoVO;
import com.diagbot.vo.HosCodeVO;
import com.diagbot.vo.HospitalDeptInfoVO;
import com.diagbot.vo.HospitalInfoVO;
import com.diagbot.vo.LisHospitalCodeVO;
import com.diagbot.vo.PatientInfoVO;
import com.diagbot.vo.SaveInquiryToHisVO;
import com.diagbot.vo.TranFieldInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

/**
 * @Description: 调用信息对接层服务
 * @author: gaodm
 * @time: 2019/2/1 17:00
 */
@FeignClient(value = "tran-service", fallback = TranServiceHystrix.class)
public interface TranServiceClient {

    /**
     * 获取医生信息
     *
     * @param doctorInfoVo
     * @return
     */
    @PostMapping("/doctorInfo/getDoctorInfo")
    RespDTO<List<DoctorInfoDTO>> getDoctorInfo(@RequestBody DoctorInfoVO doctorInfoVo);

    /**
     * 根据ids获取医生信息map
     *
     * @param ids
     * @return
     */
    @PostMapping("/doctorInfo/doctorInfoMapByIds")
    RespDTO<Map<Long, DoctorInfo>> doctorInfoMapByIds(@RequestBody List<Long> ids);

    /**
     * 获取科室信息
     *
     * @param hospitalDeptInfoVO
     * @return
     */
    @PostMapping("/hospitalDeptInfo/getHospitalDeptInfo")
    RespDTO<HospitalDeptInfoDTO> getHospitalDeptInfo(@RequestBody HospitalDeptInfoVO hospitalDeptInfoVO);

    /**
     * 根据ids获取科室信息map
     *
     * @param ids
     * @return
     */
    @PostMapping("/hospitalDeptInfo/hospitalDeptInfoMapByIds")
    RespDTO<Map<Long, HospitalDept>> hospitalDeptInfoMapByIds(@RequestBody List<Long> ids);

    /**
     * 获取医院信息
     *
     * @param hospitalInfoVO
     * @return
     */
    @PostMapping("/hospitalInfo/getHospitalInfo")
    RespDTO<List<HospitalInfoDTO>> getHospitalInfo(@RequestBody HospitalInfoVO hospitalInfoVO);

    /**
     * 匹配公表名
     *
     * @param lisHospitalCodeVO
     * @return
     */
    @PostMapping("/tranLisConfig/getLisConfigByhospitalId")
    RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(@RequestBody LisHospitalCodeVO lisHospitalCodeVO);

    /**
     * 获取患者信息
     *
     * @param patientInfoVO
     * @return
     */
    @PostMapping("/patientInfo/getPatientInfo")
    RespDTO<PatientInfoDTO> getPatientInfo(@RequestBody PatientInfoVO patientInfoVO);

    /**
     * 获取页面顶部病人医生科室信息
     *
     * @param getTopPatientInfoVO
     * @return
     */
    @PostMapping("/patientInfo/getTopPatientInfo")
    RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);

    /**
     * 根据ids获取病人信息
     *
     * @param ids
     * @return
     */
    @PostMapping("/patientInfo/patientInfoMapByIds")
    RespDTO<Map<Long, PatientInfo>> patientInfoMapByIds(@RequestBody List<Long> ids);

    /**
     * 根据uuid获取相关信息
     *
     * @param tranFieldInfoVO
     * @return
     */
    @PostMapping("/tranFieldInfo/getInfoByUuid")
    RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(@RequestBody TranFieldInfoVO tranFieldInfoVO);

    /**
     * 根据医院编号疾病id获取各医院对应的诊断icd
     *
     * @param getDiseaseIcdVO
     * @return
     */
    @PostMapping("/diseaseIcd/getDiseaseIcds")
    RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody GetDiseaseIcdVO getDiseaseIcdVO);

    /**
     * 将问诊保存的一些相关信息发送到对接层
     *
     * @param saveInquiryToHisVO
     * @return
     */
    @PostMapping("/inquiryInfo/saveInquiryToHis")
    RespDTO<Boolean> saveInquiryToHis(@RequestBody SaveInquiryToHisVO saveInquiryToHisVO);


    /**
     * 根据医院编码获取化验公表映射关系-itemName不为空
     *
     * @param hosCodeVO
     * @return
     */
    @PostMapping("/tranLisConfig/getLisConfigByHosCode_NotEmptyItemName")
    RespDTO<Map<String, Map<String, String>>> getLisConfigByHosCode_NotEmptyItemName(@RequestBody HosCodeVO hosCodeVO);

    /**
     * 根据医院编码获取化验公表映射关系-itemName为空
     *
     * @param hosCodeVO
     * @return
     */
    @PostMapping("/tranLisConfig/getLisConfigByHosCode_EmptyItemName")
    RespDTO<Map<String, String>> getLisConfigByHosCode_EmptyItemName(@RequestBody HosCodeVO hosCodeVO);

    /**
     * 根据医院编码获取辅检公表映射关系
     *
     * @param hosCodeVO
     * @return
     */
    @PostMapping("/pacsConfig/getPacsConfigByHosCode")
    RespDTO<Map<String, String>> getPacsConfigByHosCode(@RequestBody HosCodeVO hosCodeVO);

    /**
     * 根据医院编码获取提示信息标题映射关系
     *
     * @param hosCodeVO
     * @return
     */
    @PostMapping("/introduceTitleConfig/getTitleMappingHosCode")
    RespDTO<Map<String, String>> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO);

    /**
     * 根据医院编码查询诊断icd映射
     *
     * @param hosCodeVO
     * @return
     */
    @PostMapping("/diseaseIcd/getDiseaseIcdByHosCode")
    RespDTO<Map<String, String>> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO);

    /**
     * 数据服务模式是否对外对接
     *
     * @return
     */
    @PostMapping("/dataService/isDocking")
    RespDTO<Boolean> isDocking();
}