Commit e578318fd1dd293f8f36b386d9bd9224f68ce1a0
1 parent
73648a6cb7
Exists in
master
and in
6 other branches
update code
Showing 2 changed files with 94 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
View file @
e578318
1 | 1 | package com.lyms.hospitalapi.qhdfy; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.PatientsService; |
4 | -import com.lyms.platform.common.enums.FmTypeEnums; | |
5 | -import com.lyms.platform.common.enums.RenShenJieJuEnums; | |
6 | -import com.lyms.platform.common.enums.TpmcTypeEnums; | |
7 | -import com.lyms.platform.common.enums.YnEnums; | |
4 | +import com.lyms.platform.common.enums.*; | |
8 | 5 | import com.lyms.platform.common.utils.DateUtil; |
9 | 6 | import com.lyms.platform.common.utils.ExceptionUtils; |
10 | 7 | import com.lyms.platform.common.utils.JsonUtil; |
11 | 8 | import com.lyms.platform.common.utils.StringUtils; |
9 | +import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade; | |
12 | 10 | import com.lyms.platform.operate.web.facade.MatDeliverFacade; |
11 | +import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest; | |
13 | 12 | import com.lyms.platform.operate.web.request.MatDeliverAddRequest; |
14 | 13 | import com.lyms.platform.permission.model.Users; |
15 | 14 | import com.lyms.platform.permission.model.UsersQuery; |
... | ... | @@ -44,6 +43,9 @@ |
44 | 43 | @Autowired |
45 | 44 | private UsersService usersService; |
46 | 45 | |
46 | + @Autowired | |
47 | + private BabyBookbuildingFacade babyBookbuildingFacade; | |
48 | + | |
47 | 49 | public void fmTimerWork() { |
48 | 50 | SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
49 | 51 | Date end = new Date(); |
50 | 52 | |
... | ... | @@ -219,7 +221,13 @@ |
219 | 221 | |
220 | 222 | } |
221 | 223 | } |
224 | + else | |
225 | + //秦皇岛服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据 | |
226 | + { | |
227 | + buildBaby( item, patInfo, dueDateStr, dueDate); | |
222 | 228 | |
229 | + } | |
230 | + | |
223 | 231 | } catch (Exception e) |
224 | 232 | { |
225 | 233 | ExceptionUtils.catchException(e, "数据异常"); |
... | ... | @@ -394,6 +402,21 @@ |
394 | 402 | |
395 | 403 | } |
396 | 404 | } |
405 | + else | |
406 | + { | |
407 | + for (FmItem i : items) | |
408 | + { | |
409 | + String dueDateStr1 = i.getSsrq(); | |
410 | + if (!StringUtils.isNotEmpty(dueDateStr1)) | |
411 | + { | |
412 | + continue; | |
413 | + } | |
414 | + Date dueDate1 = fmt.parse(dueDateStr1); | |
415 | + buildBaby( i,patInfo, dueDateStr1, dueDate1); | |
416 | + } | |
417 | + | |
418 | + } | |
419 | + | |
397 | 420 | } |
398 | 421 | } |
399 | 422 | } |
... | ... | @@ -407,6 +430,72 @@ |
407 | 430 | }finally { |
408 | 431 | DbUtils.closeQuietly(conn); |
409 | 432 | } |
433 | + } | |
434 | + | |
435 | + | |
436 | + public void buildBaby(FmItem item,FmPatInfo patInfo, String dueDateStr,Date dueDate) | |
437 | + { | |
438 | + UsersQuery usersQuery = new UsersQuery(); | |
439 | + usersQuery.setYn(YnEnums.YES.getId()); | |
440 | + usersQuery.setName("产房"); | |
441 | + List<Users> users = usersService.queryUsers(usersQuery); | |
442 | + | |
443 | + BabyBookbuildingAddRequest request = new BabyBookbuildingAddRequest(); | |
444 | + request.setHospitalId("216"); | |
445 | + | |
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); | |
453 | + | |
454 | + request.setBabyBirthday(dueDateStr); //生日 | |
455 | + | |
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() + "周"; | |
462 | + } | |
463 | + try { | |
464 | + request.setDueWeek(Integer.parseInt(week)); //分娩孕周 | |
465 | + }catch (Exception e) | |
466 | + { | |
467 | + | |
468 | + } | |
469 | + } | |
470 | + | |
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 | + } | |
477 | + | |
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); | |
488 | + | |
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畸形 | |
493 | + | |
494 | + request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务 | |
495 | + request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通 | |
496 | + | |
497 | + | |
498 | + babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId()); | |
410 | 499 | } |
411 | 500 | |
412 | 501 |
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
View file @
e578318
... | ... | @@ -114,7 +114,7 @@ |
114 | 114 | <ref bean="delSieveTrigger"/> |
115 | 115 | <ref bean="addSieveJobTrigger"/> |
116 | 116 | <ref bean="correctSieveOrderTrigger"/> |
117 | - <ref bean="qhdFmTrigger"/> | |
117 | + <!--<ref bean="qhdFmTrigger"/>--> | |
118 | 118 | <!--<ref bean="crisisTrigger"/>--> |
119 | 119 | </list> |
120 | 120 | </property> |