Commit 244764749b01f5c5935e461d28cfa42938a0099c
1 parent
6b51ccd5c5
Exists in
master
and in
6 other branches
秦皇岛冠新公卫接口
Showing 1 changed file with 120 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java
View file @
2447647
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | import org.springframework.stereotype.Service; |
25 | 25 | |
26 | 26 | import javax.management.loading.MLet; |
27 | +import java.sql.Types; | |
27 | 28 | import java.util.ArrayList; |
28 | 29 | import java.util.HashMap; |
29 | 30 | import java.util.List; |
... | ... | @@ -460,6 +461,92 @@ |
460 | 461 | map.put("LABORTIME",data.getDueDate()); |
461 | 462 | map.put("GESTTEEKS",String.valueOf(week)); |
462 | 463 | map.put("GESTDAYS",String.valueOf(day)); |
464 | + | |
465 | + Map<String, Object> mapcc = new HashMap<>(); | |
466 | + findProcess(data.getProdprocess(),mapcc); | |
467 | + if(StringUtils.isNotEmpty(map.get("one"))){ | |
468 | + int oShi = map.get("one").toString().indexOf("时"); | |
469 | + if(oShi == -1){ | |
470 | + int oFen = map.get("one").toString().indexOf("分"); | |
471 | + if(-1 != oFen){ | |
472 | + map.put("BIRTHTIME1",map.get("one").toString().substring(0,oFen)); | |
473 | + } | |
474 | + }else{ | |
475 | + Integer fen = 0; | |
476 | + if(StringUtils.isNotEmpty(map.get("one").toString().substring(0,oShi))){ | |
477 | + fen = Integer.parseInt(map.get("one").toString().substring(0,oShi))*60; | |
478 | + } | |
479 | + int oFen = map.get("one").toString().indexOf("分"); | |
480 | + if(-1 != oFen){ | |
481 | + Integer fen2 = Integer.parseInt(map.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 | + } | |
488 | + } | |
489 | + | |
490 | + if(StringUtils.isNotEmpty(map.get("two"))){ | |
491 | + int oShi = map.get("two").toString().indexOf("时"); | |
492 | + if(oShi == -1){ | |
493 | + int oFen = map.get("two").toString().indexOf("分"); | |
494 | + if(-1 != oFen){ | |
495 | + map.put("BIRTHTIME2",map.get("two").toString().substring(0,oFen)); | |
496 | + } | |
497 | + }else{ | |
498 | + Integer fen = 0; | |
499 | + if(StringUtils.isNotEmpty(map.get("two").toString().substring(0,oShi))){ | |
500 | + fen = Integer.parseInt(map.get("two").toString().substring(0,oShi))*60; | |
501 | + } | |
502 | + int oFen = map.get("two").toString().indexOf("分"); | |
503 | + if(-1 != oFen){ | |
504 | + Integer fen2 = Integer.parseInt(map.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 | + } | |
510 | + } | |
511 | + | |
512 | + if(StringUtils.isNotEmpty(map.get("three"))){ | |
513 | + int oShi = map.get("three").toString().indexOf("时"); | |
514 | + if(oShi == -1){ | |
515 | + int oFen = map.get("three").toString().indexOf("分"); | |
516 | + if(-1 != oFen){ | |
517 | + map.put("BIRTHTIME3",map.get("three").toString().substring(0,oFen)); | |
518 | + } | |
519 | + }else{ | |
520 | + Integer fen = 0; | |
521 | + if(StringUtils.isNotEmpty(map.get("three").toString().substring(0,oShi))){ | |
522 | + fen = Integer.parseInt(map.get("three").toString().substring(0,oShi))*60; | |
523 | + } | |
524 | + | |
525 | + int oFen = map.get("three").toString().indexOf("分"); | |
526 | + if(-1 != oFen){ | |
527 | + Integer fen2 = Integer.parseInt(map.get("three").toString().substring(oShi + 1, oFen)); | |
528 | + map.put("BIRTHTIME3",String.valueOf(fen+fen2)); | |
529 | + }else{ | |
530 | + map.put("BIRTHTIME3",String.valueOf(fen)); | |
531 | + } | |
532 | + } | |
533 | + } | |
534 | + | |
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; | |
543 | + } | |
544 | + if(StringUtils.isNotEmpty(m)){ | |
545 | + zFen = Integer.parseInt(m)*60; | |
546 | + } | |
547 | + map.put("BIRTHTOTAL",String.valueOf(zShi+zFen)); | |
548 | + } | |
549 | + | |
463 | 550 | if(data.getPerinealCondition() != null){ |
464 | 551 | if("full".equals(data.getPerinealCondition())){ |
465 | 552 | map.put("PERINEUMSITUATION","1"); |
... | ... | @@ -1495,6 +1582,39 @@ |
1495 | 1582 | } |
1496 | 1583 | return ""; |
1497 | 1584 | } |
1585 | + | |
1586 | + | |
1587 | + | |
1588 | + //解析1,2,3产程 | |
1589 | + public static Map<String, Object> findProcess(String process, Map<String, Object> map) { | |
1590 | +// process = "{\"one\":{\"h\":4,\"m\":20},\"two\":{\"m\":53},\"three\":{\"m\":7}}"; | |
1591 | + String one = ""; | |
1592 | + String two = ""; | |
1593 | + String three = ""; | |
1594 | + Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(process); | |
1595 | + if (MapUtils.isNotEmpty(prodprocessMap)) { | |
1596 | + Map<String, String> prodprocessOne = prodprocessMap.get("one"); | |
1597 | + if (MapUtils.isNotEmpty(prodprocessOne)) { | |
1598 | + one = (prodprocessOne.get("h") == null ? "" : prodprocessOne.get("h") + "时") + | |
1599 | + (prodprocessOne.get("m") == null ? "" : prodprocessOne.get("m") + "分"); | |
1600 | + } | |
1601 | + Map<String, String> prodprocessTwo = prodprocessMap.get("two"); | |
1602 | + if (MapUtils.isNotEmpty(prodprocessTwo)) { | |
1603 | + two = (prodprocessTwo.get("h") == null ? "" : prodprocessTwo.get("h") + "时") | |
1604 | + + (prodprocessTwo.get("m") == null ? "" : prodprocessTwo.get("m") + "分"); | |
1605 | + } | |
1606 | + Map<String, String> prodprocessThree = prodprocessMap.get("three"); | |
1607 | + if (MapUtils.isNotEmpty(prodprocessThree)) { | |
1608 | + three = (prodprocessThree.get("h") == null ? "" : prodprocessThree.get("h") + "时") | |
1609 | + + (prodprocessThree.get("m") == null ? "" : prodprocessThree.get("m") + "分"); | |
1610 | + } | |
1611 | + } | |
1612 | + map.put("one", one); | |
1613 | + map.put("two", two); | |
1614 | + map.put("three", three); | |
1615 | + return map; | |
1616 | + } | |
1617 | + | |
1498 | 1618 | |
1499 | 1619 | |
1500 | 1620 | } |