Browse Source

1、配置
2、术语关联

zhaops 4 years ago
parent
commit
fa8bda70f6
35 changed files with 1619 additions and 67 deletions
  1. 153 0
      cdssman-service/src/main/java/com/diagbot/client/CdssClient.java
  2. 9 12
      cdssman-service/src/main/java/com/diagbot/client/CdssCoreClient.java
  3. 3 3
      cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java
  4. 101 0
      cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssHystrix.java
  5. 19 0
      cdssman-service/src/main/java/com/diagbot/config/FeignMultipartSupportConfig.java
  6. 19 0
      cdssman-service/src/main/java/com/diagbot/dto/IndexBatchDTO.java
  7. 300 0
      cdssman-service/src/main/java/com/diagbot/entity/MappingConfig.java
  8. 49 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java
  9. 7 1
      cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  10. 66 0
      cdssman-service/src/main/java/com/diagbot/enums/MatchSourceEnum.java
  11. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/DeptConfigFacade.java
  12. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/DiseaseConfigFacade.java
  13. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java
  14. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/LisConfigFacade.java
  15. 485 0
      cdssman-service/src/main/java/com/diagbot/facade/MappingConfigFacade.java
  16. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/NurseConfigFacade.java
  17. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java
  18. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java
  19. 15 12
      cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeFacade.java
  20. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/ScaleConfigFacade.java
  21. 4 4
      cdssman-service/src/main/java/com/diagbot/facade/TransfusionConfigFacade.java
  22. 15 0
      cdssman-service/src/main/java/com/diagbot/mapper/MappingConfigMapper.java
  23. 15 0
      cdssman-service/src/main/java/com/diagbot/service/MappingConfigService.java
  24. 19 0
      cdssman-service/src/main/java/com/diagbot/service/impl/MappingConfigServiceImpl.java
  25. 4 3
      cdssman-service/src/main/java/com/diagbot/vo/ConceptVO.java
  26. 18 0
      cdssman-service/src/main/java/com/diagbot/vo/FilterVO.java
  27. 74 0
      cdssman-service/src/main/java/com/diagbot/vo/MappingConfigPageVO.java
  28. 21 0
      cdssman-service/src/main/java/com/diagbot/vo/MappingConfigVO.java
  29. 147 0
      cdssman-service/src/main/java/com/diagbot/web/MappingConfigController.java
  30. 24 0
      cdssman-service/src/main/resources/mapper/MappingConfigMapper.xml
  31. 4 0
      config-server/src/main/resources/shared/cdssman-service-dev.yml
  32. 4 0
      config-server/src/main/resources/shared/cdssman-service-local.yml
  33. 4 0
      config-server/src/main/resources/shared/cdssman-service-pre.yml
  34. 4 0
      config-server/src/main/resources/shared/cdssman-service-pro.yml
  35. 4 0
      config-server/src/main/resources/shared/cdssman-service-test.yml

+ 153 - 0
cdssman-service/src/main/java/com/diagbot/client/CdssClient.java

