Commit 7de4efe983145c9f3ef2a53f6a8a8b5256380978
1 parent
e578318fd1
Exists in
master
and in
6 other branches
update code
Showing 1 changed file with 67 additions and 55 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
View file @
7de4efe
... | ... | @@ -425,8 +425,12 @@ |
425 | 425 | ExceptionUtils.catchException(e, "sql执行异常"); |
426 | 426 | e.printStackTrace(); |
427 | 427 | } catch (ParseException e) { |
428 | - ExceptionUtils.catchException(e,"分娩日期解析错误"); | |
428 | + ExceptionUtils.catchException(e, "分娩日期解析错误"); | |
429 | 429 | e.printStackTrace(); |
430 | + } catch (Exception e) | |
431 | + { | |
432 | + ExceptionUtils.catchException(e, "发生异常"); | |
433 | + e.printStackTrace(); | |
430 | 434 | }finally { |
431 | 435 | DbUtils.closeQuietly(conn); |
432 | 436 | } |
433 | 437 | |
434 | 438 | |
435 | 439 | |
436 | 440 | |
437 | 441 | |
438 | 442 | |
439 | 443 | |
440 | 444 | |
441 | 445 | |
442 | 446 | |
443 | 447 | |
444 | 448 | |
445 | 449 | |
... | ... | @@ -435,67 +439,75 @@ |
435 | 439 | |
436 | 440 | public void buildBaby(FmItem item,FmPatInfo patInfo, String dueDateStr,Date dueDate) |
437 | 441 | { |
438 | - UsersQuery usersQuery = new UsersQuery(); | |
439 | - usersQuery.setYn(YnEnums.YES.getId()); | |
440 | - usersQuery.setName("产房"); | |
441 | - List<Users> users = usersService.queryUsers(usersQuery); | |
442 | + try{ | |
443 | + UsersQuery usersQuery = new UsersQuery(); | |
444 | + usersQuery.setYn(YnEnums.YES.getId()); | |
445 | + usersQuery.setName("产房"); | |
446 | + List<Users> users = usersService.queryUsers(usersQuery); | |
442 | 447 | |
443 | - BabyBookbuildingAddRequest request = new BabyBookbuildingAddRequest(); | |
444 | - request.setHospitalId("216"); | |
448 | + BabyBookbuildingAddRequest request = new BabyBookbuildingAddRequest(); | |
449 | + request.setHospitalId("216"); | |
445 | 450 | |
446 | - request.setMommyName(patInfo.getBRXM()); //母亲姓名 | |
447 | - request.setMommyCertificateTypeId("57e0a21c0cf209b410a82cda"); //证件类型 (手机号码) | |
448 | - request.setMommyCertificateNum(patInfo.getLXDH()); //证件号 | |
449 | - request.setMommyPhone(patInfo.getLXDH()); | |
450 | - String babyName = patInfo.getBRXM()+("男".equals(item.getYexb()) ? "之子" : "之女"); | |
451 | - request.setBabyName(babyName); | |
452 | - request.setSex("男".equals(item.getYexb()) ? 1 : 0); | |
451 | + request.setMommyName(patInfo.getBRXM()); //母亲姓名 | |
452 | + request.setMommyCertificateTypeId("57e0a21c0cf209b410a82cda"); //证件类型 (手机号码) | |
453 | + request.setMommyCertificateNum(patInfo.getLXDH()); //证件号 | |
454 | + request.setMommyPhone(patInfo.getLXDH()); | |
455 | + String babyName = patInfo.getBRXM()+("男".equals(item.getYexb()) ? "之子" : "之女"); | |
456 | + request.setBabyName(babyName); | |
457 | + request.setSex("男".equals(item.getYexb()) ? 1 : 0); | |
453 | 458 | |
454 | - request.setBabyBirthday(dueDateStr); //生日 | |
459 | + request.setBabyBirthday(dueDateStr); //生日 | |
455 | 460 | |
456 | - if (StringUtils.isNotEmpty(item.getRc())) { | |
457 | - String week = ""; | |
458 | - if (item.getRc().split("\\u002B").length > 1) { | |
459 | - week = item.getRc().split("\\u002B")[0] + "周"; | |
460 | - } else { | |
461 | - week = item.getRc() + "周"; | |
461 | + if (StringUtils.isNotEmpty(item.getRc())) { | |
462 | + String week = ""; | |
463 | + if (item.getRc().split("\\u002B").length > 1) { | |
464 | + week = item.getRc().split("\\u002B")[0] + "周"; | |
465 | + } else { | |
466 | + week = item.getRc() + "周"; | |
467 | + } | |
468 | + try { | |
469 | + request.setDueWeek(Integer.parseInt(week)); //分娩孕周 | |
470 | + }catch (Exception e) | |
471 | + { | |
472 | + | |
473 | + } | |
462 | 474 | } |
463 | - try { | |
464 | - request.setDueWeek(Integer.parseInt(week)); //分娩孕周 | |
465 | - }catch (Exception e) | |
466 | - { | |
467 | 475 | |
476 | + String tpmcType = ""; | |
477 | + if ("手术产".equals(item.getTpmcfs())) { | |
478 | + tpmcType = FmTypeEnums.O1.getId(); | |
479 | + } else if ("自然产出".equals(item.getTpmcfs())) { | |
480 | + tpmcType = FmTypeEnums.O.getId(); | |
468 | 481 | } |
469 | - } | |
470 | 482 | |
471 | - String tpmcType = ""; | |
472 | - if ("手术产".equals(item.getTpmcfs())) { | |
473 | - tpmcType = FmTypeEnums.O1.getId(); | |
474 | - } else if ("自然产出".equals(item.getTpmcfs())) { | |
475 | - tpmcType = FmTypeEnums.O.getId(); | |
476 | - } | |
483 | + request.setDueType(tpmcType);//分娩方式 | |
484 | + request.setFetusCount(item.getDjt()); //第几胎 | |
485 | + request.setDueCount(item.getCjc());//第几产 | |
486 | + request.setBabyWeight(item.getTz()); //体重 | |
487 | + request.setBabyHeight(item.getSc()); //身长 | |
488 | + Map<String,String> map = new HashMap<>(); | |
489 | + map.put("pf1",item.getYfz()); | |
490 | + map.put("pf5", item.getWfz()); | |
491 | + map.put("pf10", item.getSfz()); | |
492 | + request.setApgarScore(map); | |
477 | 493 | |
478 | - request.setDueType(tpmcType);//分娩方式 | |
479 | - request.setFetusCount(item.getDjt()); //第几胎 | |
480 | - request.setDueCount(item.getCjc());//第几产 | |
481 | - request.setBabyWeight(item.getTz()); //体重 | |
482 | - request.setBabyHeight(item.getSc()); //身长 | |
483 | - Map<String,String> map = new HashMap<>(); | |
484 | - map.put("pf1",item.getYfz()); | |
485 | - map.put("pf5", item.getWfz()); | |
486 | - map.put("pf10", item.getSfz()); | |
487 | - request.setApgarScore(map); | |
494 | + request.setBuildDoctor(users.get(0).getId() + ""); | |
495 | + request.setBuildDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
496 | + request.setHighRisk("是".equals(item.getSfgw()) ? 1 : 0); | |
497 | + request.setMalformation("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 | |
488 | 498 | |
489 | - request.setBuildDoctor(users.get(0).getId() + ""); | |
490 | - request.setBuildDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
491 | - request.setHighRisk("是".equals(item.getSfgw()) ? 1 : 0); | |
492 | - request.setMalformation("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 | |
499 | + request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务 | |
500 | + request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通 | |
493 | 501 | |
494 | - request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务 | |
495 | - request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通 | |
496 | 502 | |
503 | + babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId()); | |
504 | + }catch (Exception e) | |
505 | + { | |
506 | + ExceptionUtils.catchException(e, "buildBaby exception"); | |
507 | + e.printStackTrace(); | |
508 | + } | |
497 | 509 | |
498 | - babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId()); | |
510 | + | |
499 | 511 | } |
500 | 512 | |
501 | 513 |