liusheng
4 天以前 bb9fd6f1fad1a20e7536fad50f7f8c7d932a9011
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -891,6 +891,19 @@
        patMedOuthosp.setOuthospno(externalInHospPatientInfo.getBingAnHao());
        patMedOuthosp.setSerialnum(externalInHospPatientInfo.getJiuZhenYWID());
        List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.selectPatMedOuthospList(patMedOuthosp);
        for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) {
            PatArchive pa = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid());
            if (patArchive.getBirthdate() != null) {
                Map<String, String> map = calculateAge(pa.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
                pa.setAge(ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null);
                pa.setAgeUnit(map.get("ageUnit"));
                pa.setAge2(ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null);
                pa.setAgeUnit2(map.get("ageUnit2"));
                patMedOuthosp1.setAge(pa.getAge() + pa.getAgeUnit() + pa.getAge2() + pa.getAgeUnit2());
                patMedOuthosp1.setTelcode(patArchive.getTelcode());
                patMedOuthosp1.setIdcardno(patArchive.getIdcardno());
            }
        }
        patMedOuthosp.setPatid(patArchive.getId());
        patMedOuthosp.setPatno(externalInHospPatientInfo.getBingAnHao());