فهرست منبع

导入数据预匹配

zhaops 4 سال پیش
والد
کامیت
7eb6b4b664

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

@@ -27,6 +27,7 @@ import com.diagbot.vo.HospitalIdVO;
 import com.diagbot.vo.IdListVO;
 import com.diagbot.vo.IdVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -419,4 +420,58 @@ public class DeptConfigFacade {
         String fileName = "科室映射模板.xls";
         ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<DeptConfig> retList = Lists.newLinkedList();
+        List<DeptConfig> originList = ExcelUtils.importExcel(file, 0, 1, DeptConfig.class);
+
+        Map<String, List<DeptConfig>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (DeptConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        String fileName = "科室关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,List<DeptConfig>> getAll() {
+        Map<String, List<DeptConfig>> retMap = new HashMap<>();
+        List<DeptConfig> records = deptConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
 }

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

@@ -26,6 +26,7 @@ import com.diagbot.vo.HospitalIdVO;
 import com.diagbot.vo.IdListVO;
 import com.diagbot.vo.IdVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -406,4 +407,59 @@ public class DiseaseConfigFacade {
         String fileName = "疾病映射模板.xls";
         ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<DiseaseConfig> retList = Lists.newLinkedList();
+        List<DiseaseConfig> originList = ExcelUtils.importExcel(file, 0, 1, DiseaseConfig.class);
+
+        Map<String, List<DiseaseConfig>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (DiseaseConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        String fileName = "诊断关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,List<DiseaseConfig>> getAll() {
+        Map<String, List<DiseaseConfig>> retMap = new HashMap<>();
+        List<DiseaseConfig> records = diseaseConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setIcdCode(StringUtils.isBlank(record.getIcdCode()) ? null : record.getIcdCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
 }

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

@@ -28,6 +28,7 @@ import com.diagbot.vo.HospitalIdVO;
 import com.diagbot.vo.IdListVO;
 import com.diagbot.vo.IdVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -634,4 +635,59 @@ public class DrugConfigFacade {
         from += "]";
         return from;
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<DrugConfig> retList = Lists.newLinkedList();
+        List<DrugConfig> originList = ExcelUtils.importExcel(file, 1, 1, DrugConfig.class);
+
+        Map<String, List<DrugConfig>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (DrugConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        String fileName = "药品关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", DrugConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,List<DrugConfig>> getAll() {
+        Map<String, List<DrugConfig>> retMap = new HashMap<>();
+        List<DrugConfig> records = drugConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+            record.setForm(StringUtils.isBlank(record.getForm()) ? null : record.getForm());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
 }

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

@@ -27,6 +27,7 @@ import com.diagbot.vo.IdVO;
 import com.diagbot.vo.LisConfigListVO;
 import com.diagbot.vo.LisConfigPageVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -483,4 +484,66 @@ public class LisConfigFacade{
         String fileName = "检验映射模板.xls";
         ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", LisConfig.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<LisConfig> retList = Lists.newLinkedList();
+        List<LisConfig> originList = ExcelUtils.importExcel(file, 0, 1, LisConfig.class);
+
+        Map<String,Map<String, List<LisConfig>>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (LisConfig originItem : originList) {
+                if (StringUtils.isBlank(originItem.getHisDetailName())) {
+                    originItem.setHisDetailName("");
+                }
+                if (allMap.containsKey(originItem.getHisName())
+                        && allMap.get(originItem.getHisName()).containsKey(originItem.getHisDetailName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()).get(originItem.getHisDetailName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+        String fileName = "检验关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", LisConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,Map<String,List<LisConfig>>>  getAll() {
+        Map<String, Map<String, List<LisConfig>>> retMap = new HashMap<>();
+        List<LisConfig> records = lisConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setHisDetailName(StringUtils.isBlank(record.getHisDetailName()) ? "" : record.getHisDetailName());
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<LisConfig>> hisNameMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        for (Map.Entry<String, List<LisConfig>> entry : hisNameMap.entrySet()) {
+            retMap.put(entry.getKey(),
+                    EntityUtil.makeEntityListMap(entry.getValue(), "hisDetailName"));
+        }
+        return retMap;
+    }
 }

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

@@ -27,6 +27,7 @@ import com.diagbot.vo.IdVO;
 import com.diagbot.vo.OperationConfigListVO;
 import com.diagbot.vo.OperationConfigPageVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -415,4 +416,58 @@ public class OperationConfigFacade {
         String fileName = "手术映射模板.xls";
         ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<OperationConfig> retList = Lists.newLinkedList();
+        List<OperationConfig> originList = ExcelUtils.importExcel(file, 0, 1, OperationConfig.class);
+
+        Map<String, List<OperationConfig>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (OperationConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        String fileName = "手术和操作关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,List<OperationConfig>> getAll() {
+        Map<String, List<OperationConfig>> retMap = new HashMap<>();
+        List<OperationConfig> records = operationConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
 }

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

@@ -27,6 +27,7 @@ import com.diagbot.vo.IdVO;
 import com.diagbot.vo.PacsConfigListVO;
 import com.diagbot.vo.PacsConfigPageVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -413,4 +414,58 @@ public class PacsConfigFacade {
         String fileName = "检查映射模板.xls";
         ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<PacsConfig> retList = Lists.newLinkedList();
+        List<PacsConfig> originList = ExcelUtils.importExcel(file, 0, 1, PacsConfig.class);
+
+        Map<String, List<PacsConfig>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (PacsConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        String fileName = "检查关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,List<PacsConfig>> getAll() {
+        Map<String, List<PacsConfig>> retMap = new HashMap<>();
+        List<PacsConfig> records = pacsConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
 }

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

@@ -27,6 +27,7 @@ import com.diagbot.vo.IdVO;
 import com.diagbot.vo.TransfusionConfigListVO;
 import com.diagbot.vo.TransfusionConfigPageVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
@@ -413,4 +414,58 @@ public class TransfusionConfigFacade {
         String fileName = "输血映射模板.xls";
         ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 导入数据预匹配
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file,HttpServletResponse response) {
+        List<TransfusionConfig> retList = Lists.newLinkedList();
+        List<TransfusionConfig> originList = ExcelUtils.importExcel(file, 0, 1, TransfusionConfig.class);
+
+        Map<String, List<TransfusionConfig>> allMap = getAll();
+        if (ListUtil.isNotEmpty(originList)) {
+            for (TransfusionConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    retList.addAll(allMap.get(originItem.getHisName()));
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        String fileName = "输血关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 获取所有医院映射数据
+     * @return
+     */
+    public Map<String,List<TransfusionConfig>> getAll() {
+        Map<String, List<TransfusionConfig>> retMap = new HashMap<>();
+        List<TransfusionConfig> records = transfusionConfigService.list();
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/DeptConfigController.java

@@ -190,4 +190,17 @@ public class DeptConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         deptConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        deptConfigFacade.precDataMatch(file, response);
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/DiseaseConfigController.java

@@ -189,4 +189,17 @@ public class DiseaseConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         diseaseConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        diseaseConfigFacade.precDataMatch(file, response);
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/DrugConfigController.java

@@ -190,4 +190,17 @@ public class DrugConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         drugConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        drugConfigFacade.precDataMatch(file, response);
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/LisConfigController.java

@@ -188,4 +188,17 @@ public class LisConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         lisConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        lisConfigFacade.precDataMatch(file, response);
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/OperationConfigController.java

@@ -190,4 +190,17 @@ public class OperationConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         operationConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        operationConfigFacade.precDataMatch(file, response);
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/PacsConfigController.java

@@ -191,4 +191,17 @@ public class PacsConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         pacsConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        pacsConfigFacade.precDataMatch(file, response);
+    }
 }

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/web/TransfusionConfigController.java

@@ -186,4 +186,17 @@ public class TransfusionConfigController {
     public void exportExcelModule(HttpServletResponse response) {
         transfusionConfigFacade.exportExcelModule(response);
     }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        transfusionConfigFacade.precDataMatch(file, response);
+    }
 }