Commit 95a2857e83684ff9933424ecd6229ae76061ec63

Authored by liquanyu
1 parent f88a16ba57

update code

Showing 3 changed files with 142 additions and 32 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/FmPatInfo.java View file @ 95a2857
... ... @@ -39,6 +39,10 @@
39 39 }
40 40  
41 41 public String getCardNo() {
  42 + if (cardNo != null)
  43 + {
  44 + return cardNo.trim();
  45 + }
42 46 return cardNo;
43 47 }
44 48  
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java View file @ 95a2857
... ... @@ -50,6 +50,48 @@
50 50 @Autowired
51 51 private QhdfyHisService qhdfyHisService;
52 52  
  53 + private static Map<Integer, String> ONE_ENUMS = new HashMap<>();
  54 +
  55 + private static Map<String, List> babyMap = new HashMap<>();
  56 +
  57 + static {
  58 + ONE_ENUMS.put(0, "长");
  59 + ONE_ENUMS.put(1, "次");
  60 + ONE_ENUMS.put(2, "三");
  61 + ONE_ENUMS.put(3, "四");
  62 + ONE_ENUMS.put(4, "五");
  63 + ONE_ENUMS.put(5, "六");
  64 + ONE_ENUMS.put(6, "七");
  65 +
  66 +
  67 + List<String> b1 = new ArrayList<>();
  68 + b1.add("长女");
  69 + b1.add("次女");
  70 + babyMap.put("00", b1);
  71 +
  72 + List<String> b2 = new ArrayList<>();
  73 + b2.add("长子");
  74 + b2.add("次子");
  75 + babyMap.put("11", b2);
  76 +
  77 + List<String> b3 = new ArrayList<>();
  78 + b3.add("之子");
  79 + b3.add("之女");
  80 +
  81 + List<String> b4 = new ArrayList<>();
  82 + b4.add("之女");
  83 + b4.add("之子");
  84 + babyMap.put("01", b4);
  85 + babyMap.put("10", b3);
  86 + List<String> b5 = new ArrayList<>();
  87 + b5.add("之子");
  88 + List<String> b6 = new ArrayList<>();
  89 + b6.add("之女");
  90 +
  91 + babyMap.put("1", b5);
  92 + babyMap.put("0", b6);
  93 + }
  94 +
53 95 public void fmTimerWork() {
54 96 SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
55 97 Date end = new Date();
... ... @@ -178,7 +220,7 @@
178 220 if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(item.getSsrq())) {
179 221 continue;
180 222 }
181   -
  223 + deliverAddRequest.setDeliverDoctor(users.get(0).getId()+"");
182 224 deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate));
183 225 deliverAddRequest.setParentId(patient.getId());
184 226 deliverAddRequest.setPid(patient.getPid());
185 227  
... ... @@ -186,13 +228,20 @@
186 228 String week = "";
187 229 if (StringUtils.isNotEmpty(item.getRc())) {
188 230  
189   - if (item.getRc().split("\\u002B").length > 1) {
190   - week = item.getRc().split("\\u002B")[0] + "周";
191   - week += item.getRc().split("\\u002B")[1] + "天";
192   - } else {
193   - week = item.getRc() + "周";
  231 + week = item.getRc() + "周";
  232 + if (StringUtils.isNotEmpty(item.getRc()) && StringUtils.isNotEmpty(item.getJts()))
  233 + {
194 234 week += item.getJts() + "天";
195 235 }
  236 +
  237 +
  238 +// if (item.getRc().split("\\u002B").length > 1) {
  239 +// week = item.getRc().split("\\u002B")[0] + "周";
  240 +// week += item.getRc().split("\\u002B")[1] + "天";
  241 +// } else {
  242 +// week = item.getRc() + "周";
  243 +// week += item.getJts() + "天";
  244 +// }
196 245 deliverAddRequest.setDueWeek(week);
197 246 }
198 247  
... ... @@ -269,7 +318,8 @@
269 318 }
270 319 else
271 320 { //秦皇岛服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据
272   - buildBaby( item, patInfo, dueDate);
  321 + String babyName = patInfo.getName()+("男".equals(item.getYexb()) ? "之子" : "之女");
  322 + buildBaby( item, patInfo, dueDate,babyName);
273 323 }
274 324 }
275 325 else
... ... @@ -299,9 +349,6 @@
299 349 List<FmItem> duoTaiList = queryRunner.query(conn,sql1
300 350 , new BeanListHandler<FmItem>(FmItem.class));
301 351  
302   -
303   - ExceptionUtils.catchException("duo tai size====" + duoTaiList.size());
304   -
305 352 if (CollectionUtils.isNotEmpty(duoTaiList)) {
306 353 Map<String,List<FmItem>> maps = new HashMap<>();
307 354 for(FmItem item : duoTaiList)
... ... @@ -375,6 +422,7 @@
375 422 continue;
376 423 }
377 424  
  425 + deliverAddRequest.setDeliverDoctor(users.get(0).getId()+"");
