zhs
2025-04-16 6994c4ae328dc6e41ab98f183774c7ffdc9b5dbf
04-16改数据采集-入科
已修改1个文件
34 ■■■■ 文件已修改
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -257,11 +257,12 @@
    public Boolean addInDeptInfo(Map dataMap) {
        log.error("ServiceExternalServiceImpl---addInDeptInfo的新增的值为:{}", dataMap);
        Map yeWuXX = (Map) dataMap.get("YeWuXX");
        List<HashMap<String, Object>> epai = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("DiZhiXXList") : null;
        List<HashMap<String, Object>> epli = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList") : null;
        List<HashMap<String, Object>> hospPatientDiagnoseInfos = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList") : null;
//        List<HashMap<String, Object>> hospPatientDiagnoseInfos = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList") : null;
        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
        Map<String, Object> RuKeXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("RuKeXX") : null;
        List<HashMap<String, Object>> epai = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) BingRenXX.get("DiZhiXXList") : null;
        ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
        ExternalInDeptPatientInfo externalInDeptPatientInfo = BeanUtil.mapToBean(RuKeXX, ExternalInDeptPatientInfo.class, true);
@@ -270,6 +271,9 @@
        externalInHospPatientInfo.setZhuZhiYSID(externalInDeptPatientInfo.getZhuZhiYSID());
        externalInHospPatientInfo.setZhuZhiYSXM(externalInDeptPatientInfo.getZhuZhiYSXM());
        externalInHospPatientInfo.setRuYuanSJ(externalInDeptPatientInfo.getRuYuanSJ());
        externalInHospPatientInfo.setLianXiDH(ObjectUtils.isNotEmpty(BingRenXX.get("LianXiDH")) ? BingRenXX.get("LianXiDH").toString() : null);
        externalInHospPatientInfo.setDangQianCWID(ObjectUtils.isNotEmpty(BingRenXX.get("DangQianCWID")) ? BingRenXX.get("DangQianCWID").toString() : null);
        externalInHospPatientInfo.setDangQianCWMC(ObjectUtils.isNotEmpty(BingRenXX.get("DangQianCWMC")) ? BingRenXX.get("DangQianCWMC").toString() : null);
        ExternalInHospPatientAddrInfo externalInHospPatientAddrInfo = null;
        ExternalInHospPatientLiaisonInfo externalInHospPatientLiaisonInfo = null;
@@ -292,29 +296,10 @@
            return info;
        }).collect(Collectors.toList());
        List<ExternalInHospPatientLiaisonInfo> epli2 = epli.stream().map(map -> {
            ExternalInHospPatientLiaisonInfo info = new ExternalInHospPatientLiaisonInfo();
            info.setLianXiRXM((String) map.get("LianXiRXM"));
            info.setLianXiRDH((String) map.get("LianXiRDH"));
            info.setGuanXiDM((String) map.get("GuanXiDM"));
            info.setGuanXiMC((String) map.get("GuanXiMC"));
            return info;
        }).collect(Collectors.toList());
        externalInHospPatientInfo.setExternalInHospPatientLiaisonInfos(epli2);
        List<ExternalInHospPatientDiagnoseInfo> hospPatientDiagnoseInfos2 = hospPatientDiagnoseInfos.stream().map(map -> {
            ExternalInHospPatientDiagnoseInfo info = new ExternalInHospPatientDiagnoseInfo();
            info.setZhenDuanID((String) map.get("ZhenDuanID"));
            info.setZhenDuanMC((String) map.get("ZhenDuanMC"));
            return info;
        }).collect(Collectors.toList());
        if (CollectionUtils.isNotEmpty(epai)) externalInHospPatientAddrInfo = epai2.get(0);
        if (CollectionUtils.isNotEmpty(epli)) externalInHospPatientLiaisonInfo = epli2.get(0);
        if (CollectionUtils.isNotEmpty(hospPatientDiagnoseInfos))
            externalInHospPatientDiagnoseInfo = hospPatientDiagnoseInfos2.get(0);
        //新增患者基本信息
        PatArchive patArchive = addPatArchive(externalInHospPatientInfo, externalInHospPatientAddrInfo, externalInHospPatientLiaisonInfo);
        PatArchive patArchive = addPatArchive(externalInHospPatientInfo, externalInHospPatientAddrInfo, null);
        //新增患者入院信息
        Boolean aBoolean = addPadInhospInfo(externalInHospPatientInfo, patArchive, externalInHospPatientDiagnoseInfo);
        return aBoolean;
@@ -942,6 +927,7 @@
            patMedInhosp.setLeaveldeptcode(externalInHospPatientInfo.getDangQianKSID());
            patMedInhosp.setDeptname(externalInHospPatientInfo.getDangQianKSMC());
            patMedInhosp.setLeaveldeptname(externalInHospPatientInfo.getDangQianKSMC());
            //这里是床位名称还是床位编号????
            patMedInhosp.setBedNo(externalInHospPatientInfo.getDangQianCWID());
            patMedInhosp.setOrgid(externalInHospPatientInfo.getZuZhiJGID());
            patMedInhosp.setHospitaldistrictid(externalInHospPatientInfo.getDangQianBQID());
@@ -976,9 +962,9 @@
            patMedInhosp.setSchemestatus(1L);
        }
        patMedInhosp.setUpdateTime(new Date());
        int i = 1;
        if (CollectionUtils.isNotEmpty(patMedInhospList)) {
            patMedInhosp.setUpdateTime(new Date());
            patMedInhosp.setInhospid(patMedInhospList.get(0).getInhospid());
            i = patMedInhospMapper.updatePatMedInhosp(patMedInhosp);
        } else {