@@ -0,0 +1,153 @@
+package com.diagbot.client;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.hystrix.CdssHystrix;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.MappingConfigPageVO;
+import com.diagbot.vo.MappingConfigVO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/21 15:33
+ */
+@FeignClient(name = "cdss", url = "${cdss.url}", fallback = CdssHystrix.class)
+public interface CdssClient {
+    /**
+     * 数据导入模板导出
+     *
+     * @param mappingConfigVO
+     */
+    @PostMapping("/tran/mappingConfig/exportExcelModule")
+    void exportExcelModule(@RequestBody @Valid MappingConfigVO mappingConfigVO);
+
+    /**
+     * 预匹配
+     *
+     * @param file
+     * @param response
+     * @param type
+     */
+    @PostMapping(value = "/tran/mappingConfig/precDataMatch", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    void precDataMatch(@RequestParam("file") MultipartFile file,
+                       HttpServletResponse response,
+                       @RequestParam("type") Integer type);
+
+    /**
+     * 预匹配_远程调用
+     *
+     * @param file
+     * @param type
+     * @return
+     */
+    @PostMapping(value = "/tran/mappingConfig/precDataMatch_remote", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    RespDTO<List<MappingConfigWrapper>> precDataMatch_remote(@RequestPart("file") MultipartFile file,
+                                                             @RequestParam("type") Integer type);
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     * @param userId
+     */
+    @PostMapping("/tran/mappingConfig/importExcel")
+    @Transactional
+    void importExcel(@RequestParam("file") MultipartFile file,
+                     @RequestParam("hospitalId") Long hospitalId,
+                     @RequestParam("type") Integer type,
+                     @RequestParam("uesrId") String userId);
+
+
+    /**
+     * 数据导出_远程调用
+     *
+     * @param mappingConfigPageVO
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/exportExcel_remote")
+    RespDTO<List<MappingConfigWrapper>> exportExcel_remote(@RequestBody @Valid MappingConfigPageVO mappingConfigPageVO);
+
+    /**
+     * 分页查询
+     *
+     * @param mappingConfigPageVO
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/getPage")
+    RespDTO<Page<MappingConfigWrapper>> getPage(@RequestBody @Valid MappingConfigPageVO mappingConfigPageVO);
+
+
+    /**
+     * 获取映射关系
+     *
+     * @param idVO
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/getRecord")
+    @Transactional
+    RespDTO<MappingConfigWrapper> getRecord(@RequestBody @Valid IdVO idVO);
+
+    /**
+     * 映射关系是否已存在
+     *
+     * @param mappingConfig
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/isExistRecord")
+    RespDTO<Boolean> isExistRecord(@RequestBody @Valid MappingConfig mappingConfig);
+
+    /**
+     * 查询已映射关系
+     *
+     * @param mappingConfigVO
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/getRelatedMapping")
+    RespDTO<List<MappingConfigWrapper>> getRelatedMapping(@RequestBody @Valid MappingConfigVO mappingConfigVO);
+
+
+    /**
+     * 保存或修改映射关系
+     *
+     * @param mappingConfig
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/saveOrUpdateRecord")
+    RespDTO<Boolean> saveOrUpdateRecord(@RequestBody @Valid MappingConfig mappingConfig);
+
+    /**
+     * 删除映射关系
+     *
+     * @param idVO
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/deleteRecord")
+    RespDTO<Boolean> deleteRecord(@RequestBody @Valid IdVO idVO);
+
+    /**
+     * 批量删除映射关系
+     *
+     * @param idListVO
+     * @return
+     */
+    @PostMapping("/tran/mappingConfig/deleteRecords")
+    RespDTO<Boolean> deleteRecords(@RequestBody @Valid IdListVO idListVO);
+}

+ 9 - 12
cdssman-service/src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -1,11 +1,10 @@
 package com.diagbot.client;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.annotation.SysLogger;
 import com.diagbot.client.hystrix.CdssCoreHystrix;
 import com.diagbot.dto.DiagnosesFindDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
 import com.diagbot.dto.KlDiagnoseInfoDTO;
@@ -18,14 +17,10 @@ import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.dto.TermConceptDTO;
 import com.diagbot.entity.KlRuleMenuWrapper;
-import com.diagbot.enums.StatusEnum;
 import com.diagbot.vo.*;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
 
 import javax.validation.Valid;
 import java.util.List;
@@ -63,7 +58,7 @@ public interface CdssCoreClient {
      * @return
      */
     @PostMapping("/retrieval/getConceptNames")
-    RespDTO<List<String>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO);
+    RespDTO<List<IndexBatchDTO>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO);
 
     /**
      * 化验大项、化验小项、辅检、诊断、药品、手术等检索
@@ -138,14 +133,15 @@ public interface CdssCoreClient {
     RespDTO<Boolean> isExist(@Valid @RequestBody KlConceptStaticVO klConceptStaticVO);
 
     /**
-     *获取规则下拉菜单信息
+     * 获取规则下拉菜单信息
+     *
      * @param klRuleMenuVO
      * @return
      */
     @PostMapping("/klRulePlan/getMenu")
     RespDTO<List<KlRuleMenuWrapper>> getMenus(@RequestBody KlRuleMenuVO klRuleMenuVO);
 
-   //"分页获取规则维护列表
+    //"分页获取规则维护列表
     @PostMapping("/klRule/getKlRuleInfoPage")
     RespDTO<Page<KlRuleInfoDTO>> getKlRuleInfoPages(@RequestBody KlRuleInfoVO klRuleInfoVO);
 
@@ -166,7 +162,7 @@ public interface CdssCoreClient {
     @PostMapping("/klRule/disableRuleInfo")
     RespDTO<Boolean> disableRuleInfos(@RequestBody @Valid KlRuleSatartOrdisaVO klRuleSatartOrdisaVO);
 
-   //启用规则
+    //启用规则
     @PostMapping("/klRule/startRuleInfo")
     RespDTO<Boolean> startRuleInfos(@RequestBody @Valid KlRuleSatartOrdisaVO klRuleSatartOrdisaVO);
 
@@ -187,13 +183,14 @@ public interface CdssCoreClient {
 
     /**
      * 重新加载医学知识库中的所有去重的基础诊断依据
+     *
      * @return
      */
     @PostMapping("/cache/reloadDiagnose")
     RespDTO<Boolean> reloadDiagnose();
 
 
-   //分页获取诊断依据维护列表
+    //分页获取诊断依据维护列表
     @PostMapping("/klDiagnose/getKlDiagnosePage")
     public RespDTO<Page<KlDiagnoseInfoDTO>> getDiagnosePages(@RequestBody KlDiagnoseInfoVO klRuleInfoVO);
 
@@ -203,7 +200,7 @@ public interface CdssCoreClient {
 
     //保存诊断依据详情[by:wangfeng]")
     @PostMapping("/klDiagnose/saveDiagnose")
-    public RespDTO<Boolean> saveDiagnoseAll(@RequestBody @Valid KlDiagnoseSaveVO klDiagnoseSaveVO) ;
+    public RespDTO<Boolean> saveDiagnoseAll(@RequestBody @Valid KlDiagnoseSaveVO klDiagnoseSaveVO);
 
     //刪除诊断依据详情[by:wangfeng]")
     @PostMapping("/klDiagnose/clearDiagnose")

+ 3 - 3
cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java

@@ -1,10 +1,10 @@
 package com.diagbot.client.hystrix;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.DiagnosesFindDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
 import com.diagbot.dto.KlDiagnoseInfoDTO;
@@ -65,7 +65,7 @@ public class CdssCoreHystrix implements CdssCoreClient {
      * @return
      */
     @Override
-    public RespDTO<List<String>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO) {
+    public RespDTO<List<IndexBatchDTO>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO) {
         log.error("【hystrix】调用{}异常", "getConceptNames");
         return null;
     }
@@ -291,4 +291,4 @@ public class CdssCoreHystrix implements CdssCoreClient {
         log.error("【hystrix】调用{}异常", "getTermMatching");
         return null;
     }
-}
+}

+ 101 - 0
cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssHystrix.java

@@ -0,0 +1,101 @@
+package com.diagbot.client.hystrix;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.CdssClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.MappingConfigPageVO;
+import com.diagbot.vo.MappingConfigVO;
+import feign.FeignException;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/21 15:33
+ */
+@Component
+@Slf4j
+public class CdssHystrix implements CdssClient {
+    @Override
+    public void exportExcelModule(@Valid MappingConfigVO mappingConfigVO) {
+        log.error("【hystrix】调用{}异常", "exportExcelModule");
+    }
+
+    @Override
+    public void precDataMatch(MultipartFile file, HttpServletResponse response, Integer type) {
+        log.error("【hystrix】调用{}异常", "precDataMatch");
+    }
+
+    @Override
+    public RespDTO<List<MappingConfigWrapper>> precDataMatch_remote(@RequestPart("file") MultipartFile file,
+                                                                    @RequestParam("type") Integer type) throws FeignException {
+        log.error("【hystrix】调用{}异常", "precDataMatch_remote");
+        return null;
+    }
+
+    @Override
+    public void importExcel(MultipartFile file, Long hospitalId, Integer type, String userId) {
+        log.error("【hystrix】调用{}异常", "importExcel");
+    }
+
+    @Override
+    public RespDTO<List<MappingConfigWrapper>> exportExcel_remote(@RequestBody @Valid MappingConfigPageVO mappingConfigPageVO) {
+        log.error("【hystrix】调用{}异常", "exportExcel_remote");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Page<MappingConfigWrapper>> getPage(@Valid MappingConfigPageVO mappingConfigPageVO) {
+        log.error("【hystrix】调用{}异常", "getPage");
+        return null;
+    }
+
+    @Override
+    public RespDTO<MappingConfigWrapper> getRecord(@Valid IdVO idVO) {
+        log.error("【hystrix】调用{}异常", "getRecord");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> isExistRecord(@Valid MappingConfig mappingConfig) {
+        log.error("【hystrix】调用{}异常", "isExistRecord");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<MappingConfigWrapper>> getRelatedMapping(@Valid MappingConfigVO mappingConfigVO) {
+        log.error("【hystrix】调用{}异常", "getRelatedMapping");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> saveOrUpdateRecord(@Valid MappingConfig mappingConfig) {
+        log.error("【hystrix】调用{}异常", "saveOrUpdateRecord");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> deleteRecord(@Valid IdVO idVO) {
+        log.error("【hystrix】调用{}异常", "deleteRecord");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> deleteRecords(@Valid IdListVO idListVO) {
+        log.error("【hystrix】调用{}异常", "deleteRecords");
+        return null;
+    }
+}

+ 19 - 0
cdssman-service/src/main/java/com/diagbot/config/FeignMultipartSupportConfig.java

@@ -0,0 +1,19 @@
+package com.diagbot.config;
+
+import feign.codec.Encoder;
+import feign.form.spring.SpringFormEncoder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/22 15:26
+ */
+@Configuration
+public class FeignMultipartSupportConfig {
+    @Bean
+    public Encoder feignFormEncoder() {
+        return new SpringFormEncoder();
+    }
+}

+ 19 - 0
cdssman-service/src/main/java/com/diagbot/dto/IndexBatchDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/7 10:27
+ */
+@Getter
+@Setter
+public class IndexBatchDTO {
+    private Long id;
+    private String name;
+    private String code;
+    private String synonyms;
+    private Integer type;
+}

+ 300 - 0
cdssman-service/src/main/java/com/diagbot/entity/MappingConfig.java

@@ -0,0 +1,300 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 医学术语映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+@TableName("tran_mapping_config")
+public class MappingConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉)
+     */
+    private Integer type;
+
+    /**
+     * 医院术语名称
+     */
+    private String hisName;
+
+    /**
+     * 医院术语编码
+     */
+    private String hisCode;
+
+    /**
+     * 医院术语细项名称(检验细项)
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String hisDetailName;
+
+    /**
+     * 医学标准术语id
+     */
+    private Long conceptId;
+
+    /**
+     * 药品剂型id
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private Long formConceptId;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    private Integer source;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getHisCode() {
+        return hisCode;
+    }
+
+    public void setHisCode(String hisCode) {
+        this.hisCode = hisCode;
+    }
+
+    public String getHisDetailName() {
+        return hisDetailName;
+    }
+
+    public void setHisDetailName(String hisDetailName) {
+        this.hisDetailName = hisDetailName;
+    }
+
+    public Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+
+    public Long getFormConceptId() {
+        return formConceptId;
+    }
+
+    public void setFormConceptId(Long formConceptId) {
+        this.formConceptId = formConceptId;
+    }
+
+    public Integer getIsMatch() {
+        return isMatch;
+    }
+
+    public void setIsMatch(Integer isMatch) {
+        this.isMatch = isMatch;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "MappingConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", type=" + type +
+                ", hisName=" + hisName +
+                ", hisCode=" + hisCode +
+                ", hisDetailName=" + hisDetailName +
+                ", conceptId=" + conceptId +
+                ", formConceptId=" + formConceptId +
+                ", isMatch=" + isMatch +
+                ", source=" + source +
+                ", remark=" + remark +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MappingConfig mappingConfig = (MappingConfig) o;
+        return Objects.equals(id, mappingConfig.id)
+                && Objects.equals(isDeleted, mappingConfig.isDeleted)
+                && Objects.equals(hospitalId, mappingConfig.hospitalId)
+                && Objects.equals(type, mappingConfig.type)
+                && Objects.equals(hisName, mappingConfig.hisName)
+                && Objects.equals(hisCode, mappingConfig.hisCode)
+                && Objects.equals(hisDetailName, mappingConfig.hisDetailName)
+                && Objects.equals(conceptId, mappingConfig.conceptId)
+                && Objects.equals(formConceptId, mappingConfig.formConceptId)
+                && Objects.equals(isMatch, mappingConfig.isMatch)
+                //&& Objects.equals(source, mappingConfig.source)
+                ;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, type, hisName, hisCode, hisDetailName, conceptId, formConceptId, isMatch);
+    }
+
+    public static boolean nonNull(MappingConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && o.type == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.hisCode)
+                && StringUtil.isBlank(o.hisDetailName)
+                && o.conceptId == null
+                && o.formConceptId == null
+                && o.isMatch == null
+                && o.source == null));
+    }
+}

+ 49 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java

@@ -0,0 +1,49 @@
+package com.diagbot.entity.wrapper;
+
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.util.StringUtil;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Objects;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/10 19:27
+ */
+@Getter
+@Setter
+public class MappingConfigWrapper extends MappingConfig {
+    private String uniqueName;
+    private String form;
+    private String code;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MappingConfigWrapper mappingConfigWrapper = (MappingConfigWrapper) o;
+        return super.equals(o)
+                && Objects.equals(uniqueName, mappingConfigWrapper.uniqueName)
+                && Objects.equals(form, mappingConfigWrapper.form)
+                && Objects.equals(code, mappingConfigWrapper.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(uniqueName, form, code) + super.hashCode();
+    }
+
+    public static boolean nonNull(MappingConfigWrapper o) {
+        return !(o == null
+                || (StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.form)
+                && StringUtil.isBlank(o.code)))
+                || MappingConfig.nonNull(o);
+    }
+}

+ 7 - 1
cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -17,8 +17,14 @@ public enum ConceptTypeEnum implements KeyedNamed {
     Operation(6, "手术和操作"),
     Dept(7, "科室"),
     Transfusion(8, "输血"),
+    Symptom(9,"症状"),
+    //PacsSubName(9, "检查子项"),
     Scale(10, "量表"),
-    Nurse(11, "护理");
+    Nurse(11, "护理"),
+    Tcmdisease(12,"中医疾病"),
+    Tcmsyndrome(13,"中医证候"),
+    Anesthesia(14, "麻醉"),
+    Form(15, "药品剂型");
 
     @Setter
     private int key;

+ 66 - 0
cdssman-service/src/main/java/com/diagbot/enums/MatchSourceEnum.java

@@ -0,0 +1,66 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/15 13:20
+ */
+public enum MatchSourceEnum implements KeyedNamed {
+    StandWord(1, "标准词"),
+    SynonymsWord(2, "同义词"),
+    Code(3,"编码"),
+    History(4,"历史数据"),
+    SimilarWord(5,"相似词");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    MatchSourceEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static MatchSourceEnum getEnum(int key) {
+        for (MatchSourceEnum item : MatchSourceEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static MatchSourceEnum getEnum(String name) {
+        for (MatchSourceEnum item : MatchSourceEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        MatchSourceEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        MatchSourceEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/DeptConfigFacade.java

@@ -331,7 +331,7 @@ public class DeptConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+       /* List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = deptConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -352,7 +352,7 @@ public class DeptConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         deptConfigList = deptConfigList
@@ -493,7 +493,7 @@ public class DeptConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Dept.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -518,7 +518,7 @@ public class DeptConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -305,7 +305,7 @@ public class DiseaseConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = diseaseConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -326,7 +326,7 @@ public class DiseaseConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         diseaseConfigList = diseaseConfigList
@@ -505,7 +505,7 @@ public class DiseaseConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Disease.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -529,7 +529,7 @@ public class DiseaseConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -375,7 +375,7 @@ public class DrugConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.Drug.getKey());
@@ -392,7 +392,7 @@ public class DrugConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         drugConfigList = drugConfigList
@@ -758,7 +758,7 @@ public class DrugConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Drug.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -788,7 +788,7 @@ public class DrugConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -364,7 +364,7 @@ public class LisConfigFacade{
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+       /* List<String> errorNumList = Lists.newLinkedList();
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.LisPack.getKey());
@@ -393,7 +393,7 @@ public class LisConfigFacade{
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         lisConfigList = lisConfigList
@@ -609,7 +609,7 @@ public class LisConfigFacade{
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.LisPack.getKey());
         RespDTO<List<String>> respLisPackDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -643,7 +643,7 @@ public class LisConfigFacade{
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 485 - 0
cdssman-service/src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -0,0 +1,485 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.CdssClient;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.MatchSourceEnum;
+import com.diagbot.service.impl.MappingConfigServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.MappingConfigPageVO;
+import com.diagbot.vo.MappingConfigVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/9 14:19
+ */
+@Component
+public class MappingConfigFacade extends MappingConfigServiceImpl {
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+    @Autowired
+    private CdssClient cdssClient;
+    @Autowired
+    private DictionaryFacade dictionaryFacade;
+
+
+    /**
+     * 剂型说明
+     *
+     * @return
+     */
+    private String getForm() {
+        String form = "药品模板——药品剂型填写说明[不填";
+        //药品剂型
+        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(9);
+        if (ListUtil.isNotEmpty(dicTypeMappingList)) {
+            String formList = dicTypeMappingList.stream()
+                    .filter(i -> StringUtil.isNotBlank(i.getName()))
+                    .map(i -> i.getName())
+                    .distinct()
+                    .collect(Collectors.joining("、"));
+            if (StringUtil.isNotBlank(formList)) {
+                form += "、" + formList;
+            }
+        }
+        form += "]";
+        return form;
+    }
+
+
+    /**
+     * 分页查询
+     *
+     * @param mappingConfigPageVO
+     * @return
+     */
+    public IPage<MappingConfigWrapper> getPage(MappingConfigPageVO mappingConfigPageVO) {
+        Page<MappingConfigWrapper> page = null;
+        RespDTO<Page<MappingConfigWrapper>> respDTO = cdssClient.getPage(mappingConfigPageVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            page = respDTO.data;
+        }
+        return page;
+    }
+
+    /**
+     * 导入模板下载
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response, MappingConfigVO mappingConfigVO) {
+        cdssClient.exportExcelModule( mappingConfigVO);
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response, MappingConfigPageVO mappingConfigPageVO) {
+        RespDTO<List<MappingConfigWrapper>> respDTO = cdssClient.exportExcel_remote(mappingConfigPageVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+
+        }
+    }
+
+
+    /**
+     * 导入数据预匹配
+     *
+     * @param file
+     * @param type
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file, Integer type, HttpServletResponse response) {
+
+        RespDTO<List<MappingConfigWrapper>> respDTO = cdssClient.precDataMatch_remote(file, type);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+
+        }
+    }
+
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     */
+    public void importExcel(MultipartFile file, Long hospitalId, Integer type, String userId) {
+        if (StringUtil.isBlank(userId)) {
+            userId = UserUtils.getCurrentPrincipleID();
+        }
+        cdssClient.importExcel(file, hospitalId, type, userId);
+    }
+
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        RespDTO<Boolean> respDTO = cdssClient.deleteRecord(idVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        RespDTO<Boolean> respDTO = cdssClient.deleteRecords(idListVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 获取记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public MappingConfigWrapper getRecord(IdVO idVO) {
+        RespDTO<MappingConfigWrapper> respDTO = cdssClient.getRecord(idVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 查询已关联关系
+     *
+     * @param mappingConfigVO
+     * @return
+     */
+    public List<MappingConfigWrapper> getRelatedMapping(MappingConfigVO mappingConfigVO) {
+        RespDTO<List<MappingConfigWrapper>> respDTO = cdssClient.getRelatedMapping(mappingConfigVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            return new ArrayList<>();
+        }
+    }
+
+    /**
+     * 判断是否已存在
+     *
+     * @param mappingConfig
+     * @return
+     */
+    public Boolean isExistRecord(MappingConfig mappingConfig) {
+        RespDTO<Boolean> respDTO = cdssClient.isExistRecord(mappingConfig);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param mappingConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(MappingConfig mappingConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        mappingConfig.setModifier(userId);
+        mappingConfig.setCreator(userId);
+        RespDTO<Boolean> respDTO = cdssClient.saveOrUpdateRecord(mappingConfig);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            return false;
+        }
+    }
+
+
+    /**
+     * 根据医院名称分组-返回id
+     *
+     * @param hisNames
+     * @param type
+     * @return
+     */
+    public Map<String, Map<String, Map<Long, List<Long>>>> groupByHisNameWithId(List<String> hisNames, Integer type, Long hospitalId) {
+        Map<String, Map<String, Map<Long, List<Long>>>> retMap = new HashMap<>();
+        QueryWrapper<MappingConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("is_match", 1)
+                .eq("type", type);
+        if (hospitalId != null) {
+            queryWrapper.eq("hospital_id", hospitalId);
+        }
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        List<MappingConfig> list = this.list(queryWrapper);
+
+        if (ListUtil.isEmpty(list)) {
+            return retMap;
+        }
+
+        for (MappingConfig item : list) {
+            if (StringUtil.isBlank(item.getHisDetailName())) {
+                item.setHisDetailName("");
+            }
+        }
+
+        Map<String, List<MappingConfig>> hisMap = list.stream().collect(Collectors.groupingBy(MappingConfig::getHisName));
+        for (Map.Entry<String, List<MappingConfig>> entry : hisMap.entrySet()) {
+            Map<String, Map<Long, List<Long>>> subMap = new HashMap<>();
+            Map<String, List<MappingConfig>> detailMap = entry.getValue().stream()
+                    .collect(Collectors.groupingBy(MappingConfig::getHisDetailName));
+            for (Map.Entry<String, List<MappingConfig>> subEntry : detailMap.entrySet()) {
+                subMap.put(subEntry.getKey(), subEntry.getValue().stream().collect(Collectors.groupingBy(MappingConfig::getConceptId,
+                        Collectors.mapping(MappingConfig::getFormConceptId, Collectors.toList()))));
+            }
+            retMap.put(entry.getKey(), subMap);
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院名称分组-返回名称
+     *
+     * @param hisNames
+     * @param type
+     * @param hospitalId
+     * @return
+     */
+    public Map<String, Map<String, Map<String, List<String>>>> groupByHisNameWithName(List<String> hisNames, Integer type, Long hospitalId) {
+        Map<String, Map<String, Map<String, List<String>>>> retMap = new HashMap<>();
+        Map<String, Map<String, Map<Long, List<Long>>>> idMap = groupByHisNameWithId(hisNames, type, hospitalId);
+
+        //conceptIds
+        List<Long> ids = idMap.values()
+                .stream()
+                .flatMap(i -> i.values().stream())
+                .map(i -> i.keySet())
+                .flatMap(Collection::stream)
+                .filter(i -> i != null)
+                .distinct()
+                .collect(Collectors.toList());
+
+        //formConceptId
+        ids.addAll(idMap.values()
+                .stream()
+                .flatMap(i -> i.values().stream())
+                .flatMap(i -> i.values().stream())
+                .flatMap(Collection::stream)
+                .filter(i -> i != null)
+                .distinct()
+                .collect(Collectors.toList()));
+
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setSource(-1);
+        conceptVO.setType(type);
+        conceptVO.setIds(ids);
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<IndexBatchDTO> indexList = respDTO.data;
+        if (ListUtil.isNotEmpty(indexList)) {
+            Map<Long, List<IndexBatchDTO>> indexMap
+                    = indexList.stream().collect(Collectors.groupingBy(IndexBatchDTO::getId));
+            for (Map.Entry<String, Map<String, Map<Long, List<Long>>>> entry : idMap.entrySet()) {
+                Map<String, Map<String, List<String>>> subMap = new HashMap<>();
+                for (Map.Entry<String, Map<Long, List<Long>>> subEntry : entry.getValue().entrySet()) {
+                    Map<String, List<String>> thirdMap = new HashMap<>();
+                    List<String> uniqueNames = Lists.newArrayList();
+                    List<String> forms = Lists.newArrayList();
+                    for (Long conceptId : subEntry.getValue().keySet()) {
+                        uniqueNames.addAll(indexMap.get(conceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                    }
+                    List<Long> formConceptIds = subEntry.getValue().values()
+                            .stream()
+                            .flatMap(Collection::stream)
+                            .distinct()
+                            .collect(Collectors.toList());
+                    for (Long formConceptId : formConceptIds) {
+                        if (formConceptId == null) {
+                            forms.add("");
+                        } else {
+                            forms.addAll(indexMap.get(formConceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                        }
+                    }
+                    forms = forms.stream().distinct().collect(Collectors.toList());
+                    for (String uniqueName : uniqueNames) {
+                        thirdMap.put(uniqueName, forms);
+                    }
+
+                    subMap.put(subEntry.getKey(), thirdMap);
+                }
+                retMap.put(entry.getKey(), subMap);
+            }
+        }
+        return retMap;
+    }
+
+
+    /**
+     * 根据标准名称分组-返回名称
+     *
+     * @param uniqueNames
+     * @param type
+     * @param hospitalId
+     * @return uniqueName, form, hisName, hisDetailName
+     */
+    public Map<String, Map<String, Map<String, List<String>>>> groupByUniqueNameWithName(List<String> uniqueNames, Integer type, Long hospitalId) {
+        Map<String, Map<String, Map<String, List<String>>>> retMap = new HashMap<>();
+
+        List<Long> conceptIds = Lists.newArrayList();
+
+        ConceptVO conceptVO = new ConceptVO();
+        RespDTO<List<IndexBatchDTO>> respDTO = null;
+        List<IndexBatchDTO> indexList = Lists.newArrayList();
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            conceptVO.setType(type);
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setSource(MatchSourceEnum.StandWord.getKey());
+            respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                indexList.addAll(respDTO.data);
+            }
+
+            if (type.equals(ConceptTypeEnum.LisPack.getKey())) {
+                conceptVO.setType(ConceptTypeEnum.Lis.getKey());
+                respDTO = cdssCoreClient.getConceptNames(conceptVO);
+                if (RespDTOUtil.respIsOK(respDTO)) {
+                    indexList.addAll(respDTO.data);
+                }
+            }
+        }
+
+        if (ListUtil.isNotEmpty(indexList)) {
+            conceptIds = indexList.stream().map(IndexBatchDTO::getId).distinct().collect(Collectors.toList());
+        }
+
+        QueryWrapper<MappingConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("is_match", 1)
+                .eq("type", type);
+        if (hospitalId != null) {
+            queryWrapper.eq("hospital_id", hospitalId);
+        }
+        if (ListUtil.isNotEmpty(conceptIds)) {
+            queryWrapper.in("concept_id", conceptIds);
+        }
+        List<MappingConfig> list = this.list(queryWrapper);
+
+        if (ListUtil.isEmpty(list)) {
+            return retMap;
+        }
+
+        List<MappingConfigWrapper> wrapperList = BeanUtil.listCopyTo(list, MappingConfigWrapper.class);
+        wrapperList = addNames(wrapperList);
+        wrapperList.forEach(item -> {
+            if (StringUtil.isBlank(item.getForm())) {
+                item.setForm("");
+            }
+            if (StringUtil.isBlank(item.getHisDetailName())) {
+                item.setHisDetailName("");
+            }
+        });
+
+
+        Map<String, List<MappingConfigWrapper>> map = wrapperList.stream().collect(Collectors.groupingBy(MappingConfigWrapper::getUniqueName));
+
+        for (Map.Entry<String, List<MappingConfigWrapper>> entry : map.entrySet()) {
+            Map<String, Map<String, List<String>>> subMap = new HashMap<>();
+            Map<String, List<MappingConfigWrapper>> formMap
+                    = entry.getValue().stream().collect(Collectors.groupingBy(MappingConfigWrapper::getForm));
+            for (Map.Entry<String, List<MappingConfigWrapper>> subEntry : formMap.entrySet()) {
+                subMap.put(subEntry.getKey(), subEntry.getValue().stream().collect(Collectors.groupingBy(MappingConfigWrapper::getHisName,
+                        Collectors.mapping(MappingConfigWrapper::getHisDetailName, Collectors.toList()))));
+            }
+            retMap.put(entry.getKey(), subMap);
+        }
+
+        return retMap;
+    }
+
+    /**
+     * 返回结果添加标准术语,药品剂型
+     *
+     * @param list
+     * @return
+     */
+    public List<MappingConfigWrapper> addNames(List<MappingConfigWrapper> list) {
+        if (ListUtil.isEmpty(list)) {
+            return list;
+        }
+
+        List<Long> ids = Lists.newArrayList();
+        ids.addAll(list.stream()
+                .filter(i -> i.getConceptId() != null)
+                .map(MappingConfigWrapper::getConceptId)
+                .collect(Collectors.toList()));
+        ids.addAll(list.stream()
+                .filter(i -> i.getFormConceptId() != null)
+                .map(MappingConfigWrapper::getFormConceptId)
+                .collect(Collectors.toList()));
+
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setSource(-1);
+        conceptVO.setIds(ids);
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<Long, IndexBatchDTO> conceptMap
+                    = respDTO.data.stream().collect(Collectors.toMap(IndexBatchDTO::getId, v -> v));
+            for (MappingConfigWrapper record : list) {
+                if (record.getConceptId() != null && conceptMap.containsKey(record.getConceptId())) {
+                    record.setUniqueName(conceptMap.get(record.getConceptId()).getName());
+                    record.setCode(conceptMap.get(record.getConceptId()).getCode());
+                }
+                if (record.getFormConceptId() != null && conceptMap.containsKey(record.getFormConceptId())) {
+                    record.setForm(conceptMap.get(record.getFormConceptId()).getName());
+                }
+            }
+        }
+        return list;
+    }
+}

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/NurseConfigFacade.java

@@ -314,7 +314,7 @@ public class NurseConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = nurseConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -335,7 +335,7 @@ public class NurseConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         nurseConfigList = nurseConfigList
@@ -514,7 +514,7 @@ public class NurseConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Nurse.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -538,7 +538,7 @@ public class NurseConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -314,7 +314,7 @@ public class OperationConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = operationConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -335,7 +335,7 @@ public class OperationConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         operationConfigList = operationConfigList
@@ -514,7 +514,7 @@ public class OperationConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Operation.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -538,7 +538,7 @@ public class OperationConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -312,7 +312,7 @@ public class PacsConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = pacsConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -333,7 +333,7 @@ public class PacsConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         pacsConfigList = pacsConfigList
@@ -512,7 +512,7 @@ public class PacsConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Pacs.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -536,7 +536,7 @@ public class PacsConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 15 - 12
cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeFacade.java

@@ -8,6 +8,7 @@ import com.diagbot.dto.ExportCommonStaticTestDTO;
 import com.diagbot.dto.ExportCommonTestDTO;
 import com.diagbot.dto.ExportLisStaticTestDTO;
 import com.diagbot.dto.ExportLisTestDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DiseaseConfig;
 import com.diagbot.entity.DrugConfig;
@@ -69,6 +70,8 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
     @Autowired
     private KlConceptStaticFacade klConceptStaticFacade;
 
+    @Autowired
+    private MappingConfigFacade mappingConfigFacade;
     @Autowired
     private LisConfigFacade lisConfigFacade;
     @Autowired
@@ -197,16 +200,16 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.LisPack.getKey());
-        RespDTO<List<String>> respLisPackDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTO<List<IndexBatchDTO>> respLisPackDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> lisPackNames = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respLisPackDTO)) {
-            lisPackNames = respLisPackDTO.data;
+            lisPackNames = respLisPackDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
         }
         conceptVO.setType(ConceptTypeEnum.Lis.getKey());
-        RespDTO<List<String>> respLisDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTO<List<IndexBatchDTO>> respLisDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> lisNames = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respLisDTO)) {
-            lisNames = respLisDTO.data;
+            lisNames = respLisDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
         }
 
         //判断是否有标准术语
@@ -395,10 +398,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.Pacs.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> names = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respDTO)) {
-            names = respDTO.data;
+            names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
         }
         for (ResultStaticKnowledge result : mappingList) {
             if (result.getHasStandName() == null || result.getHasStandName().equals(0)) {
@@ -586,10 +589,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.Drug.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> names = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respDTO)) {
-            names = respDTO.data;
+            names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
         }
         for (ResultStaticKnowledge result : mappingList) {
             if (result.getHasStandName() == null || result.getHasStandName().equals(0)) {
@@ -742,10 +745,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.Disease.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> names = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respDTO)) {
-            names = respDTO.data;
+            names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
         }
         for (ResultStaticKnowledge result : mappingList) {
             if (result.getHasStandName() == null || result.getHasStandName().equals(0)) {
@@ -898,10 +901,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
         conceptVO.setType(ConceptTypeEnum.Operation.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> names = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respDTO)) {
-            names = respDTO.data;
+            names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
         }
         for (ResultStaticKnowledge result : mappingList) {
             if (result.getHasStandName() == null || result.getHasStandName().equals(0)) {

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/ScaleConfigFacade.java

@@ -314,7 +314,7 @@ public class ScaleConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = scaleConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -335,7 +335,7 @@ public class ScaleConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         scaleConfigList = scaleConfigList
@@ -514,7 +514,7 @@ public class ScaleConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Scale.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -538,7 +538,7 @@ public class ScaleConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/facade/TransfusionConfigFacade.java

@@ -312,7 +312,7 @@ public class TransfusionConfigFacade {
         });
 
         //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
+        /*List<String> errorNumList = Lists.newLinkedList();
         List<String> uniqueNames = transfusionConfigList.stream()
                 .map(i -> i.getUniqueName())
                 .distinct()
@@ -333,7 +333,7 @@ public class TransfusionConfigFacade {
                     "以下行数(不计空行)标准术语在数据库中不存在:"
                             + errorNumList.stream().collect(Collectors.joining("、"))
                             + "。导入取消,请修改后再试。");
-        }
+        }*/
 
         //重复数据过滤
         transfusionConfigList = transfusionConfigList
@@ -512,7 +512,7 @@ public class TransfusionConfigFacade {
         }
         precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
 
-        ConceptVO conceptVO = new ConceptVO();
+        /*ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
         conceptVO.setType(ConceptTypeEnum.Transfusion.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
@@ -536,7 +536,7 @@ public class TransfusionConfigFacade {
                     retList.add(originItem);
                 }
             }
-        }
+        }*/
 
         retList = retList.stream()
                 .distinct()

+ 15 - 0
cdssman-service/src/main/java/com/diagbot/mapper/MappingConfigMapper.java

@@ -0,0 +1,15 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.MappingConfig;
+
+/**
+ * <p>
+ * 医学术语映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+public interface MappingConfigMapper extends BaseMapper<MappingConfig> {
+}

+ 15 - 0
cdssman-service/src/main/java/com/diagbot/service/MappingConfigService.java

@@ -0,0 +1,15 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.MappingConfig;
+
+/**
+ * <p>
+ * 医学术语映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+public interface MappingConfigService extends IService<MappingConfig> {
+}

+ 19 - 0
cdssman-service/src/main/java/com/diagbot/service/impl/MappingConfigServiceImpl.java

@@ -0,0 +1,19 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.mapper.MappingConfigMapper;
+import com.diagbot.service.MappingConfigService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 医学术语映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+@Service
+public class MappingConfigServiceImpl extends ServiceImpl<MappingConfigMapper, MappingConfig> implements MappingConfigService {
+}

+ 4 - 3
cdssman-service/src/main/java/com/diagbot/vo/ConceptVO.java

@@ -14,7 +14,8 @@ import java.util.List;
 @Getter
 @Setter
 public class ConceptVO {
-    List<String> names;
-    @NotNull(message = "请输入术语类型")
-    Integer type;
+    private List<Long> ids;
+    private List<String> names;
+    private Integer type;
+    private Integer source;
 }

+ 18 - 0
cdssman-service/src/main/java/com/diagbot/vo/FilterVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/16 14:02
+ */
+@Getter
+@Setter
+public class FilterVO {
+    @NotBlank(message = "请输入检索内容")
+    private String inputStr;
+}

+ 74 - 0
cdssman-service/src/main/java/com/diagbot/vo/MappingConfigPageVO.java

@@ -0,0 +1,74 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/10 15:35
+ */
+@Getter
+@Setter
+public class MappingConfigPageVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    /**
+     * 医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉)
+     */
+    @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉")
+    private Integer type;
+
+    /**
+     * 医院术语名称
+     */
+    private String hisName;
+
+    /**
+     * 医院术语编码
+     */
+    private String hisCode;
+
+    /**
+     * 医院术语细项名称(检验细项)
+     */
+    private String hisDetailName;
+
+    /**
+     * 医学标准术语名称
+     */
+    private String uniqueName;
+    @ApiModelProperty(hidden = true)
+    private List<Long> conceptIds;
+
+    /**
+     * 药品剂型
+     */
+    private String form;
+    @ApiModelProperty(hidden = true)
+    private List<Long> formConceptIds;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配、2-多条匹配)
+     */
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    private Integer source;
+
+    /**
+     * 一对多关系查询
+     */
+    @ApiModelProperty(hidden = true)
+    private Integer isMultiple;
+}

+ 21 - 0
cdssman-service/src/main/java/com/diagbot/vo/MappingConfigVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/17 10:30
+ */
+@Getter
+@Setter
+public class MappingConfigVO {
+    private Long hospitalId;
+    @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉")
+    private Integer type;
+    private String hisName;
+    private String hisDetailName;
+}

+ 147 - 0
cdssman-service/src/main/java/com/diagbot/web/MappingConfigController.java

@@ -0,0 +1,147 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.facade.MappingConfigFacade;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.MappingConfigPageVO;
+import com.diagbot.vo.MappingConfigVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/10 16:34
+ */
+@RestController
+@RequestMapping("/tran/mappingConfig")
+@Api(value = "术语关联相关API", tags = { "术语关联相关API" })
+@SuppressWarnings("unchecked")
+public class MappingConfigController {
+    @Autowired
+    private MappingConfigFacade mappingConfigFacade;
+
+
+    @ApiOperation(value = "数据导入模板导出[by:zhaops]",
+            notes = "")
+    @PostMapping("/exportExcelModule")
+    @SysLogger("exportExcelModule")
+    public void exportExcelModule(HttpServletResponse response, @RequestBody @Valid MappingConfigVO mappingConfigVO) {
+        mappingConfigFacade.exportExcelModule(response, mappingConfigVO);
+    }
+
+
+    @ApiOperation(value = "预匹配[by:zhaops]", notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file,
+                              HttpServletResponse response,
+                              @RequestParam("type") Integer type) {
+        mappingConfigFacade.precDataMatch(file, type, response);
+    }
+
+
+    @ApiOperation(value = "数据导入[by:zhaops]",
+            notes = "")
+    @PostMapping("/importExcel")
+    @SysLogger("importExcel")
+    @Transactional
+    public void importExcel(@RequestParam("file") MultipartFile file,
+                            @RequestParam("hospitalId") Long hospitalId,
+                            @RequestParam("type") Integer type,
+                            @RequestParam("uesrId") String userId) {
+        mappingConfigFacade.importExcel(file, hospitalId, type, userId);
+    }
+
+
+    @ApiOperation(value = "数据导出[by:zhaops]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response, @RequestBody @Valid MappingConfigPageVO mappingConfigPageVO) {
+        mappingConfigFacade.exportExcel(response, mappingConfigPageVO);
+    }
+
+    @ApiOperation(value = "分页查询[by:zhaops]", notes = "")
+    @PostMapping("/getPage")
+    @SysLogger("getPage")
+    public RespDTO<Page<MappingConfigWrapper>> getPage(@RequestBody @Valid MappingConfigPageVO mappingConfigPageVO) {
+        IPage<MappingConfigWrapper> data = mappingConfigFacade.getPage(mappingConfigPageVO);
+        Page<MappingConfigWrapper> page = new Page<>();
+        BeanUtil.copyProperties(data, page);
+        return RespDTO.onSuc(data);
+    }
+
+
+    @ApiOperation(value = "获取映射关系[by:zhaops]", notes = "")
+    @PostMapping("/getRecord")
+    @SysLogger("getRecord")
+    @Transactional
+    public RespDTO<MappingConfigWrapper> getRecord(@RequestBody @Valid IdVO idVO) {
+        MappingConfigWrapper data = mappingConfigFacade.getRecord(idVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "映射关系是否已存在[by:zhaops]", notes = "")
+    @PostMapping("/isExistRecord")
+    @SysLogger("isExistRecord")
+    public RespDTO<Boolean> isExistRecord(@RequestBody @Valid MappingConfig mappingConfig) {
+        Boolean data = mappingConfigFacade.isExistRecord(mappingConfig);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "查询已映射关系[by:zhaops]", notes = "")
+    @PostMapping("/getRelatedMapping")
+    @SysLogger("getRelatedMapping")
+    public RespDTO<List<MappingConfigWrapper>> getRelatedMapping(@RequestBody @Valid MappingConfigVO mappingConfigVO) {
+        List<MappingConfigWrapper> data = mappingConfigFacade.getRelatedMapping(mappingConfigVO);
+        return RespDTO.onSuc(data);
+    }
+
+
+    @ApiOperation(value = "保存或修改映射关系[by:zhaops]", notes = "")
+    @PostMapping("/saveOrUpdateRecord")
+    @SysLogger("saveOrUpdateRecord")
+    @Transactional
+    public RespDTO<Boolean> saveOrUpdateRecord(@RequestBody @Valid MappingConfig mappingConfig) {
+        Boolean data = mappingConfigFacade.saveOrUpdateRecord(mappingConfig);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "删除映射关系[by:zhaops]", notes = "")
+    @PostMapping("/deleteRecord")
+    @SysLogger("deleteRecord")
+    @Transactional
+    public RespDTO<Boolean> deleteRecord(@RequestBody @Valid IdVO idVO) {
+        Boolean data = mappingConfigFacade.deleteRecord(idVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "批量删除映射关系[by:zhaops]", notes = "")
+    @PostMapping("/deleteRecords")
+    @SysLogger("deleteRecords")
+    @Transactional
+    public RespDTO<Boolean> deleteRecords(@RequestBody @Valid IdListVO idListVO) {
+        Boolean data = mappingConfigFacade.deleteRecords(idListVO);
+        return RespDTO.onSuc(data);
+    }
+}

+ 24 - 0
cdssman-service/src/main/resources/mapper/MappingConfigMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.MappingConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.MappingConfig">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="type" property="type" />
+        <result column="his_name" property="hisName" />
+        <result column="his_code" property="hisCode" />
+        <result column="his_detail_name" property="hisDetailName" />
+        <result column="concept_id" property="conceptId" />
+        <result column="form_concept_id" property="formConceptId" />
+        <result column="is_match" property="isMatch" />
+        <result column="source" property="source" />
+        <result column="remark" property="remark" />
+    </resultMap>
+</mapper>

+ 4 - 0
config-server/src/main/resources/shared/cdssman-service-dev.yml

@@ -132,3 +132,7 @@ imageUrl:
 #CDSS核心地址
 cdss-core:
   url: http://192.168.2.236:7010
+
+#CDSS服务地址
+cdss:
+  url: http://192.168.2.236:6060

+ 4 - 0
config-server/src/main/resources/shared/cdssman-service-local.yml

@@ -131,3 +131,7 @@ imageUrl:
 #CDSS核心地址
 cdss-core:
   url: http://192.168.2.236:7010
+
+#CDSS服务地址
+cdss:
+  url: http://192.168.2.236:6060

+ 4 - 0
config-server/src/main/resources/shared/cdssman-service-pre.yml

@@ -133,3 +133,7 @@ imageUrl:
 cdss-core:
   url: http://192.168.2.121:7010
 
+#CDSS服务地址
+cdss:
+  url: http://192.168.2.121:6060
+

+ 4 - 0
config-server/src/main/resources/shared/cdssman-service-pro.yml

@@ -133,3 +133,7 @@ imageUrl:
 cdss-core:
   url: http://192.168.2.122:7010
 
+#CDSS服务地址
+cdss:
+  url: http://192.168.2.122:6060
+

+ 4 - 0
config-server/src/main/resources/shared/cdssman-service-test.yml

@@ -132,3 +132,7 @@ imageUrl:
 #CDSS核心地址
 cdss-core:
   url: http://192.168.2.241:7010
+
+#CDSS服务地址
+cdss:
+  url: http://192.168.2.241:6060