Commit 595d14c8502b477fed322de127079ce4659394a4

Authored by jiangjiazhi
1 parent 13df586198

增加soureceid

Showing 2 changed files with 134 additions and 79 deletions

platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java View file @ 595d14c
... ... @@ -157,6 +157,7 @@
157 157 localPatient.setGender(patients.getGender());
158 158 localPatient.setVip(patients.getVip());
159 159 localPatient.setCrisis(0);
  160 + localPatient.setHospitalForeignId(patients.getHospitalId());
160 161 //孕妇
161 162 localPatient.setType(patients.getType());
162 163 localPatient.setPublishId(0);
... ... @@ -296,7 +297,14 @@
296 297 {
297 298 if ("血压".equals(key))
298 299 {
299   - Map map = JsonUtil.str2Obj(antExChuModel.getBp(), Map.class);
  300 + Map map = null;
  301 + try
  302 + {
  303 + map = JsonUtil.str2Obj(antExChuModel.getBp(), Map.class);
  304 + } catch (Exception e)
  305 + {
  306 + }
  307 +
300 308 if (null != map)
301 309 {
302 310 String ssy = null;
... ... @@ -396,7 +404,15 @@
396 404 //高危
397 405 if ("高危因素".equals(key))
398 406 {
399   - List map = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
  407 + List map = null;
  408 + try
  409 + {
  410 + map = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
  411 + } catch (Exception e)
  412 + {
  413 + }
  414 +
  415 +
400 416 if (CollectionUtils.isNotEmpty(map))
401 417 {
402 418 StringBuilder sb = new StringBuilder();
... ... @@ -413,7 +429,14 @@
413 429 }
414 430 if (null != antExChuModel.getOtherHighRisk() && !"{}".equals(antExChuModel.getOtherHighRisk()))
415 431 {
416   - Map map1 = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class);
  432 + Map map1 =null;
  433 + try
  434 + {
  435 + map1 =JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class);
  436 + } catch (Exception e)
  437 + {
  438 + }
  439 +
417 440 Object rh = map1.get("fxysu");
418 441 if (null != rh && StringUtils.isNotEmpty(rh.toString()))
419 442 {
420 443  
... ... @@ -435,27 +458,29 @@
435 458 for (int j = 0; j < antExChuModel.getPlacentas().size(); j++)
436 459 {
437 460 LinkedHashMap map = (LinkedHashMap) antExChuModel.getPlacentas().get(j);
438   - //胎先露、胎方位、胎心率和衔接
439   - String heartRate = String.valueOf(map.get("heartRate"));
440   - String fetalPosition = String.valueOf(map.get("fetalPosition"));
441   - String fetalPresentation = String.valueOf(map.get("fetalPresentation"));
442   - String join = String.valueOf(map.get("join"));
443   - if (!"null".equals(heartRate) && StringUtils.isNotEmpty(heartRate))
444   - {
445   - heartRateVal += heartRate + "次/分" + ",";
  461 + if(null!=map){
  462 + //胎先露、胎方位、胎心率和衔接
  463 + String heartRate = String.valueOf(map.get("heartRate"));
  464 + String fetalPosition = String.valueOf(map.get("fetalPosition"));
  465 + String fetalPresentation = String.valueOf(map.get("fetalPresentation"));
  466 + String join = String.valueOf(map.get("join"));
  467 + if (!"null".equals(heartRate) && StringUtils.isNotEmpty(heartRate))
  468 + {
  469 + heartRateVal += heartRate + "次/分" + ",";
  470 + }
  471 + if (!"null".equals(fetalPosition) && StringUtils.isNotEmpty(fetalPosition))
  472 + {
  473 + fetalPositionVal += FetalPositionEnums.getTitle(fetalPosition) + ",";
  474 + }
  475 + if (!"null".equals(fetalPresentation) && StringUtils.isNotEmpty(fetalPresentation))
  476 + {
  477 + fetalPresentationVal += FetalEnums.getTitle(fetalPresentation) + ",";
  478 + }
  479 + if (!"null".equals(join) && StringUtils.isNotEmpty(join))
  480 + {
  481 + joinVal += JoinEnums.getTitle(join) + ",";
  482 + }
446 483 }
447   - if (!"null".equals(fetalPosition) && StringUtils.isNotEmpty(fetalPosition))
448   - {
449   - fetalPositionVal += FetalPositionEnums.getTitle(fetalPosition) + ",";
450   - }
451   - if (!"null".equals(fetalPresentation) && StringUtils.isNotEmpty(fetalPresentation))
452   - {
453   - fetalPresentationVal += FetalEnums.getTitle(fetalPresentation) + ",";
454   - }
455   - if (!"null".equals(join) && StringUtils.isNotEmpty(join))
456   - {
457   - joinVal += JoinEnums.getTitle(join) + ",";
458   - }
459 484 }
460 485 if (heartRateVal.endsWith(","))
461 486 {
... ... @@ -555,7 +580,13 @@
555 580 {
556 581 if ("血压".equals(key))
557 582 {
558   - Map map = JsonUtil.str2Obj(antExChuModel.getBp(), Map.class);
  583 + Map map = null;
  584 + try
  585 + {
  586 + map = JsonUtil.str2Obj(antExChuModel.getBp(), Map.class);
  587 + } catch (Exception e)
  588 + {
  589 + }
559 590 if (null != map)
560 591 {
561 592  
... ... @@ -631,7 +662,13 @@
631 662 //高危
632 663 else if ("高危因素".equals(key))
633 664 {
634   - List map = JsonUtil.toList(antExChuModel.getRiskFactor(), List.class);
  665 + List map = null;
  666 + try
  667 + {
  668 + map = JsonUtil.toList(antExChuModel.getRiskFactor(), List.class);
  669 + } catch (Exception e)
  670 + {
  671 + }
635 672 if (CollectionUtils.isNotEmpty(map))
636 673 {
637 674 StringBuilder sb = new StringBuilder();
638 675  
639 676  
... ... @@ -648,12 +685,23 @@
648 685 }
649 686 if (null != antExChuModel.getOtherRisk() && !"{}".equals(antExChuModel.getOtherRisk()))
650 687 {
651   - Map map1 = JsonUtil.str2Obj(antExChuModel.getOtherRisk(), Map.class);
652   - Object rh = map1.get("fxysu");
653   - if (null != rh && StringUtils.isNotEmpty(rh.toString()))
  688 + Map map1 = null;
  689 + try
654 690 {
655   - sb.append(rh);
  691 + map1 = JsonUtil.str2Obj(antExChuModel.getOtherRisk(), Map.class);
  692 + } catch (Exception e)
  693 + {
  694 +
656 695 }
  696 + if (null != map1)
  697 + {
  698 + Object rh = map1.get("fxysu");
  699 + if (null != rh && StringUtils.isNotEmpty(rh.toString()))
  700 + {
  701 + sb.append(rh);
  702 + }
  703 + }
  704 +
657 705 }
658 706 //低压
659 707 java.util.Map<String, Object> dataMap1 = new HashMap<>();
... ... @@ -673,26 +721,28 @@
673 721 for (int j = 0; j < antExChuModel.getTireData().size(); j++)
674 722 {
675 723 LinkedHashMap map = (LinkedHashMap) antExChuModel.getTireData().get(j);
676   - //胎先露、胎方位、胎心率和衔接
677   - String heartRate = String.valueOf(map.get("heartRate"));
678   - String fetalPosition = String.valueOf(map.get("fetalPosition"));
679   - String fetalPresentation = String.valueOf(map.get("fetalPresentation"));
680   - String join = String.valueOf(map.get("join"));
681   - if (!"null".equals(heartRate) && StringUtils.isNotEmpty(heartRate))
682   - {
683   - heartRateVal += heartRate + "次/分" + ",";
684   - }
685   - if (!"null".equals(fetalPosition) && StringUtils.isNotEmpty(fetalPosition))
686   - {
687   - fetalPositionVal += FetalPositionEnums.getTitle(fetalPosition) + ",";
688   - }
689   - if (!"null".equals(fetalPresentation) && StringUtils.isNotEmpty(fetalPresentation))
690   - {
691   - fetalPresentationVal += FetalEnums.getTitle(fetalPresentation) + ",";
692   - }
693   - if (!"null".equals(join) && StringUtils.isNotEmpty(join))
694   - {
695   - joinVal += JoinEnums.getTitle(join) + ",";
  724 + if(null!=map){
  725 + //胎先露、胎方位、胎心率和衔接
  726 + String heartRate = String.valueOf(map.get("heartRate"));
  727 + String fetalPosition = String.valueOf(map.get("fetalPosition"));
  728 + String fetalPresentation = String.valueOf(map.get("fetalPresentation"));
  729 + String join = String.valueOf(map.get("join"));
  730 + if (!"null".equals(heartRate) && StringUtils.isNotEmpty(heartRate))
  731 + {
  732 + heartRateVal += heartRate + "次/分" + ",";
  733 + }
  734 + if (!"null".equals(fetalPosition) && StringUtils.isNotEmpty(fetalPosition))
  735 + {
  736 + fetalPositionVal += FetalPositionEnums.getTitle(fetalPosition) + ",";
  737 + }
  738 + if (!"null".equals(fetalPresentation) && StringUtils.isNotEmpty(fetalPresentation))
  739 + {
  740 + fetalPresentationVal += FetalEnums.getTitle(fetalPresentation) + ",";
  741 + }
  742 + if (!"null".equals(join) && StringUtils.isNotEmpty(join))
  743 + {
  744 + joinVal += JoinEnums.getTitle(join) + ",";
  745 + }
696 746 }
697 747 }
698 748 if (heartRateVal.endsWith(","))
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java View file @ 595d14c
... ... @@ -808,40 +808,45 @@
808 808 {
809 809 for (com.lyms.platform.pojo.Patients patients : patientses)
810 810 {
811   - logger.info("SyncWork-" + hospitalId + "-patient-" + patients.getId());
812   - StopWatch stopWatch3 = new StopWatch("SyncWork-" + hospitalId + "-patient-" + patients.getId());
813   - com.lymsh.mommybaby.maindata.model.Patients mamiPatient = ConvertHelper
814   - .convertPatient(patients);
815   - if (StringUtils.isNotEmpty(mamiPatient.getPhone()))
  811 + try
816 812 {
817   - MembersQuery membersQuery = new MembersQuery();
818   - membersQuery.setPhone(mamiPatient.getPhone());
819   - List<Members> memberses = membersService.queryMembers(membersQuery);
820   - if (CollectionUtils.isNotEmpty(memberses))
  813 + logger.info("SyncWork-" + hospitalId + "-patient-" + patients.getId());
  814 + StopWatch stopWatch3 = new StopWatch("SyncWork-" + hospitalId + "-patient-" + patients.getId());
  815 + com.lymsh.mommybaby.maindata.model.Patients mamiPatient = ConvertHelper
  816 + .convertPatient(patients);
  817 + if (StringUtils.isNotEmpty(mamiPatient.getPhone()))
821 818 {
822   - mamiPatient.setMemberId(memberses.get(0).getId());
  819 + MembersQuery membersQuery = new MembersQuery();
  820 + membersQuery.setPhone(mamiPatient.getPhone());
  821 + List<Members> memberses = membersService.queryMembers(membersQuery);
  822 + if (CollectionUtils.isNotEmpty(memberses))
  823 + {
  824 + mamiPatient.setMemberId(memberses.get(0).getId());
  825 + }
823 826 }
824   - }
825 827  
826   - mamiPatient.setCrisis(setCric(patients));
827   - logger.info("aouPatients" + patients.getId());
828   - stopWatch3.start("aouPatients");
829   - //增加建档记录
830   - patientsService.aouPatients(mamiPatient);
831   - stopWatch3.stop();
832   - //绑定用户
833   - bandingMember(mamiPatient);
834   - logger.info("bandingMember" + patients.getId());
835   - //处理建档关系
836   - handlBuild(patients, mamiPatient, stopWatch3);
837   - //处理risk
838   - handLastRisk(patients, mamiPatient.getId());
839   - //处理初诊
840   - handleAntExc(patients, mamiPatient, stopWatch3);
841   - //处理复诊
842   - handleAntEx(patients, mamiPatient, stopWatch3);
  828 + mamiPatient.setCrisis(setCric(patients));
  829 + logger.info("aouPatients" + patients.getId());
  830 + stopWatch3.start("aouPatients");
  831 + //增加建档记录
  832 + patientsService.aouPatients(mamiPatient);
  833 + stopWatch3.stop();
  834 + //绑定用户
  835 + bandingMember(mamiPatient);
  836 + logger.info("bandingMember" + patients.getId());
  837 + //处理建档关系
  838 + handlBuild(patients, mamiPatient, stopWatch3);
  839 + //处理risk
  840 + handLastRisk(patients, mamiPatient.getId());
  841 + //处理初诊
  842 + handleAntExc(patients, mamiPatient, stopWatch3);
  843 + //处理复诊
  844 + handleAntEx(patients, mamiPatient, stopWatch3);
843 845  
844   - logger.info(stopWatch3.toString());
  846 + logger.info(stopWatch3.toString());
  847 + }catch (Exception e){
  848 + ERROR_LOGGER.error("handl patient :"+patients.getId()+", hospitalId:" + hospitalId, e);
  849 + }
845 850 }
846 851 }
847 852 logger.info("hospital " + hospitalId + ",costTime:" + (System.currentTimeMillis() - l));