Commit 6fbe7515bee2279378851e989af861a672215522
1 parent
e31fd56db7
Exists in
master
and in
6 other branches
增加soureceid
Showing 1 changed file with 234 additions and 113 deletions
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java
View file @
6fbe751
... | ... | @@ -328,114 +328,187 @@ |
328 | 328 | } |
329 | 329 | } |
330 | 330 | continue; |
331 | - } | |
332 | - //高危 | |
333 | - if ("高危因素".equals(key)) | |
331 | + } else if ("体重".equals(key)) | |
334 | 332 | { |
335 | - List map = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
336 | - if (CollectionUtils.isNotEmpty(map)) | |
333 | + dataMap.put("k", "体重"); | |
334 | + if (null != obj) | |
337 | 335 | { |
338 | - StringBuilder sb = new StringBuilder(); | |
339 | - for (Object str : map) | |
336 | + dataMap.put("v", obj + "kg"); | |
337 | + } else | |
338 | + { | |
339 | + dataMap.put("v", "-"); | |
340 | + } | |
341 | + | |
342 | + list.add(dataMap); | |
343 | + continue; | |
344 | + } else if ("宫高".equals(key)) | |
345 | + { | |
346 | + dataMap.put("k", key); | |
347 | + if (null != obj) | |
348 | + { | |
349 | + dataMap.put("v", obj + "cm"); | |
350 | + } else | |
351 | + { | |
352 | + dataMap.put("v", "-"); | |
353 | + } | |
354 | + | |
355 | + list.add(dataMap); | |
356 | + continue; | |
357 | + } else if ("腹围".equals(key)) | |
358 | + { | |
359 | + dataMap.put("k", key); | |
360 | + if (null != obj) | |
361 | + { | |
362 | + dataMap.put("v", obj + "cm"); | |
363 | + } else | |
364 | + { | |
365 | + dataMap.put("v", "-"); | |
366 | + } | |
367 | + | |
368 | + list.add(dataMap); | |
369 | + continue; | |
370 | + } else if ("孕前体重".equals(key)) | |
371 | + { | |
372 | + dataMap.put("k", key); | |
373 | + if (null != obj) | |
374 | + { | |
375 | + dataMap.put("v", obj + "kg"); | |
376 | + } else | |
377 | + { | |
378 | + dataMap.put("v", "-"); | |
379 | + } | |
380 | + | |
381 | + list.add(dataMap); | |
382 | + continue; | |
383 | + } else if ("身高".equals(key)) | |
384 | + { | |
385 | + dataMap.put("k", key); | |
386 | + if (null != obj) | |
387 | + { | |
388 | + dataMap.put("v", obj + "cm"); | |
389 | + } else | |
390 | + { | |
391 | + dataMap.put("v", "-"); | |
392 | + } | |
393 | + list.add(dataMap); | |
394 | + continue; | |
395 | + } else | |
396 | + //高危 | |
397 | + if ("高危因素".equals(key)) | |
398 | + { | |
399 | + List map = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
400 | + if (CollectionUtils.isNotEmpty(map)) | |
340 | 401 | { |
341 | - if (null != str && org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) | |
402 | + StringBuilder sb = new StringBuilder(); | |
403 | + for (Object str : map) | |
342 | 404 | { |
343 | - String val = bgMap.get(str.toString()); | |
344 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(val)) | |
405 | + if (null != str && org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) | |
345 | 406 | { |
346 | - sb.append(val).append("、"); | |
407 | + String val = bgMap.get(str.toString()); | |
408 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(val)) | |
409 | + { | |
410 | + sb.append(val).append("、"); | |
411 | + } | |
347 | 412 | } |
348 | 413 | } |
349 | - } | |
350 | - if (null != antExChuModel.getOtherHighRisk() && !"{}".equals(antExChuModel.getOtherHighRisk())) | |
351 | - { | |
352 | - Map map1 = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class); | |
353 | - Object rh = map1.get("fxysu"); | |
354 | - if (null != rh && StringUtils.isNotEmpty(rh.toString())) | |
414 | + if (null != antExChuModel.getOtherHighRisk() && !"{}".equals(antExChuModel.getOtherHighRisk())) | |
355 | 415 | { |
356 | - sb.append(rh); | |
416 | + Map map1 = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class); | |
417 | + Object rh = map1.get("fxysu"); | |
418 | + if (null != rh && StringUtils.isNotEmpty(rh.toString())) | |
419 | + { | |
420 | + sb.append(rh); | |
421 | + } | |
357 | 422 | } |
423 | + //低压 | |
424 | + java.util.Map<String, Object> dataMap1 = new HashMap<>(); | |
425 | + dataMap1.put("k", key); | |
426 | + dataMap1.put("v", sb.toString()); | |
427 | + list.add(dataMap1); | |
358 | 428 | } |
359 | - //低压 | |
360 | - java.util.Map<String, Object> dataMap1 = new HashMap<>(); | |
361 | - dataMap1.put("k", key); | |
362 | - dataMap1.put("v", sb.toString()); | |
363 | - list.add(dataMap1); | |
364 | - } | |
365 | - continue; | |
366 | - } else if ("胎盘".equals(key)) | |
367 | - { | |
368 | - if (CollectionUtils.isNotEmpty(antExChuModel.getPlacentas())) | |
429 | + continue; | |
430 | + } else if ("胎盘".equals(key)) | |
369 | 431 | { |
370 | - String heartRateVal="",fetalPositionVal="",fetalPresentationVal="",joinVal=""; | |
371 | - for (int j =0; j < antExChuModel.getPlacentas().size(); j++) | |
432 | + if (CollectionUtils.isNotEmpty(antExChuModel.getPlacentas())) | |
372 | 433 | { |
373 | - LinkedHashMap map = (LinkedHashMap) antExChuModel.getPlacentas().get(j); | |
374 | - //胎先露、胎方位、胎心率和衔接 | |
375 | - String heartRate = String.valueOf(map.get("heartRate")); | |
376 | - String fetalPosition = String.valueOf(map.get("fetalPosition")); | |
377 | - String fetalPresentation =String.valueOf(map.get("fetalPresentation")); | |
378 | - String join = String.valueOf(map.get("join")); | |
379 | - if(StringUtils.isNotEmpty(heartRate)){ | |
380 | - heartRateVal+=heartRate+"次/分"+","; | |
434 | + String heartRateVal = "", fetalPositionVal = "", fetalPresentationVal = "", joinVal = ""; | |
435 | + for (int j = 0; j < antExChuModel.getPlacentas().size(); j++) | |
436 | + { | |
437 | + 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 + "次/分" + ","; | |
446 | + } | |
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 | + } | |
381 | 459 | } |
382 | - if(StringUtils.isNotEmpty(fetalPosition)){ | |
383 | - fetalPositionVal+= FetalPositionEnums.getTitle(fetalPosition)+","; | |
460 | + if (heartRateVal.endsWith(",")) | |
461 | + { | |
462 | + heartRateVal = heartRateVal.substring(0, heartRateVal.length() - 1); | |
384 | 463 | } |
385 | - if(StringUtils.isNotEmpty(fetalPresentation)){ | |
386 | - fetalPresentationVal+= FetalEnums.getTitle(fetalPresentation)+","; | |
464 | + if (fetalPositionVal.endsWith(",")) | |
465 | + { | |
466 | + fetalPositionVal = fetalPositionVal.substring(0, fetalPositionVal.length() - 1); | |
387 | 467 | } |
388 | - if(StringUtils.isNotEmpty(join)){ | |
389 | - joinVal+=JoinEnums.getTitle(join)+","; | |
468 | + if (fetalPresentationVal.endsWith(",")) | |
469 | + { | |
470 | + fetalPresentationVal = fetalPresentationVal.substring(0, fetalPresentationVal.length() - 1); | |
390 | 471 | } |
391 | - } | |
392 | - if(heartRateVal.endsWith(",")){ | |
393 | - heartRateVal=heartRateVal.substring(0,heartRateVal.length()-1); | |
394 | - } | |
395 | - if(fetalPositionVal.endsWith(",")){ | |
396 | - fetalPositionVal=fetalPositionVal.substring(0,fetalPositionVal.length()-1); | |
397 | - } | |
398 | - if(fetalPresentationVal.endsWith(",")){ | |
399 | - fetalPresentationVal=fetalPresentationVal.substring(0,fetalPresentationVal.length()-1); | |
400 | - } | |
401 | - if(joinVal.endsWith(",")){ | |
402 | - joinVal=joinVal.substring(0,joinVal.length()-1); | |
403 | - } | |
472 | + if (joinVal.endsWith(",")) | |
473 | + { | |
474 | + joinVal = joinVal.substring(0, joinVal.length() - 1); | |
475 | + } | |
404 | 476 | |
405 | - //胎心率 | |
406 | - if(StringUtils.isNotEmpty(heartRateVal)){ | |
407 | - java.util.Map<String, Object> dataMap1 = new HashMap<>(); | |
408 | - dataMap1.put("k", "胎心率"); | |
409 | - dataMap1.put("v", heartRateVal); | |
410 | - list.add(dataMap1); | |
411 | - } | |
412 | - //胎心率 | |
413 | - if(StringUtils.isNotEmpty(fetalPositionVal)) | |
414 | - { | |
415 | - java.util.Map<String, Object> dataMap2 = new HashMap<>(); | |
416 | - dataMap2.put("k", "胎方位"); | |
417 | - dataMap2.put("v", fetalPositionVal); | |
418 | - list.add(dataMap2); | |
419 | - } | |
477 | + //胎心率 | |
478 | + if (StringUtils.isNotEmpty(heartRateVal)) | |
479 | + { | |
480 | + java.util.Map<String, Object> dataMap1 = new HashMap<>(); | |
481 | + dataMap1.put("k", "胎心率"); | |
482 | + dataMap1.put("v", heartRateVal); | |
483 | + list.add(dataMap1); | |
484 | + } | |
485 | + //胎心率 | |
486 | + if (StringUtils.isNotEmpty(fetalPositionVal)) | |
487 | + { | |
488 | + java.util.Map<String, Object> dataMap2 = new HashMap<>(); | |
489 | + dataMap2.put("k", "胎方位"); | |
490 | + dataMap2.put("v", fetalPositionVal); | |
491 | + list.add(dataMap2); | |
492 | + } | |
420 | 493 | |
421 | - //胎先露 | |
422 | - if(StringUtils.isNotEmpty(fetalPresentationVal)) | |
423 | - { | |
424 | - java.util.Map<String, Object> dataMap3 = new HashMap<>(); | |
425 | - dataMap3.put("k", "胎先露"); | |
426 | - dataMap3.put("v", fetalPresentationVal); | |
427 | - list.add(dataMap3); | |
494 | + //胎先露 | |
495 | + if (StringUtils.isNotEmpty(fetalPresentationVal)) | |
496 | + { | |
497 | + java.util.Map<String, Object> dataMap3 = new HashMap<>(); | |
498 | + dataMap3.put("k", "胎先露"); | |
499 | + dataMap3.put("v", fetalPresentationVal); | |
500 | + list.add(dataMap3); | |
501 | + } | |
502 | + if (StringUtils.isNotEmpty(joinVal)) | |
503 | + { | |
504 | + java.util.Map<String, Object> dataMap4 = new HashMap<>(); | |
505 | + dataMap4.put("k", "衔接"); | |
506 | + dataMap4.put("v", joinVal); | |
507 | + list.add(dataMap4); | |
508 | + } | |
428 | 509 | } |
429 | - if(StringUtils.isNotEmpty(joinVal)) | |
430 | - { | |
431 | - java.util.Map<String, Object> dataMap4 = new HashMap<>(); | |
432 | - dataMap4.put("k", "衔接"); | |
433 | - dataMap4.put("v", joinVal); | |
434 | - list.add(dataMap4); | |
435 | - } | |
510 | + continue; | |
436 | 511 | } |
437 | - continue; | |
438 | - } | |
439 | 512 | dataMap.put("k", key); |
440 | 513 | if ("产检医生".equals(key)) |
441 | 514 | { |
442 | 515 | |
... | ... | @@ -514,7 +587,47 @@ |
514 | 587 | } |
515 | 588 | } |
516 | 589 | continue; |
590 | + } else if ("体重".equals(key)) | |
591 | + { | |
592 | + dataMap.put("k", "体重"); | |
593 | + if (null != obj) | |
594 | + { | |
595 | + dataMap.put("v", obj + "kg"); | |
596 | + } else | |
597 | + { | |
598 | + dataMap.put("v", "-"); | |
599 | + } | |
600 | + | |
601 | + list.add(dataMap); | |
602 | + continue; | |
603 | + } else if ("宫高".equals(key)) | |
604 | + { | |
605 | + dataMap.put("k", key); | |
606 | + if (null != obj) | |
607 | + { | |
608 | + dataMap.put("v", obj + "cm"); | |
609 | + } else | |
610 | + { | |
611 | + dataMap.put("v", "-"); | |
612 | + } | |
613 | + | |
614 | + list.add(dataMap); | |
615 | + continue; | |
616 | + } else if ("腹围".equals(key)) | |
617 | + { | |
618 | + dataMap.put("k", key); | |
619 | + if (null != obj) | |
620 | + { | |
621 | + dataMap.put("v", obj + "cm"); | |
622 | + } else | |
623 | + { | |
624 | + dataMap.put("v", "-"); | |
625 | + } | |
626 | + | |
627 | + list.add(dataMap); | |
628 | + continue; | |
517 | 629 | } |
630 | + | |
518 | 631 | //高危 |
519 | 632 | else if ("高危因素".equals(key)) |
520 | 633 | { |
... | ... | @@ -524,7 +637,7 @@ |
524 | 637 | StringBuilder sb = new StringBuilder(); |
525 | 638 | for (Object str : map) |
526 | 639 | { |
527 | - if (null!=str&&org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) | |
640 | + if (null != str && org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) | |
528 | 641 | { |
529 | 642 | String val = hrMap.get(str.toString()); |
530 | 643 | if (org.apache.commons.lang.StringUtils.isNotEmpty(val)) |
531 | 644 | |
532 | 645 | |
533 | 646 | |
534 | 647 | |
535 | 648 | |
536 | 649 | |
537 | 650 | |
538 | 651 | |
539 | 652 | |
540 | 653 | |
541 | 654 | |
... | ... | @@ -556,51 +669,60 @@ |
556 | 669 | { |
557 | 670 | if (CollectionUtils.isNotEmpty(antExChuModel.getTireData())) |
558 | 671 | { |
559 | - String heartRateVal="",fetalPositionVal="",fetalPresentationVal="",joinVal=""; | |
560 | - for (int j =0; j < antExChuModel.getTireData().size(); j++) | |
672 | + String heartRateVal = "", fetalPositionVal = "", fetalPresentationVal = "", joinVal = ""; | |
673 | + for (int j = 0; j < antExChuModel.getTireData().size(); j++) | |
561 | 674 | { |
562 | 675 | LinkedHashMap map = (LinkedHashMap) antExChuModel.getTireData().get(j); |
563 | 676 | //胎先露、胎方位、胎心率和衔接 |
564 | 677 | String heartRate = String.valueOf(map.get("heartRate")); |
565 | 678 | String fetalPosition = String.valueOf(map.get("fetalPosition")); |
566 | - String fetalPresentation =String.valueOf(map.get("fetalPresentation")); | |
679 | + String fetalPresentation = String.valueOf(map.get("fetalPresentation")); | |
567 | 680 | String join = String.valueOf(map.get("join")); |
568 | - if(!"null".equals(heartRate) &&StringUtils.isNotEmpty(heartRate)){ | |
569 | - heartRateVal+=heartRate+"次/分"+","; | |
681 | + if (!"null".equals(heartRate) && StringUtils.isNotEmpty(heartRate)) | |
682 | + { | |
683 | + heartRateVal += heartRate + "次/分" + ","; | |
570 | 684 | } |
571 | - if(!"null".equals(fetalPosition) &&StringUtils.isNotEmpty(fetalPosition)){ | |
572 | - fetalPositionVal+= FetalPositionEnums.getTitle(fetalPosition)+","; | |
685 | + if (!"null".equals(fetalPosition) && StringUtils.isNotEmpty(fetalPosition)) | |
686 | + { | |
687 | + fetalPositionVal += FetalPositionEnums.getTitle(fetalPosition) + ","; | |
573 | 688 | } |
574 | - if(!"null".equals(fetalPresentation) &&StringUtils.isNotEmpty(fetalPresentation)){ | |
575 | - fetalPresentationVal+= FetalEnums.getTitle(fetalPresentation)+","; | |
689 | + if (!"null".equals(fetalPresentation) && StringUtils.isNotEmpty(fetalPresentation)) | |
690 | + { | |
691 | + fetalPresentationVal += FetalEnums.getTitle(fetalPresentation) + ","; | |
576 | 692 | } |
577 | - if(!"null".equals(join) &&StringUtils.isNotEmpty(join)){ | |
578 | - joinVal+=JoinEnums.getTitle(join)+","; | |
693 | + if (!"null".equals(join) && StringUtils.isNotEmpty(join)) | |
694 | + { | |
695 | + joinVal += JoinEnums.getTitle(join) + ","; | |
579 | 696 | } |
580 | 697 | } |
581 | - if(heartRateVal.endsWith(",")){ | |
582 | - heartRateVal=heartRateVal.substring(0,heartRateVal.length()-1); | |
698 | + if (heartRateVal.endsWith(",")) | |
699 | + { | |
700 | + heartRateVal = heartRateVal.substring(0, heartRateVal.length() - 1); | |
583 | 701 | } |
584 | - if(fetalPositionVal.endsWith(",")){ | |
585 | - fetalPositionVal=fetalPositionVal.substring(0,fetalPositionVal.length()-1); | |
702 | + if (fetalPositionVal.endsWith(",")) | |
703 | + { | |
704 | + fetalPositionVal = fetalPositionVal.substring(0, fetalPositionVal.length() - 1); | |
586 | 705 | } |
587 | - if(fetalPresentationVal.endsWith(",")){ | |
588 | - fetalPresentationVal=fetalPresentationVal.substring(0,fetalPresentationVal.length()-1); | |
706 | + if (fetalPresentationVal.endsWith(",")) | |
707 | + { | |
708 | + fetalPresentationVal = fetalPresentationVal.substring(0, fetalPresentationVal.length() - 1); | |
589 | 709 | } |
590 | - if(joinVal.endsWith(",")){ | |
591 | - joinVal=joinVal.substring(0,joinVal.length()-1); | |
710 | + if (joinVal.endsWith(",")) | |
711 | + { | |
712 | + joinVal = joinVal.substring(0, joinVal.length() - 1); | |
592 | 713 | } |
593 | 714 | |
594 | 715 | |
595 | 716 | //胎心率 |
596 | - if(StringUtils.isNotEmpty(heartRateVal)){ | |
717 | + if (StringUtils.isNotEmpty(heartRateVal)) | |
718 | + { | |
597 | 719 | java.util.Map<String, Object> dataMap1 = new HashMap<>(); |
598 | 720 | dataMap1.put("k", "胎心率"); |
599 | 721 | dataMap1.put("v", heartRateVal); |
600 | 722 | list.add(dataMap1); |
601 | 723 | } |
602 | 724 | //胎心率 |
603 | - if(StringUtils.isNotEmpty(fetalPositionVal)) | |
725 | + if (StringUtils.isNotEmpty(fetalPositionVal)) | |
604 | 726 | { |
605 | 727 | java.util.Map<String, Object> dataMap2 = new HashMap<>(); |
606 | 728 | dataMap2.put("k", "胎方位"); |
607 | 729 | |
... | ... | @@ -609,14 +731,14 @@ |
609 | 731 | } |
610 | 732 | |
611 | 733 | //胎先露 |
612 | - if(StringUtils.isNotEmpty(fetalPresentationVal)) | |
734 | + if (StringUtils.isNotEmpty(fetalPresentationVal)) | |
613 | 735 | { |
614 | 736 | java.util.Map<String, Object> dataMap3 = new HashMap<>(); |
615 | 737 | dataMap3.put("k", "胎先露"); |
616 | 738 | dataMap3.put("v", fetalPresentationVal); |
617 | 739 | list.add(dataMap3); |
618 | 740 | } |
619 | - if(StringUtils.isNotEmpty(joinVal)) | |
741 | + if (StringUtils.isNotEmpty(joinVal)) | |
620 | 742 | { |
621 | 743 | java.util.Map<String, Object> dataMap4 = new HashMap<>(); |
622 | 744 | dataMap4.put("k", "衔接"); |
... | ... | @@ -686,7 +808,6 @@ |
686 | 808 | antExChuModel.setBp("{\"ssy\":70,\"szy\":120}"); |
687 | 809 | antExChuModel.setFuwei("11"); |
688 | 810 | System.out.println(convertAntExChu(antExChuModel, null, null, "").getResult()); |
689 | - | |
690 | 811 | |
691 | 812 | |
692 | 813 | AntenatalExaminationModel antenatalExaminationModel = new AntenatalExaminationModel(); |