| | |
| | | @Autowired |
| | | private PatMedOperationItemMapper patMedOperationItemMapper; |
| | | @Autowired |
| | | private Icd10AssociationMapper icd10AssociationMapper; |
| | | private Icd10Mapper icd10Mapper; |
| | | @Autowired |
| | | private PatMedOuthospMapper patMedOuthospMapper; |
| | | |
| | | @Value("${defaultPwd}") |
| | | private String defaultPwd; |
| | |
| | | log.error("ServiceExternalServiceImpl---addOutHospInfo的新增的值为:{}", dataMap); |
| | | Map yeWuXX = (Map) dataMap.get("YeWuXX"); |
| | | Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX"); |
| | | List<HashMap<String, Object>> epai = (List<HashMap<String, Object>>) yeWuXX.get("DiZhiXXList"); |
| | | List<HashMap<String, Object>> epli = (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList"); |
| | | ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true); |
| | | ExternalInHospPatientAddrInfo externalInHospPatientAddrInfo = null; |
| | | ExternalInHospPatientLiaisonInfo externalInHospPatientLiaisonInfo = null; |
| | | List<ExternalInHospPatientAddrInfo> epai2 = epai.stream().map(map -> { |
| | | ExternalInHospPatientAddrInfo info = new ExternalInHospPatientAddrInfo(); |
| | | info.setDiZhiLX((String) map.get("DiZhiLX")); // 假设字段类型是 Integer |
| | | info.setDiZhiXX((String) map.get("DiZhiXX")); |
| | | info.setShengFenDM((String) map.get("ShengFenDM")); |
| | | info.setShengFenMC((String) map.get("ShengFenMC")); |
| | | info.setShiDiQDM((String) map.get("ShiDiQDM")); |
| | | info.setShiDiQMC((String) map.get("ShiDiQMC")); |
| | | info.setXianQuDM((String) map.get("XianQuDM")); |
| | | info.setXianQuMC((String) map.get("XianQuMC")); |
| | | info.setXiangZhenDM((String) map.get("XiangZhenDM")); |
| | | info.setXiangZhenMC((String) map.get("XiangZhenMC")); |
| | | info.setCunJiDM((String) map.get("CunJiDM")); |
| | | info.setQiTaXX((String) map.get("QiTaXX")); |
| | | info.setYouBian((String) map.get("YouBian")); |
| | | 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()); |
| | | if (CollectionUtils.isNotEmpty(epai)) externalInHospPatientAddrInfo = epai2.get(0); |
| | | if (CollectionUtils.isNotEmpty(epli)) externalInHospPatientLiaisonInfo = epli2.get(0); |
| | | //新增患者基本信息新增或修改 |
| | | PatArchive patArchive = addPatArchive(externalInHospPatientInfo, externalInHospPatientAddrInfo, externalInHospPatientLiaisonInfo); |
| | | |
| | | PatMedInhosp patMedInhosp = new PatMedInhosp(); |
| | | patMedInhosp.setInhospno(externalInHospPatientInfo.getZhuYuanHao()); |
| | |
| | | patMedInhosp1.setOperatorId(JiuZhenXX.get("CaoZuoRID").toString()); |
| | | patMedInhosp1.setUpdateTime(new Date()); |
| | | patMedInhosp1.setUpdateTime(new Date()); |
| | | |
| | | patMedInhosp1.setTelcode(patArchive.getTelcode()); |
| | | patMedInhosp1.setLeavehospitaldistrictcode(externalInHospPatientInfo.getDangQianBQID()); |
| | | patMedInhosp1.setLeavehospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC()); |
| | | patMedInhosp1.setLeaveldeptname(externalInHospPatientInfo.getDangQianKSMC()); |
| | |
| | | }).collect(Collectors.toList()); |
| | | patMedInhosp1.setLeaveicd10code(StringUtils.isNotEmpty(patMedInhosp1.getLeaveicd10code()) ? patMedInhosp1.getLeaveicd10code() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanID() : hospPatientDiagnoseInfos2.get(0).getZhenDuanID()); |
| | | patMedInhosp1.setLeavediagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); |
| | | |
| | | patMedInhosp1.setInhospstate("1"); |
| | | int i = patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | | if (i != 1) return false; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Boolean addFinshJZInfo(Map dataMap) { |
| | | //这个先等等 |
| | | log.error("ServiceExternalServiceImpl---addFinshJZInfo的新增的值为:{}", dataMap); |
| | | Map yeWuXX = (Map) dataMap.get("YeWuXX"); |
| | | Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX"); |
| | | Map<String, Object> JiuZhenXX = (Map<String, Object>) yeWuXX.get("JiuZhenXX"); |
| | | List<HashMap<String, Object>> ZhenDuanList = (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList"); |
| | | List<HashMap<String, Object>> externalWZInfos = (List<HashMap<String, Object>>) yeWuXX.get("WenZhenList"); |
| | | ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true); |
| | | ExternalJZInfo externalJZInfo = BeanUtil.mapToBean(JiuZhenXX, ExternalJZInfo.class, true); |
| | | List<ExternalDiagnosisInfo> externalDiagnosisInfoList = ZhenDuanList.stream().map(map -> { |
| | | ExternalDiagnosisInfo info = new ExternalDiagnosisInfo(); |
| | | info.setZhenDuanYSID((String) map.get("ZhenDuanYSID")); |
| | | info.setZhenDuanYSXM((String) map.get("ZhenDuanYSXM")); |
| | | info.setZhenDuanID((String) map.get("ZhenDuanID")); |
| | | info.setZhenDuanMC((String) map.get("ZhenDuanMC")); |
| | | info.setZhenDuanLBDM((String) map.get("ZhenDuanLBDM")); |
| | | info.setZhenDuanLBMC((String) map.get("ZhenDuanLBMC")); |
| | | return info; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | return null; |
| | | List<ExternalWZInfo> ExternalWZInfoList = externalWZInfos.stream().map(map -> { |
| | | ExternalWZInfo info = new ExternalWZInfo(); |
| | | info.setWenZhenLXMC((String) map.get("WenZhenLXMC")); |
| | | info.setNeiRong((String) map.get("NeiRong")); |
| | | return info; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | PatArchive patArchive = addPatArchive(externalInHospPatientInfo, null, null); |
| | | |
| | | PatMedOuthosp patMedOuthosp = new PatMedOuthosp(); |
| | | patMedOuthosp.setOuthospno(externalInHospPatientInfo.getBingAnHao()); |
| | | patMedOuthosp.setSerialnum(externalInHospPatientInfo.getBingAnHao()); |
| | | patMedOuthosp.setPatid(patArchive.getId()); |
| | | patMedOuthosp.setPatname(externalInHospPatientInfo.getXingMing()); |
| | | patMedOuthosp.setHospitalname(externalInHospPatientInfo.getZuZhiJGMC()); |
| | | patMedOuthosp.setHospitalcode(externalInHospPatientInfo.getZuZhiJGID()); |
| | | patMedOuthosp.setDeptname(externalJZInfo.getJiuZhenKSMC()); |
| | | patMedOuthosp.setDeptcode(externalJZInfo.getJiuZhenKSID()); |
| | | patMedOuthosp.setAdmitdate(externalJZInfo.getJiuZhenRQ()); |
| | | |
| | | Map XiaoXiTou = (Map) dataMap.get("XiaoXiTou"); |
| | | String FaSongJGID = XiaoXiTou.get("FaSongJGID").toString(); |
| | | patMedOuthosp.setOrgid(FaSongJGID); |
| | | |
| | | for (ExternalDiagnosisInfo externalDiagnosisInfo : externalDiagnosisInfoList) { |
| | | if (externalDiagnosisInfo.getZhenDuanLBMC().equals("主诊断")) { |
| | | patMedOuthosp.setDiagname(externalDiagnosisInfo.getZhenDuanMC()); |
| | | patMedOuthosp.setIcd10code(externalDiagnosisInfo.getZhenDuanID()); |
| | | patMedOuthosp.setDrcode(externalDiagnosisInfo.getZhenDuanYSID()); |
| | | patMedOuthosp.setDrname(externalDiagnosisInfo.getZhenDuanYSXM()); |
| | | } |
| | | } |
| | | for (ExternalWZInfo externalWZInfo : ExternalWZInfoList) { |
| | | if (externalWZInfo.getWenZhenLXMC().equals("现病史")) { |
| | | patMedOuthosp.setHpi(externalWZInfo.getNeiRong()); |
| | | } |
| | | if (externalWZInfo.getWenZhenLXMC().equals("主诉")) { |
| | | patMedOuthosp.setMainsuit(externalWZInfo.getNeiRong()); |
| | | } |
| | | } |
| | | int i = patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp); |
| | | if (i > 0) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean addDiseaseInfo(Map dataMap) { |
| | | log.error("ServiceExternalServiceImpl---addDiseaseInfo的新增的值为:{}", dataMap); |
| | | Map yeWuXX = (Map) dataMap.get("YeWuXX"); |
| | | Map<String, Object> JiBing = (Map<String, Object>) yeWuXX.get("JiBing"); |
| | | Map<String, Object> JiBing = (Map<String, Object>) yeWuXX.get("JiBingMLXX"); |
| | | ExternalDiseaseInfo externalDiseaseInfo = BeanUtil.mapToBean(JiBing, ExternalDiseaseInfo.class, true); |
| | | Icd10Association icd10Association = new Icd10Association(); |
| | | icd10Association.setIcd10code(externalDiseaseInfo.getJiBingID()); |
| | | icd10Association.setIcd10name(externalDiseaseInfo.getJiBingMC()); |
| | | icd10Association.setGuid(externalDiseaseInfo.getZuZhiJGID()); |
| | | icd10Association.setOrgid(externalDiseaseInfo.getZuZhiJGID()); |
| | | icd10Association.setPid(externalDiseaseInfo.getFUJIBID()); |
| | | icd10Association.setIcd10AssortCode(externalDiseaseInfo.getJiBingFLDM()); |
| | | icd10Association.setIcd10AssortName(externalDiseaseInfo.getJiBingFLMC()); |
| | | icd10Association.setChineseMedicineDiagnoseSign(externalDiseaseInfo.getZhongYiZDBZ()); |
| | | icd10Association.setChineseMedicineDiagnoseAssortCode(externalDiseaseInfo.getZhongYiZDFLDM()); |
| | | icd10Association.setChineseMedicineDiagnoseAssortName(externalDiseaseInfo.getZhongYiZDFLMC()); |
| | | icd10Association.setOutpatientUseAssort(externalDiseaseInfo.getMenZhenSYBZ()); |
| | | icd10Association.setInpatientUseAssort(externalDiseaseInfo.getZhuYuanSYBZ()); |
| | | icd10AssociationMapper.insertIcd10Association(icd10Association); |
| | | Map XiaoXiTou = (Map) dataMap.get("XiaoXiTou"); |
| | | String FaSongJGID = XiaoXiTou.get("FaSongJGID").toString(); |
| | | Icd10 icd10 = new Icd10(); |
| | | icd10.setIcdcode(externalDiseaseInfo.getIcD10()); |
| | | icd10.setHisIcdid(externalDiseaseInfo.getJiBingID()); |
| | | icd10.setIcdname(externalDiseaseInfo.getJiBingMC()); |
| | | icd10.setGuid(externalDiseaseInfo.getZuZhiJGID()); |
| | | icd10.setLastflag(externalDiseaseInfo.getMOJIBZ()); |
| | | icd10.setChimedflag("" + externalDiseaseInfo.getZhongYiZDBZ()); |
| | | icd10.setOrgid(FaSongJGID); |
| | | // icd10Association.setIcd10AssortName(externalDiseaseInfo.getJiBingFLMC()); |
| | | // icd10Association.setChineseMedicineDiagnoseSign(externalDiseaseInfo.getZhongYiZDBZ()); |
| | | // icd10Association.setChineseMedicineDiagnoseAssortCode(externalDiseaseInfo.getZhongYiZDFLDM()); |
| | | // icd10Association.setChineseMedicineDiagnoseAssortName(externalDiseaseInfo.getZhongYiZDFLMC()); |
| | | // icd10Association.setOutpatientUseAssort(externalDiseaseInfo.getMenZhenSYBZ()); |
| | | // icd10Association.setInpatientUseAssort(externalDiseaseInfo.getZhuYuanSYBZ()); |
| | | icd10Mapper.insertIcd10(icd10); |
| | | return true; |
| | | } |
| | | |
| | |
| | | private PatArchive addPatArchive(ExternalInHospPatientInfo externalInHospPatientInfo, ExternalInHospPatientAddrInfo externalInHospPatientAddrInfo, ExternalInHospPatientLiaisonInfo externalInHospPatientLiaisonInfo) { |
| | | PatArchive patArchive = new PatArchive(); |
| | | patArchive.setIdcardno(externalInHospPatientInfo.getZhengJianHM()); |
| | | patArchive.setOrgid(externalInHospPatientInfo.getZuZhiJGID()); |
| | | List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(patArchive); |
| | | patArchive.setPatientno(externalInHospPatientInfo.getJiuZhenKH()); |
| | | patArchive.setBirthdate(externalInHospPatientInfo.getChuShengRQ()); |
| | | patArchive.setPatidHis(externalInHospPatientInfo.getBingRenID()); |
| | | patArchive.setSourcefrom(1); |
| | | patArchive.setPattype("2"); |
| | |
| | | patArchive.setNation(externalInHospPatientInfo.getMinZuMC()); |
| | | patArchive.setNativePlace(externalInHospPatientInfo.getGuoJiMC()); |
| | | if (ObjectUtils.isNotEmpty(externalInHospPatientAddrInfo)) { |
| | | patArchive.setPlaceOfResidence(externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX()); |
| | | patArchive.setBirthplace(externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX()); |
| | | String por = null; |
| | | if (StringUtils.isNotEmpty(externalInHospPatientAddrInfo.getDiZhiXX())) { |
| | | por = externalInHospPatientAddrInfo.getDiZhiXX(); |
| | | } else { |
| | | por = externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX(); |
| | | } |
| | | patArchive.setPlaceOfResidence(por.replace("null", "")); |
| | | patArchive.setBirthplace(por.replace("null", "")); |
| | | } |
| | | patArchive.setBirthdate(externalInHospPatientInfo.getChuShengRQ()); |
| | | patArchive.setAge(externalInHospPatientInfo.getNianLing()); |
| | | patArchive.setAgeUnit(externalInHospPatientInfo.getNianLingDW()); |
| | | patArchive.setTelcode(externalInHospPatientInfo.getLianXiDH()); |
| | | if (StringUtils.isEmpty(externalInHospPatientInfo.getLianXiDH())) |
| | | patArchive.setTelcode(externalInHospPatientInfo.getLianXiRDH()); |
| | | patArchive.setRelativetelcode(externalInHospPatientInfo.getLianXiRDH()); |
| | | patArchive.setGuid(externalInHospPatientInfo.getZuZhiJGID()); |
| | | patArchive.setOrgid(externalInHospPatientInfo.getZuZhiJGID()); |
| | | if (ObjectUtils.isNotEmpty(externalInHospPatientLiaisonInfo)) |
| | | patArchive.setRelativetelcode(externalInHospPatientLiaisonInfo.getLianXiRDH()); |
| | | patArchive.setInhospno(externalInHospPatientInfo.getZhuYuanHao()); |
| | | patArchive.setCreateTime(new Date()); |
| | | patArchive.setIdcardtype(externalInHospPatientInfo.getZhengJianLXMC()); |
| | | if (CollectionUtils.isNotEmpty(patArchives)) { |
| | | //如果不为空,直接将查询出来的对象返回 |
| | | PatArchive patArchive1 = patArchives.get(0); |
| | | String orgid = patArchive1.getOrgid(); |
| | | if (StringUtils.isNotEmpty(orgid)) { |
| | | orgid = orgid + "," + externalInHospPatientInfo.getZuZhiJGID(); |
| | | patArchive.setOrgid(orgid); |
| | | patArchive.setId(patArchive1.getId()); |
| | | patArchiveMapper.updatePatArchive(patArchive); |
| | | return patArchive; |
| | |
| | | patMedInhosp.setLeavehospitaldistrictcode(externalInHospPatientInfo.getDangQianBQID()); |
| | | patMedInhosp.setHospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC()); |
| | | patMedInhosp.setLeavehospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC()); |
| | | patMedInhosp.setTelcode(patArchive.getTelcode()); |
| | | patMedInhosp.setDrname(""); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(externalInHospPatientDiagnoseInfo)) { |
| | | patMedInhosp.setIcd10code(StringUtils.isNotEmpty(patMedInhosp.getIcd10code()) ? patMedInhosp.getIcd10code() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanID() : externalInHospPatientDiagnoseInfo.getZhenDuanID()); |
| | |
| | | patMedInhosp.setPatid(patArchive.getId()); |
| | | patMedInhosp.setPatno(patArchive.getPatientno()); |
| | | patMedInhosp.setPatname(patArchive.getName()); |
| | | patMedInhosp.setDrname(""); |
| | | |
| | | patMedInhosp.setSchemestatus(1L); |
| | | patMedInhosp.setCreateTime(new Date()); |
| | | } |