Commit 1e8e6e120d0e43941d531e3347e3625cece6845b

Authored by gengxiaokai
1 parent 34a4f4c771

秦皇岛冠新接口修改

Showing 1 changed file with 214 additions and 128 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java View file @ 1e8e6e1
1 1 package com.lyms.hospitalapi.qhdfy;
2 2  
3 3 import com.lyms.platform.biz.service.*;
  4 +import com.lyms.platform.common.enums.RenShenJieJuEnums;
  5 +import com.lyms.platform.common.enums.SexEnum;
4 6 import com.lyms.platform.common.enums.YnEnums;
5 7 import com.lyms.platform.common.utils.DateUtil;
6 8 import com.lyms.platform.common.utils.JsonUtil;
7   -import com.lyms.platform.operate.web.utils.CommonsHelper;
8   -import com.lyms.platform.operate.web.utils.FunvCommonUtil;
9   -import com.lyms.platform.operate.web.utils.ResolveUtils;
  9 +import com.lyms.platform.operate.web.utils.*;
10 10 import com.lyms.platform.permission.model.Organization;
11 11 import com.lyms.platform.permission.model.Users;
12 12 import com.lyms.platform.permission.service.OrganizationService;
13 13  
14 14  
15 15  
16 16  
17 17  
18 18  
19 19  
20 20  
21 21  
22 22  
23 23  
24 24  
25 25  
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
... ... @@ -424,162 +424,248 @@
424 424 if(list != null && list.size() > 0){
425 425 for(MaternalDeliverModel data : list) {
426 426 Patients patients = patientsService.findOnePatientById(data.getParentId());
  427 +
  428 + //新生儿信息
  429 + List<Map<String, Object>> babyList = new ArrayList<>();
  430 +
427 431 try {
428   - String cDueWeek = data.getDueWeek();
429   - int week = Integer.parseInt(cDueWeek.substring(1, cDueWeek.indexOf("周")));
430   - int day = Integer.parseInt(cDueWeek.substring(cDueWeek.indexOf("+") + 1, cDueWeek.indexOf("天")));
431   - Map<String,String> map = new HashMap<String,String>();
432   - map.put("MATERNALCHILDBIRTHID",data.getId());
433   - map.put("MATERNALINFOID",patients.getId());
434   - map.put("NAME", patients.getUsername());
435   - String fmHospital = "";
436 432  
437   - if (StringUtils.isNotEmpty(data.getFmHospital())) {
438   - if (com.lyms.platform.common.utils.StringUtils.isNum(data.getFmHospital())) {
439   - Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital()));
440   - if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
441   - fmHospital = organization.getName();
442   - }
443   - } else {
444   - fmHospital = data.getFmHospital();
  433 + if (CollectionUtils.isNotEmpty(data.getBaby())) {
  434 + for (MaternalDeliverModel.Baby temp : data.getBaby()) {
  435 + Map<String, Object> babyMap = new HashMap<>();
  436 + babyMap.put("nbnaNum", UnitUtils.unitSplice(temp.getNbnaNum(), UnitConstants.FEN));
  437 + babyMap.put("jxWn", temp.isJxWn());
  438 + babyMap.put("jxJzl", temp.isJxJzl());
  439 + babyMap.put("jxNpc", temp.isJxNpc());
  440 + babyMap.put("jxNjs", temp.isJxNjs());
  441 + babyMap.put("jxEl", temp.isJxEl());
  442 + babyMap.put("jxelSele", temp.getJxelSele());
  443 + babyMap.put("jxCl", temp.isJxCl());
  444 + babyMap.put("jxClSele", temp.getJxClSele());
  445 + babyMap.put("jxClhb", temp.isJxClhb());
  446 + babyMap.put("jxClhbSele", temp.getJxClhbSele());
  447 + babyMap.put("jxXe", temp.isJxXe());
  448 + babyMap.put("jxXeSele", temp.getJxXeSele());
  449 + babyMap.put("jxWe", temp.isJxWe());
  450 + babyMap.put("jxWeSele", temp.getJxWeSele());
  451 + babyMap.put("jxSdbs", temp.isJxSdbs());
  452 + babyMap.put("jxZcgm", temp.isJxZcgm());
  453 + babyMap.put("jxNdxl", temp.isJxNdxl());
  454 + babyMap.put("jxPwwf", temp.isJxPwwf());
  455 + babyMap.put("jxMtn", temp.isJxMtn());
  456 + babyMap.put("jxMtnSele", temp.getJxMtnSele());
  457 + babyMap.put("jxDz", temp.isJxDz());
  458 + babyMap.put("jxDzSele", temp.getJxDzSele());
  459 + babyMap.put("jxDc", temp.isJxDc());
  460 + babyMap.put("jxDcSele", temp.getJxDcSele());
  461 + babyMap.put("jxBz", temp.isJxBz());
  462 + babyMap.put("jxBzSele", temp.getJxBzSele());
  463 + babyMap.put("jxBc", temp.isJxBc());
  464 + babyMap.put("jxBcSele", temp.getJxBcSele());
  465 + babyMap.put("jxZtds", temp.isJxZtds());
  466 + babyMap.put("jxZtdsTopSele", temp.getJxZtdsTopSele());
  467 + babyMap.put("jxZtdsBottomSele", temp.getJxZtdsBottomSele());
  468 + babyMap.put("jxXtxe", temp.isJxXtxe());
  469 + babyMap.put("jxQpc", temp.isJxQpc());
  470 + babyMap.put("jxFl", temp.isJxFl());
  471 + babyMap.put("jxLtst", temp.isJxLtst());
  472 + babyMap.put("jxTszh", temp.isJxTszh());
  473 + babyMap.put("jxXtx", temp.isJxXtx());
  474 + babyMap.put("jxOther", temp.getJxOther());
  475 +
  476 +
  477 + babyMap.put("babyId", temp.getId());
  478 + babyMap.put("dueTime", temp.getDueTime());
  479 + babyMap.put("pregnancyOut", temp.getPregnancyOut() == null ? "" : RenShenJieJuEnums.getTitle(temp.getPregnancyOut()));
  480 + babyMap.put("deformity", temp.getDeformity() == null ? "" : temp.getDeformity() == 1 ? "是" : "否");
  481 + babyMap.put("babyGender", temp.getBabyGender() == null ? "" : SexEnum.getTextById(
  482 + Integer.parseInt(temp.getBabyGender())));
  483 + babyMap.put("babyWeight", UnitUtils.unitSplice(temp.getBabyWeight(), UnitConstants.G));
  484 + babyMap.put("babyHeight", UnitUtils.unitSplice(temp.getBabyHeight(), UnitConstants.CM));
  485 + babyMap.put("babyHealthy", temp.getBabyHealthy());
  486 + babyMap.put("apgarScoreMap", temp.getApgarScore());
  487 + String apgarScorePf1 = "";
  488 + String apgarScorePf5 = "";
  489 + String apgarScorePf10 = "";
  490 + Map<String, String> m = JsonUtil.getMap(temp.getApgarScore());
  491 + if (MapUtils.isNotEmpty(m)) {
  492 + apgarScorePf1 += m.get("pf1") == null ? "" : m.get("pf1");
  493 + apgarScorePf5 += m.get("pf5") == null ? "" : m.get("pf5");
  494 + apgarScorePf10 += m.get("pf10") == null ? "" : m.get("pf10");
445 495 }
  496 + String apgarScore = "";
446 497  
447   - }
448   - map.put("LABORPLACEVALUE", fmHospital);
449   - if(data.getDeliveryMode() != null){
450   - Map m = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class);
451   - Object b = m.get("fmfs");
452   - if(b != null){
453   - if("1".equals(b.toString())){
454   - map.put("LABORWAY","1");
455   - }else if("2".equals(b.toString())){
456   - map.put("LABORWAY","2");
  498 + if (StringUtils.isNotEmpty(apgarScorePf1) || StringUtils.isNotEmpty(apgarScorePf5) || StringUtils.isNotEmpty(apgarScorePf10)) {
  499 + apgarScore = apgarScorePf1 + UnitConstants.FEN + " - " + apgarScorePf5 + UnitConstants.FEN + " - " + apgarScorePf10 + UnitConstants.FEN;
  500 + }
  501 + babyMap.put("apgarScore", apgarScore);
  502 + babyMap.put("asphyxiaM", UnitUtils.unitSplice(temp.getAsphyxiaM(), UnitConstants.FZ));
  503 + babyMap.put("contactStartM", UnitUtils.unitSplice(temp.getContactStartM(), UnitConstants.FZ));
  504 + babyMap.put("contactM", UnitUtils.unitSplice(temp.getContactM(), UnitConstants.FZ));
  505 + babyMap.put("earlySuck", temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否");
  506 +
  507 + babyList.add(babyMap);
  508 +
  509 +
  510 + String cDueWeek = data.getDueWeek();
  511 + int week = Integer.parseInt(cDueWeek.substring(1, cDueWeek.indexOf("周")));
  512 + int day = Integer.parseInt(cDueWeek.substring(cDueWeek.indexOf("+") + 1, cDueWeek.indexOf("天")));
  513 + Map<String, String> map = new HashMap<String, String>();
  514 + map.put("MATERNALCHILDBIRTHID", data.getId());
  515 + map.put("MATERNALINFOID", patients.getId());
  516 + map.put("NAME", patients.getUsername());
  517 + String fmHospital = "";
  518 +
  519 + if (StringUtils.isNotEmpty(data.getFmHospital())) {
  520 + if (com.lyms.platform.common.utils.StringUtils.isNum(data.getFmHospital())) {
  521 + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital()));
  522 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  523 + fmHospital = organization.getName();
  524 + }
  525 + } else {
  526 + fmHospital = data.getFmHospital();
457 527 }
458 528  
459 529 }
460   - }
461   - map.put("LABORTIME",data.getDueDate());
462   - map.put("GESTTEEKS",String.valueOf(week));
463   - map.put("GESTDAYS",String.valueOf(day));
  530 + map.put("LABORPLACEVALUE", fmHospital);
  531 + if (data.getDeliveryMode() != null) {
  532 + Map m1 = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class);
  533 + Object b = m1.get("fmfs");
  534 + if (b != null) {
  535 + if ("1".equals(b.toString())) {
  536 + map.put("LABORWAY", "1");
  537 + } else if ("2".equals(b.toString())) {
  538 + map.put("LABORWAY", "2");
  539 + }
464 540  
465   - Map<String, Object> mapcc = new HashMap<>();
466   - findProcess(data.getProdprocess(), mapcc);
467   - if(StringUtils.isNotEmpty(mapcc.get("one").toString())){
468   - int oShi = mapcc.get("one").toString().indexOf("时");
469   - if(oShi == -1){
470   - int oFen = mapcc.get("one").toString().indexOf("分");
471   - if(-1 != oFen){
472   - map.put("BIRTHTIME1",mapcc.get("one").toString().substring(0,oFen));
473 541 }
474   - }else{
475   - Integer fen = 0;
476   - if(StringUtils.isNotEmpty(mapcc.get("one").toString().substring(0,oShi))){
477   - fen = Integer.parseInt(mapcc.get("one").toString().substring(0,oShi))*60;
478   - }
479   - int oFen = mapcc.get("one").toString().indexOf("分");
480   - if(-1 != oFen){
481   - Integer fen2 = Integer.parseInt(mapcc.get("one").toString().substring(oShi + 1, oFen));
482   - map.put("BIRTHTIME1",String.valueOf(fen+fen2));
483   - }else{
484   - map.put("BIRTHTIME1",String.valueOf(fen));
485   - }
486   -
487 542 }
488   - }
489 543  
490   - if(StringUtils.isNotEmpty(mapcc.get("two").toString())){
491   - int oShi = mapcc.get("two").toString().indexOf("时");
492   - if(oShi == -1){
493   - int oFen = mapcc.get("two").toString().indexOf("分");
494   - if(-1 != oFen){
495   - map.put("BIRTHTIME2",mapcc.get("two").toString().substring(0,oFen));
  544 + map.put("LABORTIME", temp.getDueTime());
  545 + map.put("GESTTEEKS", String.valueOf(week));
  546 + map.put("GESTDAYS", String.valueOf(day));
  547 +
  548 + Map<String, Object> mapcc = new HashMap<>();
  549 + findProcess(data.getProdprocess(), mapcc);
  550 + if (StringUtils.isNotEmpty(mapcc.get("one").toString())) {
  551 + int oShi = mapcc.get("one").toString().indexOf("时");
  552 + if (oShi == -1) {
  553 + int oFen = mapcc.get("one").toString().indexOf("分");
  554 + if (-1 != oFen) {
  555 + map.put("BIRTHTIME1", mapcc.get("one").toString().substring(0, oFen));
  556 + }
  557 + } else {
  558 + Integer fen = 0;
  559 + if (StringUtils.isNotEmpty(mapcc.get("one").toString().substring(0, oShi))) {
  560 + fen = Integer.parseInt(mapcc.get("one").toString().substring(0, oShi)) * 60;
  561 + }
  562 + int oFen = mapcc.get("one").toString().indexOf("分");
  563 + if (-1 != oFen) {
  564 + Integer fen2 = Integer.parseInt(mapcc.get("one").toString().substring(oShi + 1, oFen));
  565 + map.put("BIRTHTIME1", String.valueOf(fen + fen2));
  566 + } else {
  567 + map.put("BIRTHTIME1", String.valueOf(fen));
  568 + }
  569 +
496 570 }
497   - }else{
498   - Integer fen = 0;
499   - if(StringUtils.isNotEmpty(mapcc.get("two").toString().substring(0,oShi))){
500   - fen = Integer.parseInt(mapcc.get("two").toString().substring(0,oShi))*60;
501   - }
502   - int oFen = mapcc.get("two").toString().indexOf("分");
503   - if(-1 != oFen){
504   - Integer fen2 = Integer.parseInt(mapcc.get("two").toString().substring(oShi + 1, oFen));
505   - map.put("BIRTHTIME2",String.valueOf(fen+fen2));
506   - }else{
507   - map.put("BIRTHTIME2",String.valueOf(fen));
508   - }
509 571 }
510   - }
511 572  
512   - if(StringUtils.isNotEmpty(mapcc.get("three").toString())){
513   - int oShi = mapcc.get("three").toString().indexOf("时");
514   - if(oShi == -1){
515   - int oFen = mapcc.get("three").toString().indexOf("分");
516   - if(-1 != oFen){
517   - map.put("BIRTHTIME3",mapcc.get("three").toString().substring(0,oFen));
  573 + if (StringUtils.isNotEmpty(mapcc.get("two").toString())) {
  574 + int oShi = mapcc.get("two").toString().indexOf("时");
  575 + if (oShi == -1) {
  576 + int oFen = mapcc.get("two").toString().indexOf("分");
  577 + if (-1 != oFen) {
  578 + map.put("BIRTHTIME2", mapcc.get("two").toString().substring(0, oFen));
  579 + }
  580 + } else {
  581 + Integer fen = 0;
  582 + if (StringUtils.isNotEmpty(mapcc.get("two").toString().substring(0, oShi))) {
  583 + fen = Integer.parseInt(mapcc.get("two").toString().substring(0, oShi)) * 60;
  584 + }
  585 + int oFen = mapcc.get("two").toString().indexOf("分");
  586 + if (-1 != oFen) {
  587 + Integer fen2 = Integer.parseInt(mapcc.get("two").toString().substring(oShi + 1, oFen));
  588 + map.put("BIRTHTIME2", String.valueOf(fen + fen2));
  589 + } else {
  590 + map.put("BIRTHTIME2", String.valueOf(fen));
  591 + }
518 592 }
519   - }else{
520   - Integer fen = 0;
521   - if(StringUtils.isNotEmpty(mapcc.get("three").toString().substring(0,oShi))){
522   - fen = Integer.parseInt(mapcc.get("three").toString().substring(0,oShi))*60;
523   - }
  593 + }
524 594  
525   - int oFen = mapcc.get("three").toString().indexOf("分");
526   - if(-1 != oFen){
527   - Integer fen2 = Integer.parseInt(mapcc.get("three").toString().substring(oShi + 1, oFen));
528   - map.put("BIRTHTIME3",String.valueOf(fen+fen2));
529   - }else{
530   - map.put("BIRTHTIME3",String.valueOf(fen));
  595 + if (StringUtils.isNotEmpty(mapcc.get("three").toString())) {
  596 + int oShi = mapcc.get("three").toString().indexOf("时");
  597 + if (oShi == -1) {
  598 + int oFen = mapcc.get("three").toString().indexOf("分");
  599 + if (-1 != oFen) {
  600 + map.put("BIRTHTIME3", mapcc.get("three").toString().substring(0, oFen));
  601 + }
  602 + } else {
  603 + Integer fen = 0;
  604 + if (StringUtils.isNotEmpty(mapcc.get("three").toString().substring(0, oShi))) {
  605 + fen = Integer.parseInt(mapcc.get("three").toString().substring(0, oShi)) * 60;
  606 + }
  607 +
  608 + int oFen = mapcc.get("three").toString().indexOf("分");
  609 + if (-1 != oFen) {
  610 + Integer fen2 = Integer.parseInt(mapcc.get("three").toString().substring(oShi + 1, oFen));
  611 + map.put("BIRTHTIME3", String.valueOf(fen + fen2));
  612 + } else {
  613 + map.put("BIRTHTIME3", String.valueOf(fen));
  614 + }
531 615 }
532 616 }
533   - }
534 617  
535   - Map<String, String> totalprocessMap = JsonUtil.getMap(data.getTotalprocess());
536   - if(MapUtils.isNotEmpty(totalprocessMap)){
537   - String h = totalprocessMap.get("h") == null ? "" : totalprocessMap.get("h");
538   - String m = totalprocessMap.get("m") == null ? "" : totalprocessMap.get("m");
539   - Integer zShi = 0;
540   - Integer zFen = 0;
541   - if(StringUtils.isNotEmpty(h)){
542   - zShi = Integer.parseInt(h)*60;
  618 + Map<String, String> totalprocessMap = JsonUtil.getMap(data.getTotalprocess());
  619 + if (MapUtils.isNotEmpty(totalprocessMap)) {
  620 + String h = totalprocessMap.get("h") == null ? "" : totalprocessMap.get("h");
  621 + String m2 = totalprocessMap.get("m") == null ? "" : totalprocessMap.get("m");
  622 + Integer zShi = 0;
  623 + Integer zFen = 0;
  624 + if (StringUtils.isNotEmpty(h)) {
  625 + zShi = Integer.parseInt(h) * 60;
  626 + }
  627 + if (StringUtils.isNotEmpty(m2)) {
  628 + zFen = Integer.parseInt(m2) * 60;
  629 + }
  630 + map.put("BIRTHTOTAL", String.valueOf(zShi + zFen));
543 631 }
544   - if(StringUtils.isNotEmpty(m)){
545   - zFen = Integer.parseInt(m)*60;
546   - }
547   - map.put("BIRTHTOTAL",String.valueOf(zShi+zFen));
548   - }
549 632  
550   - if(data.getPerinealCondition() != null){
551   - if("full".equals(data.getPerinealCondition())){
552   - map.put("PERINEUMSITUATION","1");
  633 + if (data.getPerinealCondition() != null) {
  634 + if ("full".equals(data.getPerinealCondition())) {
  635 + map.put("PERINEUMSITUATION", "1");
  636 + }
  637 + if ("split".equals(data.getPerinealCondition())) {
  638 + map.put("PERINEUMSITUATION", "2");
  639 + }
553 640 }
554   - if("split".equals(data.getPerinealCondition())){
555   - map.put("PERINEUMSITUATION","2");
556   - }
557   - }
558 641  
559   - if(data.getTireNumber().toString() != null){
560   - if(1 == data.getTireNumber()){
561   - map.put("BABYFETUSCOUNTS","1");
562   - } else if(2 == data.getTireNumber()){
563   - map.put("BABYFETUSCOUNTS","2");
564   - } else{
565   - map.put("BABYFETUSCOUNTS","3");
  642 + if (data.getTireNumber().toString() != null) {
  643 + if (1 == data.getTireNumber()) {
  644 + map.put("BABYFETUSCOUNTS", "1");
  645 + } else if (2 == data.getTireNumber()) {
  646 + map.put("BABYFETUSCOUNTS", "2");
  647 + } else {
  648 + map.put("BABYFETUSCOUNTS", "3");
  649 + }
566 650 }
567   - }
568 651 /*if(data.getMaternalInfo() != null){
569 652 if("1".equals(data.getMaternalInfo())){
570 653  
571 654 }
572 655 }*/
573   - map.put("ORGCODE", patients.getHospitalId());
574   - String hospital = "";
575   - if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) {
576   - Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId()));
577   - if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
578   - hospital = organization.getName();
  656 + map.put("ORGCODE", patients.getHospitalId());
  657 + String hospital = "";
  658 + if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) {
  659 + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId()));
  660 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  661 + hospital = organization.getName();
  662 + }
579 663 }
  664 + map.put("ORGNAME", hospital);
  665 + mList.add(map);
  666 +
580 667 }
581   - map.put("ORGNAME",hospital);
582   - mList.add(map);
  668 + }
583 669 } catch (Exception e) {
584 670 e.printStackTrace();
585 671 continue;