陈昶聿
4 天以前 2dde489e34f6116e6cc63f85baf24d3c546d1763
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -434,12 +434,6 @@
        ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
        ExternalInDeptPatientInfo externalInDeptPatientInfo = BeanUtil.mapToBean(RuKeXX, ExternalInDeptPatientInfo.class, true);
        ExternalInDeptPatientInfo externalJZInfo = BeanUtil.mapToBean(JiuZhenXX, ExternalInDeptPatientInfo.class, true);
        if(ObjectUtils.isNotEmpty(externalJZInfo)){
            externalInHospPatientInfo.setJingGuanYSID(externalJZInfo.getJingGuanYSID());
            externalInHospPatientInfo.setJingGuanYSXM(externalJZInfo.getJingGuanYSXM());
        }
        externalInHospPatientInfo.setZeRenHSID(externalInDeptPatientInfo.getZeRenHSID());
        externalInHospPatientInfo.setZeRenHSXM(externalInDeptPatientInfo.getZeRenHSXM());
        externalInHospPatientInfo.setZhuZhiYSID(externalInDeptPatientInfo.getZhuZhiYSID());
@@ -1210,12 +1204,23 @@
                patMedOuthosp.setFuflag("1");
            }
        }
        Integer visitTimeNum = null;
        String visitTimeUnit = "天";
        for (ExternalWZInfo externalWZInfo : ExternalWZInfoList) {
            if (externalWZInfo.getWenZhenLXMC().equals("现病史")) {
                patMedOuthosp.setHpi(externalWZInfo.getNeiRong());
            }
            if (externalWZInfo.getWenZhenLXMC().equals("主诉")) {
                patMedOuthosp.setMainsuit(externalWZInfo.getNeiRong());
            }
            if (externalWZInfo.getWenZhenLXMC().equals("随访天数")) {
                String visitTimeNumStr = externalWZInfo.getNeiRong();
                if(StringUtils.isNotEmpty(visitTimeNumStr) && visitTimeNumStr.matches("^-?\\d+$")){
                    visitTimeNum = Integer.parseInt(visitTimeNumStr);
                }
            }
            if (externalWZInfo.getWenZhenLXMC().equals("随访天数单位")) {
                visitTimeUnit = externalWZInfo.getNeiRong();
            }
        }
        int i = 0;
@@ -1236,6 +1241,11 @@
            }
            i = patMedOuthospService.insertPatMedOuthosp(patMedOuthosp);
        }
        Date adminDate = externalJZInfo.getJiuZhenRQ();
        //完成接诊 已经完成任务再次随访
        if(ObjectUtils.isNotEmpty(visitTimeNum) && ObjectUtils.isNotEmpty(adminDate)){
            patMedOuthospService.followUpAgainByPatMedOuthosp(patMedOuthosp, adminDate, visitTimeNum);
        }
        if (i > 0) {
@@ -1325,7 +1335,6 @@
        Map yeWuXX = (Map) dataMap.get("YeWuXX");
        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
        ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
        PatArchive patArchive = addPatArchive(externalInHospPatientInfo, null, null);
@@ -1346,6 +1355,10 @@
        patMedOperation.setPatid(patArchive.getId());
        patMedOperation.setPatcode(externalInHospPatientInfo.getBingRenID());
        patMedOperation.setPaname(externalInHospPatientInfo.getXingMing());
        patMedOperation.setLeaveldeptcode(externalInHospPatientInfo.getDangQianKSID());
        patMedOperation.setLeaveldeptname(externalInHospPatientInfo.getDangQianKSMC());
        patMedOperation.setLeavehospitaldistrictcode(externalInHospPatientInfo.getDangQianBQID());
        patMedOperation.setLeavehospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC());
        patMedOperation.setOpreqcode(externalOperationInfo.getShenQingDID());
        //查询一下,该患者是否已经有这些数据
        List<PatMedOperation> patMedOperations = patMedOperationMapper.selectPatMedOperationList(patMedOperation);
@@ -1447,7 +1460,9 @@
            Boolean addMianTableFalg = true;
            for (ExternalOperationDetail externalOperationDetail : externalOperationDetails) {
                PatMedOperationItem patMedOperationItem = new PatMedOperationItem();
                patMedOperationItem.setOpid(patMedOperation.getOpid());
                if(ObjectUtils.isNotEmpty(patMedOperation.getId())){
                    patMedOperationItem.setOpid(patMedOperation.getId().toString());
                }
                patMedOperationItem.setOpcode(externalOperationDetail.getShouShuMCID());
                patMedOperationItem.setOpdesc(externalOperationDetail.getShouShuMC());
                patMedOperationItem.setMainFlag(externalOperationDetail.getZhuShouSBZ());
@@ -1463,7 +1478,10 @@
                if (externalOperationDetail.getZhuShouSBZ().equals("1") && addMianTableFalg == true) {
                    patMedOperation.setOpcode(externalOperationDetail.getShouShuMCID());
                    patMedOperation.setOpdesc(externalOperationDetail.getShouShuMC());
//                    patMedOperation.setOpid(externalOperationDetail.getShouShuJBDM());
                    if(ObjectUtils.isNotEmpty(patMedOperation.getId())){
                        patMedOperation.setOpid(patMedOperation.getId().toString());
                    }
                    patMedOperation.setUpdateTime(new Date());
                    patMedOperationMapper.updatePatMedOperation(patMedOperation);
                    addMianTableFalg = false;