Commit 86edc5f1850480df4ac7bd64e55bbcf1be9093b0

Authored by yangfei
1 parent 3326e09fa7

产检编辑时显示筛查结果

Showing 4 changed files with 90 additions and 68 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 86edc5f
... ... @@ -919,7 +919,7 @@
919 919 * @param pid
920 920 * @return
921 921 */
922   - public Map<String,Object> getPatLastScreenResult(String pid) {
  922 + public Map<String, Object> getPatLastScreenResult(String pid) {
923 923 AntExQuery antExQuery = new AntExQuery();
924 924 antExQuery.setParentId(pid);
925 925 antExQuery.setYn(YnEnums.YES.getId());
... ... @@ -931,7 +931,7 @@
931 931 if (!next) {
932 932 break;
933 933 }
934   - highScoreResult.put("screenResult",model.getScreenResult());
  934 + highScoreResult.put("screenResult", model.getScreenResult());
935 935 next = false;
936 936 }
937 937 }
... ... @@ -950,7 +950,7 @@
950 950 if (!next) {
951 951 break;
952 952 }
953   - highScoreResult.put("screenResult",antExChuModel.getScreenResult());
  953 + highScoreResult.put("screenResult", antExChuModel.getScreenResult());
954 954 next = false;
955 955 }
956 956 }
... ... @@ -1432,9 +1432,9 @@
1432 1432 }
1433 1433 //获取产程ID
1434 1434 patientId = patients.getId();
1435   - if(patients.getBuildType()==3){//转诊建档,数据则装入主档案数据中,必须要有主档案,而且是第一条
1436   - if(CollectionUtils.isNotEmpty(sortList)){
1437   - listData = sortList.get(sortList.size()-1);
  1435 + if (patients.getBuildType() == 3) {//转诊建档,数据则装入主档案数据中,必须要有主档案,而且是第一条
  1436 + if (CollectionUtils.isNotEmpty(sortList)) {
  1437 + listData = sortList.get(sortList.size() - 1);
1438 1438 }
1439 1439 }
1440 1440  
... ... @@ -1459,8 +1459,8 @@
1459 1459 } else {
1460 1460 antExChuQuery.setEnd(new Date(patients.getFmDate().getTime() + 86398000));
1461 1461 }
1462   - if (patients2!=null) {
1463   - antExChuQuery.setParentIds(Arrays.asList(patientId,patients2.getId()));
  1462 + if (patients2 != null) {
  1463 + antExChuQuery.setParentIds(Arrays.asList(patientId, patients2.getId()));
1464 1464 } else {
1465 1465 antExChuQuery.setParentId(patientId);
1466 1466 }
... ... @@ -1483,8 +1483,8 @@
1483 1483 } else {
1484 1484 antExQuery.setEnd(new Date(patients.getFmDate().getTime() + 86398000));
1485 1485 }
1486   - if (patients2!=null) {
1487   - antExQuery.setParentIds(Arrays.asList(patientId,patients2.getId()));
  1486 + if (patients2 != null) {
  1487 + antExQuery.setParentIds(Arrays.asList(patientId, patients2.getId()));
1488 1488 } else {
1489 1489 antExQuery.setParentId(patientId);
1490 1490 }
... ... @@ -1504,8 +1504,8 @@
1504 1504 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
1505 1505 matDeliverQuery.setYn(YnEnums.YES.getId());
1506 1506  
1507   - if (patients2!=null) {
1508   - matDeliverQuery.setParentIdList(Arrays.asList(patientId,patients2.getId()));
  1507 + if (patients2 != null) {
  1508 + matDeliverQuery.setParentIdList(Arrays.asList(patientId, patients2.getId()));
1509 1509 } else {
1510 1510 matDeliverQuery.setParentId(patientId);
1511 1511 }
... ... @@ -1520,7 +1520,7 @@
1520 1520 //出院小结
1521 1521 DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery();
1522 1522 dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId());
1523   - if (patients2!=null) {
  1523 + if (patients2 != null) {
1524 1524 dischargeAbstractMotherQuery.setPatientId(patients2.getId());
1525 1525 } else {
1526 1526 dischargeAbstractMotherQuery.setPatientId(patientId);
... ... @@ -1538,7 +1538,7 @@
1538 1538 if (null != patients.getDueStatus() && 1 == patients.getDueStatus()) {
1539 1539 StopPregQuery stopPregQuery = new StopPregQuery();
1540 1540 stopPregQuery.setYn(YnEnums.YES.getId());
1541   - if (patients2!=null) {
  1541 + if (patients2 != null) {
1542 1542 stopPregQuery.setPatientId(patients2.getId());
1543 1543 } else {
1544 1544 stopPregQuery.setPatientId(patientId);
... ... @@ -1555,7 +1555,7 @@
1555 1555 } else {
1556 1556 PostReviewQuery postReviewQuery = new PostReviewQuery();
1557 1557 postReviewQuery.setYn(YnEnums.YES.getId());
1558   - if (patients2!=null) {
  1558 + if (patients2 != null) {
1559 1559 postReviewQuery.setParentId(patients2.getId());
1560 1560 } else {
1561 1561 postReviewQuery.setParentId(patientId);
... ... @@ -1579,7 +1579,7 @@
1579 1579 if (CollectionUtils.isNotEmpty(listData)) {
1580 1580 sort(listData);
1581 1581 updateEditEnable(listData, sortList);
1582   - if(!sortList.contains(listData)){
  1582 + if (!sortList.contains(listData)) {
1583 1583 sortList.add(listData);
1584 1584 }
1585 1585 }
... ... @@ -2048,8 +2048,8 @@
2048 2048 patients1.setoRiskFactor(StringUtils.isNotEmpty(highScoreResult.getOtherRisk()) ? highScoreResult.getOtherRisk() : "");
2049 2049  
2050 2050 //查询最后一次产检筛查结果冗余到patient表
2051   - Map<String,Object> map = getPatLastScreenResult(patients.getId());
2052   - if(map!=null&&map.containsKey("screenResult")){
  2051 + Map<String, Object> map = getPatLastScreenResult(patients.getId());
  2052 + if (map != null && map.containsKey("screenResult")) {
2053 2053 patients1.setScreenResult((List<String>) map.get("screenResult"));
2054 2054 }
2055 2055 patientsService.findAndModify(patientsQuery1, patients1);
2056 2056  
2057 2057  
... ... @@ -2429,14 +2429,24 @@
2429 2429 Assert.notNull(examinationModel, "id不存在.");
2430 2430 AntenatalExaminationResult antenatalExaminationResult = new AntenatalExaminationResult();
2431 2431 antenatalExaminationResult.convertToResult(examinationModel);
  2432 +
2432 2433 try {
  2434 + //筛查结果
  2435 + if (CollectionUtils.isNotEmpty(examinationModel.getScreenResult())) {
  2436 + List<Map<String, Object>> screenResults = getscreenResult(examinationModel.getScreenResult());
  2437 + antenatalExaminationResult.setScreenResult(screenResults);
  2438 + }
  2439 + } catch (Exception e) {
  2440 + e.printStackTrace();
  2441 + }
  2442 + try {
2433 2443 if (StringUtils.isNotEmpty(examinationModel.getRiskFactor())) {
2434 2444 List list1 = JsonUtil.toList(examinationModel.getRiskFactor(), List.class);
2435 2445 HighScoreResult highScoreResult = queryRisk(list1, false);
2436 2446 antenatalExaminationResult.setRiskFactor(highScoreResult.getHighRisk());
2437 2447 }
2438 2448 } catch (Exception e) {
2439   -
  2449 + e.printStackTrace();
2440 2450 }
2441 2451 try {
2442 2452 if (StringUtils.isNotEmpty(examinationModel.getDiagnosis())) {
... ... @@ -2515,7 +2525,7 @@
2515 2525 }
2516 2526 if (null != antExChuModel) {
2517 2527 Patients patients = patientsService.findOnePatientById(antExChuModel.getParentId());
2518   - if(patients!=null){
  2528 + if (patients != null) {
2519 2529 //月经周期
2520 2530 String mensDay = "";
2521 2531 if (patients.getMensEndDay() != null) {
2522 2532  
... ... @@ -2532,7 +2542,19 @@
2532 2542 }
2533 2543  
2534 2544 antexChuResult.convertToResult(antExChuModel);
  2545 +
2535 2546 try {
  2547 + //筛查结果
  2548 + if (CollectionUtils.isNotEmpty(antExChuModel.getScreenResult())) {
  2549 + List<Map<String, Object>> screenResults = getscreenResult(antExChuModel.getScreenResult());
  2550 + antexChuResult.setScreenResult(screenResults);
  2551 + }
  2552 + } catch (Exception e) {
  2553 + e.printStackTrace();
  2554 + }
  2555 +
  2556 +
  2557 + try {
2536 2558 if (StringUtils.isNotEmpty(antExChuModel.getDiagnosis())) {
2537 2559 List list = JsonUtil.toList(antExChuModel.getDiagnosis(), List.class);
2538 2560 antexChuResult.setDiagnosis(queryRisk(list, false).getHighRisk());
2539 2561  
... ... @@ -2593,7 +2615,27 @@
2593 2615 return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
2594 2616 }
2595 2617  
  2618 + private List<Map<String, Object>> getscreenResult(List<String> screenResult) {
  2619 + List<Map<String, Object>> list = new ArrayList<>();
  2620 + if (CollectionUtils.isNotEmpty(screenResult)) {
  2621 + BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
  2622 + for (String scr : screenResult) {
  2623 + basicConfigQuery.setId(scr);
  2624 + List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery);
  2625 + if (CollectionUtils.isNotEmpty(basicConfigs)) {
  2626 + for (BasicConfig basicConfig : basicConfigs) {
  2627 + Map<String, Object> scrMap = new HashMap<>();
  2628 + scrMap.put("id", basicConfig.getId());
  2629 + scrMap.put("name", basicConfig.getName());
  2630 + list.add(scrMap);
  2631 + }
  2632 + }
  2633 + }
  2634 + }
  2635 + return list;
  2636 + }
2596 2637  
  2638 +
2597 2639 public HighScoreResult queryRisk(List<String> id, boolean n) {
2598 2640 HighScoreResult highScoreResult = new HighScoreResult();
2599 2641 BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
... ... @@ -2847,7 +2889,7 @@
2847 2889  
2848 2890 public BaseResponse getGongGaoLine(String patientId, Integer id) {
2849 2891  
2850   - Map<String,Object> map = new HashMap<>();
  2892 + Map<String, Object> map = new HashMap<>();
2851 2893  
2852 2894 List<String> titles = new ArrayList<>();
2853 2895 List<String> values = new ArrayList<>();
2854 2896  
2855 2897  
2856 2898  
2857 2899  
2858 2900  
2859 2901  
2860 2902  
... ... @@ -2857,55 +2899,43 @@
2857 2899  
2858 2900 List<String> patientIds = new ArrayList<>();
2859 2901  
2860   - if (patients != null)
2861   - {
  2902 + if (patients != null) {
2862 2903 PatientsQuery patientsQuery = new PatientsQuery();
2863 2904 patientsQuery.setYn(YnEnums.YES.getId());
2864 2905 patientsQuery.setPid(patients.getPid());
2865 2906 List<Patients> patientses = patientsService.queryPatient(patientsQuery);
2866   - if (CollectionUtils.isNotEmpty(patientses))
2867   - {
2868   - for (Patients pat : patientses)
2869   - {
  2907 + if (CollectionUtils.isNotEmpty(patientses)) {
  2908 + for (Patients pat : patientses) {
2870 2909 patientIds.add(pat.getId());
2871 2910 }
2872 2911 }
2873   - }
2874   - else
2875   - {
  2912 + } else {
2876 2913 patientIds.add(patientId);
2877 2914 }
2878 2915  
2879   - List<Map<String,String>> tables = new LinkedList<>();
  2916 + List<Map<String, String>> tables = new LinkedList<>();
2880 2917  
2881 2918 AntExChuQuery antExChuQuery = new AntExChuQuery();
2882 2919 antExChuQuery.setYn(YnEnums.YES.getId());
2883 2920 antExChuQuery.setParentIds(patientIds);
2884   - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery,Sort.Direction.ASC, "created");
2885   - if (CollectionUtils.isNotEmpty(antExChuModels))
2886   - {
2887   - for (AntExChuModel chumodel : antExChuModels)
2888   - {
2889   - if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect()))
2890   - {
2891   - Map<String,String> item = new HashMap<>();
  2921 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery, Sort.Direction.ASC, "created");
  2922 + if (CollectionUtils.isNotEmpty(antExChuModels)) {
  2923 + for (AntExChuModel chumodel : antExChuModels) {
  2924 + if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) {
  2925 + Map<String, String> item = new HashMap<>();
2892 2926 String value = "";
2893   - if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect()) )
2894   - {
  2927 + if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) {
2895 2928 if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) {
2896 2929 value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType());
2897 2930 } else {
2898 2931 value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect());
2899 2932 }
2900   - }
2901   - else if (StringUtils.isNotEmpty(chumodel.getGonggao()))
2902   - {
  2933 + } else if (StringUtils.isNotEmpty(chumodel.getGonggao())) {
2903 2934 value = chumodel.getGonggao();
2904 2935 }
2905 2936 item.put("value", value);
2906 2937 item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
2907   - if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches()))
2908   - {
  2938 + if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches())) {
2909 2939 titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
2910 2940 values.add(chumodel.getGonggao());
2911 2941 }
2912 2942  
2913 2943  
2914 2944  
... ... @@ -2919,32 +2949,25 @@
2919 2949 antExQuery.setParentIds(patientIds);
2920 2950 antExQuery.setYn(YnEnums.YES.getId());
2921 2951 List<AntenatalExaminationModel> examinationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.ASC, "created"));
2922   - if (CollectionUtils.isNotEmpty(examinationModelList))
2923   - {
2924   - for (AntenatalExaminationModel anmodel : examinationModelList)
2925   - {
2926   - if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect()))
2927   - {
2928   - Map<String,String> item = new HashMap<>();
  2952 + if (CollectionUtils.isNotEmpty(examinationModelList)) {
  2953 + for (AntenatalExaminationModel anmodel : examinationModelList) {
  2954 + if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) {
  2955 + Map<String, String> item = new HashMap<>();
2929 2956  
2930 2957 String value = "";
2931   - if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect()) )
2932   - {
  2958 + if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) {
2933 2959 if (StringUtils.isNotEmpty(anmodel.getGongGaoType())) {
2934 2960 value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect()) + "," + GongJingEnums.getHengZhiNameById(anmodel.getGongGaoType());
2935 2961 } else {
2936 2962 value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect());
2937 2963 }
2938   - }
2939   - else if (StringUtils.isNotEmpty(anmodel.getGongGao()))
2940   - {
  2964 + } else if (StringUtils.isNotEmpty(anmodel.getGongGao())) {
2941 2965 value = anmodel.getGongGao();
2942 2966 }
2943 2967  
2944 2968 item.put("value", value);
2945 2969 item.put("time", DateUtil.getyyyy_MM_dd(anmodel.getCheckDate()));
2946   - if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches()))
2947   - {
  2970 + if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches())) {
2948 2971 titles.add(DateUtil.getyyyy_MM_dd(anmodel.getCheckDate()));
2949 2972 values.add(anmodel.getGongGao());
2950 2973 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 86edc5f
... ... @@ -1756,6 +1756,7 @@
1756 1756 basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID);
1757 1757 basicConfigQuery.setKeyword(keyword);
1758 1758 List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery);
  1759 + // System.out.println(basicConfigQuery.convertToQuery().convertToMongoQuery());
1759 1760 List<BasicConfigResult> configResults = new ArrayList<>();
1760 1761 if (datas != null) {
1761 1762 for (BasicConfig data : datas) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntenatalExaminationResult.java View file @ 86edc5f
... ... @@ -60,15 +60,15 @@
60 60 */
61 61 private String quickenRemark;
62 62 //筛查结果
63   - private List<String> screenResult;
  63 + private List<Map<String,Object>> screenResult;
64 64 //结果补充
65 65 private String resultSupple;
66 66  
67   - public List<String> getScreenResult() {
  67 + public List<Map<String, Object>> getScreenResult() {
68 68 return screenResult;
69 69 }
70 70  
71   - public void setScreenResult(List<String> screenResult) {
  71 + public void setScreenResult(List<Map<String, Object>> screenResult) {
72 72 this.screenResult = screenResult;
73 73 }
74 74  
... ... @@ -587,7 +587,6 @@
587 587 @Override
588 588 public AntenatalExaminationResult convertToResult(AntenatalExaminationModel destModel) {
589 589 setResultSupple(destModel.getResultSupple());
590   - setScreenResult(destModel.getScreenResult());
591 590 setTtita(destModel.getTtita());
592 591 setTotalThy(destModel.getTotalThy());
593 592 setFtita(destModel.getFtita());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexChuResult.java View file @ 86edc5f
... ... @@ -83,15 +83,15 @@
83 83 private String quickenRemark;
84 84  
85 85 //筛查结果
86   - private List<String> screenResult;
  86 + private List<Map<String, Object>> screenResult;
87 87 //结果补充
88 88 private String resultSupple;
89 89  
90   - public List<String> getScreenResult() {
  90 + public List<Map<String, Object>> getScreenResult() {
91 91 return screenResult;
92 92 }
93 93  
94   - public void setScreenResult(List<String> screenResult) {
  94 + public void setScreenResult(List<Map<String, Object>> screenResult) {
95 95 this.screenResult = screenResult;
96 96 }
97 97  
... ... @@ -1561,7 +1561,6 @@
1561 1561  
1562 1562 public AntexChuResult convertToResult(AntExChuModel antExChuModel) {
1563 1563 if (null != antExChuModel) {
1564   - setScreenResult(antExChuModel.getScreenResult());
1565 1564 setResultSupple(antExChuModel.getResultSupple());
1566 1565 setTtita(antExChuModel.getTtita());
1567 1566 setTotalThy(antExChuModel.getTotalThy());