378 426 deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate));
379 427 deliverAddRequest.setParentId(patient.getId());
380 428 deliverAddRequest.setPid(patient.getPid());
381 429  
382 430  
... ... @@ -382,16 +430,23 @@
382 430 if (StringUtils.isNotEmpty(item.getRc()))
383 431 {
384 432 String week = "";
385   - if (item.getRc().split("\\u002B").length > 1)
  433 +
  434 + week = item.getRc() + "周";
  435 + if (StringUtils.isNotEmpty(item.getRc()) && StringUtils.isNotEmpty(item.getJts()))
386 436 {
387   - week = item.getRc().split("\\u002B")[0]+"周";
388   - week+= item.getRc().split("\\u002B")[1]+"天";
  437 + week += item.getJts() + "天";
389 438 }
390   - else
391   - {
392   - week = item.getRc()+"周";
393   - week+=item.getJts()+"天";
394   - }
  439 +
  440 +// if (item.getRc().split("\\u002B").length > 1)
  441 +// {
  442 +// week = item.getRc().split("\\u002B")[0]+"周";
  443 +// week+= item.getRc().split("\\u002B")[1]+"天";
  444 +// }
  445 +// else
  446 +// {
  447 +// week = item.getRc()+"周";
  448 +// week+=item.getJts()+"天";
  449 +// }
395 450 deliverAddRequest.setDueWeek(week);
396 451 }
397 452  
398 453  
... ... @@ -441,10 +496,14 @@
441 496 {
442 497 continue;
443 498 }
444   - Date dueDate1 = fmt.parse(dueDateStr1);
  499 + Date dueDate1 = null;
  500 + try{
  501 + dueDate1 = fmt2.parse(dueDateStr);
  502 + }catch (Exception e)
  503 + {
  504 + dueDate1 = fmt.parse(dueDateStr);
  505 + }
445 506  
446   -
447   -
448 507 Map deliveryMode = new HashMap(); //分娩方式
449 508  
450 509 String fmfs = "";
... ... @@ -468,9 +527,6 @@
468 527 }
469 528 extPlacenta.setTpmcType(tpmcType);
470 529  
471   -// Map map = new HashMap();
472   -// extPlacenta.setTpSize(map);
473   -
474 530 extPlacentas.add(extPlacenta);
475 531 deliverAddRequest.setExtPlacentas(extPlacentas);
476 532  
477 533  
478 534  
... ... @@ -502,15 +558,26 @@
502 558 }
503 559 else
504 560 {
  561 + List names = buildBabyName(items);
  562 + int count = 0;
505 563 for (FmItem i : items)
506 564 {
  565 + ExceptionUtils.catchException("items == "+items.size());
507 566 String dueDateStr1 = i.getSsrq();
508 567 if (!StringUtils.isNotEmpty(dueDateStr1))
509 568 {
510 569 continue;
511 570 }
512   - Date dueDate1 = fmt.parse(dueDateStr1);
513   - buildBaby( i,patInfo, dueDate1);
  571 + Date dueDate1 = null;
  572 + try{
  573 + dueDate1 = fmt2.parse(dueDateStr);
  574 + }catch (Exception e)
  575 + {
  576 + dueDate1 = fmt.parse(dueDateStr);
  577 + }
  578 +
  579 + buildBaby( i,patInfo, dueDate1,patInfo.getName()+names.get(count).toString());
  580 + count++;
514 581 }
515 582  
516 583 }
... ... @@ -540,6 +607,45 @@
540 607 }
541 608  
542 609  
  610 +
  611 + private List buildBabyName(List<FmItem> items) {
  612 + String id = "";
  613 + if (items.size() > 2) {
  614 + int boyCount = 0;
  615 + int girlCount = 0;
  616 + List<String> l = new ArrayList<>();
  617 + for (int i = 0; i < items.size(); i++) {
  618 + FmItem item = items.get(i);
  619 + if (org.apache.commons.lang.StringUtils.isNotEmpty(item.getYexb())) {
  620 + if ("男".equals(item.getYexb())) {
  621 + l.add(ONE_ENUMS.get(boyCount) + "子");
  622 + boyCount++;
  623 + } else if ("女".equals(item.getYexb())) {
  624 + l.add(ONE_ENUMS.get(girlCount) + "女");
  625 + girlCount++;
  626 + }
  627 + }
  628 + }
  629 + return l;
  630 + } else {
  631 + for (int i = 0; i < items.size(); i++) {
  632 + FmItem item = items.get(i);
  633 + if (org.apache.commons.lang.StringUtils.isNotEmpty(item.getYexb())) {
  634 + if ("男".equals(item.getYexb()))
  635 + {
  636 + id += "1";
  637 + }
  638 + else if ("女".equals(item.getYexb()))
  639 + {
  640 + id += "0";
  641 + }
  642 +
  643 + }
  644 + }
  645 + return babyMap.get(id);
  646 + }
  647 + }
  648 +
543 649 private void saveFmrecord(String syxh)
544 650 {
545 651 FmRecordModel fmRecordModel = new FmRecordModel();
... ... @@ -548,7 +654,7 @@
548 654 }
549 655  
550 656  
551   - public void buildBaby(FmItem item,FmPatInfo patInfo, Date dueDate)
  657 + public void buildBaby(FmItem item,FmPatInfo patInfo, Date dueDate, String babyName)
552 658 {
553 659 try{
554 660 ExceptionUtils.catchException("buildBaby====");
... ... @@ -583,7 +689,7 @@
583 689 }
584 690  
585 691  
586   - if (StringUtils.isNotEmpty(patInfo.getCardNo()))
  692 + if (org.apache.commons.lang.StringUtils.isNotEmpty(patInfo.getCardNo()))
587 693 {
588 694 request.setMommyCertificateTypeId("70ae1d93-2964-46bc-83fa-bec9ff605b1c"); //证件类型 (身份证号码)
589 695 request.setMommyCertificateNum(patInfo.getCardNo()); //证件号
... ... @@ -595,7 +701,7 @@
595 701 }
596 702  
597 703 request.setMommyPhone(patInfo.getPhone());
598   - String babyName = patInfo.getName()+("男".equals(item.getYexb()) ? "之子" : "之女");
  704 +
599 705 request.setBabyName(babyName);
600 706 request.setSex("男".equals(item.getYexb()) ? 1 : 0);
601 707  
... ... @@ -648,8 +754,6 @@
648 754 request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务
649 755 request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通
650 756  
651   - babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId());
652   -
653 757 if (patInfo != null && StringUtils.isNotEmpty(patInfo.getBlh()))
654 758 {
655 759 Map<String,Object> diags = qhdfyHisService.queryHisBabyDiagnosis(patInfo.getBlh());
... ... @@ -659,6 +763,7 @@
659 763 request.setBabyDiagnosis(diags.get("diagnosisItem") == null ? "" : diags.get("diagnosisItem").toString());
660 764 }
661 765 }
  766 + babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId());
662 767  
663 768 }catch (Exception e)
664 769 {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 95a2857
... ... @@ -912,8 +912,9 @@
912 912 if (fmfs!=null){
913 913 if (fmfs.equals("1")){
914 914 String fmName = FmTypeEnums.getFmNameById(fmfs);
  915 + sb.append(fmName);
915 916 if(null!=m.get("scfs")){
916   - sb.append(fmName).append(",");
  917 + sb.append(",");
917 918 String scfs =m.get("scfs") .toString();
918 919 sb.append(FmTypeEnums.getFmScNameById(scfs));
919 920 }