Commit bd4c3b89b97235bb93355ddd7b924be6d76e6d91
1 parent
21af61b191
Exists in
master
and in
6 other branches
德州分娩接口
Showing 2 changed files with 115 additions and 29 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyFmService.java
View file @
bd4c3b8
... | ... | @@ -221,7 +221,7 @@ |
221 | 221 | |
222 | 222 | Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection(); |
223 | 223 | QueryRunner queryRunner = new QueryRunner(); |
224 | - SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHH:mm:ss"); | |
224 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
225 | 225 | SimpleDateFormat fmt2 = new SimpleDateFormat("yyyyMMdd"); |
226 | 226 | SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
227 | 227 | try { |
228 | 228 | |
... | ... | @@ -237,7 +237,33 @@ |
237 | 237 | List<Fm> list = queryRunner.query(conn, sql, new BeanListHandler<Fm>(Fm.class)); |
238 | 238 | ExceptionUtils.catchException("size====" + list.size()); |
239 | 239 | |
240 | + /* List<Fm> list = new ArrayList<Fm>(); | |
241 | + Fm fm = new Fm(); | |
242 | + fm.setID("33299"); | |
243 | + fm.setBHNUM("201303046"); | |
244 | + fm.setVCCARDNO("123654"); | |
245 | + fm.setNAME("小香香"); | |
246 | + fm.setPHONE("18613211129"); | |
247 | + fm.setIDCARD("530103198705306240"); | |
248 | + fm.setADDR("山东省烟台市芝罘区就是"); | |
249 | + fm.setFETUS_NUM(1); | |
250 | + fm.setPLACENTA_NUM(1); | |
251 | + fm.setPROD_PROCESS_ONE(240); | |
252 | + fm.setPROD_PROCESS_TWO(30); | |
253 | + fm.setPROD_PROCESS_THREE(5); | |
254 | + fm.setTOTAL_PROCESS("550"); | |
255 | + fm.setDELIVER_HOSPITAL("德州市妇幼保健院"); | |
256 | + fm.setBABY_SEX("男"); | |
257 | + fm.setBABY_DELIVERY_TIME(fmt.parse("2017-9-11 13:53:00")); | |
258 | + fm.setBABY_APGAR_SCORE_ONE(10); | |
259 | + fm.setBABY_APGAR_SCORE_FIVE(10); | |
260 | + fm.setBABY_APGAR_SCORE_TEN(10); | |
261 | + list.add(fm);*/ | |
240 | 262 | |
263 | + | |
264 | + | |
265 | + | |
266 | + | |
241 | 267 | if (CollectionUtils.isNotEmpty(list)) { |
242 | 268 | |
243 | 269 | for(Fm f:list){ |
244 | 270 | |
245 | 271 | |
246 | 272 | |
247 | 273 | |
248 | 274 | |
249 | 275 | |
250 | 276 | |
... | ... | @@ -252,29 +278,39 @@ |
252 | 278 | List<Users> users=new ArrayList<Users>(); |
253 | 279 | List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); |
254 | 280 | MatDeliverAddRequest deliverAddRequest = new MatDeliverAddRequest(); |
255 | - int a=0; | |
256 | 281 | |
282 | + | |
257 | 283 | for (Fm item : list) { |
258 | - if(item.getID().equals(id) && a==0){ | |
284 | + if(item.getID().equals(id)){ | |
259 | 285 | try{ |
260 | 286 | |
261 | - if (!("活产".equals(item.getBABY_PREGNANCY_OUT()) || "死胎".equals(item.getBABY_PREGNANCY_OUT()))) | |
287 | + if ("死胎".equals(item.getBABY_PREGNANCY_OUT())) | |
262 | 288 | { |
263 | 289 | continue; |
264 | 290 | } |
265 | 291 | ExceptionUtils.catchException("item===" + item); |
266 | - String dueDateStr = item.getBABY_DELIVERY_TIME().toString(); | |
267 | - if (!StringUtils.isNotEmpty(dueDateStr)) { | |
292 | + // String dueDateStr = item.getBABY_DELIVERY_TIME().toString(); | |
293 | + dueDate = item.getBABY_DELIVERY_TIME(); | |
294 | + if (!StringUtils.isNotEmpty(dueDate.toString())) { | |
268 | 295 | continue; |
269 | 296 | } |
270 | 297 | |
271 | - try{ | |
272 | - dueDate = fmt2.parse(dueDateStr); | |
298 | + /*try{ | |
299 | + dueDate = fmt.parse(dueDateStr); | |
273 | 300 | }catch (Exception e) |
274 | 301 | { |
275 | 302 | dueDate = fmt.parse(dueDateStr); |
276 | - } | |
303 | + }*/ | |
304 | + | |
305 | + | |
277 | 306 | FmPatInfo patInfo = getFmPatInfoById(item.getID()); |
307 | + /*FmPatInfo patInfo = new FmPatInfo(); | |
308 | + patInfo.setSyxh("33299"); | |
309 | + patInfo.setName("小香香"); | |
310 | + patInfo.setCardNo("123654"); | |
311 | + patInfo.setPhone("18613211129");*/ | |
312 | + | |
313 | + | |
278 | 314 | if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone())) { |
279 | 315 | PatientsQuery query = new PatientsQuery(); |
280 | 316 | query.setYn(YnEnums.YES.getId()); |
... | ... | @@ -291,7 +327,7 @@ |
291 | 327 | UsersQuery usersQuery = new UsersQuery(); |
292 | 328 | usersQuery.setName(item.getDELIVER_DOCTOR()); |
293 | 329 | usersQuery.setYn(YnEnums.YES.getId()); |
294 | - usersQuery.setOrgId(66666); | |
330 | + usersQuery.setOrgId(1000000114); | |
295 | 331 | users = usersService.queryUsers(usersQuery); |
296 | 332 | if (!CollectionUtils.isNotEmpty(users)) { |
297 | 333 | usersQuery.setName("产房"); |
298 | 334 | |
... | ... | @@ -338,10 +374,17 @@ |
338 | 374 | deliverAddRequest.setSiLielevel(3); |
339 | 375 | } |
340 | 376 | |
341 | - if (StringUtils.isNotEmpty(item.getTH_LOSE_BLOOD().toString())) { | |
342 | - deliverAddRequest.settHloseBloodL(Double.parseDouble(item.getTH_LOSE_BLOOD().toString())); | |
377 | + Integer th_Lose = item.getTH_LOSE_BLOOD(); | |
378 | + if(th_Lose!=null){ | |
379 | + if (StringUtils.isNotEmpty(item.getTH_LOSE_BLOOD().toString())) { | |
380 | + deliverAddRequest.settHloseBloodL(Double.parseDouble(item.getTH_LOSE_BLOOD().toString())); | |
381 | + } | |
343 | 382 | } |
344 | 383 | |
384 | + | |
385 | + | |
386 | + | |
387 | + | |
345 | 388 | Map deliveryMode = new HashMap(); //分娩方式 |
346 | 389 | |
347 | 390 | String fmfs = ""; |
348 | 391 | |
349 | 392 | |
350 | 393 | |
... | ... | @@ -367,23 +410,49 @@ |
367 | 410 | extPlacenta.setTpmcType(tpmcType); |
368 | 411 | extPlacentas.add(extPlacenta); |
369 | 412 | deliverAddRequest.setExtPlacentas(extPlacentas); |
370 | - a=1; | |
413 | + //a=1; | |
371 | 414 | |
372 | 415 | //儿童 |
373 | 416 | //List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); |
374 | 417 | MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); |
375 | 418 | Map<String, String> as = new HashMap<>(); |
376 | - as.put("pf1", item.getBABY_APGAR_SCORE_ONE().toString()); | |
377 | - as.put("pf5", item.getBABY_APGAR_SCORE_FIVE().toString()); | |
378 | - as.put("pf10", item.getBABY_APGAR_SCORE_TEN().toString()); | |
419 | + Integer pf1 = item.getBABY_APGAR_SCORE_ONE(); | |
420 | + Integer pf5 = item.getBABY_APGAR_SCORE_FIVE(); | |
421 | + Integer pf10 = item.getBABY_APGAR_SCORE_TEN(); | |
422 | + if(pf1!=null){ | |
423 | + as.put("pf1", item.getBABY_APGAR_SCORE_ONE().toString()); | |
424 | + } | |
425 | + if(pf5!=null){ | |
426 | + as.put("pf5", item.getBABY_APGAR_SCORE_FIVE().toString()); | |
427 | + } | |
428 | + if(pf10!=null){ | |
429 | + as.put("pf10", item.getBABY_APGAR_SCORE_TEN().toString()); | |
430 | + } | |
431 | + | |
432 | + | |
379 | 433 | baby.setApgarScore(as); |
380 | 434 | baby.setBabyGender("男".equals(item.getBABY_SEX()) ? "1" : "0"); |
381 | - baby.setBabyHeight(item.getBABY_HEIGHT().toString());//新生儿生长 | |
382 | - baby.setBabyWeight(item.getBABY_WEIGHT().toString());//新生儿重量 | |
435 | + Integer babyHeight = item.getBABY_HEIGHT(); | |
436 | + Integer babyWeight = item.getBABY_WEIGHT(); | |
437 | + Integer baby_Asphyxiam = item.getBABY_ASPHYXIAM(); | |
438 | + if(babyHeight!=null){ | |
439 | + baby.setBabyHeight(item.getBABY_HEIGHT().toString());//新生儿生长 | |
440 | + } | |
441 | + if(babyWeight!=null){ | |
442 | + baby.setBabyWeight(item.getBABY_WEIGHT().toString());//新生儿重量 | |
443 | + } | |
444 | + if(baby_Asphyxiam!=null){ | |
445 | + baby.setAsphyxiaM(item.getBABY_ASPHYXIAM().toString()); //窒息分钟 | |
446 | + } | |
447 | + | |
383 | 448 | baby.setDeformity("无".equals(item.getBABY_DEFORMITY()) ? 0 : 1); //畸形 0非畸形 1畸形 |
384 | - baby.setAsphyxiaM(item.getBABY_ASPHYXIAM().toString()); //窒息分钟 | |
385 | - baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(item.getBABY_PREGNANCY_OUT())); // 妊娠结局 | |
386 | - baby.setDueTime(fmt1.format(dueDate));//分娩时间 | |
449 | + | |
450 | + String baby_Pregnancy_Out = item.getBABY_PREGNANCY_OUT(); | |
451 | + if(baby_Pregnancy_Out!=null && StringUtils.isNotEmpty(baby_Pregnancy_Out)){ | |
452 | + baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(item.getBABY_PREGNANCY_OUT())); // 妊娠结局 | |
453 | + } | |
454 | + | |
455 | + baby.setDueTime(fmt.format(dueDate));//分娩时间 | |
387 | 456 | babies.add(baby); |
388 | 457 | //deliverAddRequest.setBabies(babies); |
389 | 458 | //deliverAddRequest.setFmHospital("216"); //设置为秦皇岛分娩医院 |
... | ... | @@ -396,7 +465,7 @@ |
396 | 465 | |
397 | 466 | |
398 | 467 | }else{ |
399 | - //秦皇岛服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据 | |
468 | + //德州服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据 | |
400 | 469 | String babyName = patInfo.getName()+("男".equals(item.getBABY_SEX()) ? "之子" : "之女"); |
401 | 470 | FmItem fmitem=new FmItem(); |
402 | 471 | fmitem.setCcqk(item.getBABY_PREGNANCY_OUT()); |
... | ... | @@ -430,7 +499,7 @@ |
430 | 499 | continue; |
431 | 500 | } |
432 | 501 | |
433 | - }else if(item.getID().equals(id)){ | |
502 | + }/*else if(item.getID().equals(id)){ | |
434 | 503 | MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); |
435 | 504 | Map<String, String> as = new HashMap<>(); |
436 | 505 | as.put("pf1", item.getBABY_APGAR_SCORE_ONE().toString()); |
... | ... | @@ -447,7 +516,7 @@ |
447 | 516 | babies.add(baby); |
448 | 517 | |
449 | 518 | |
450 | - } | |
519 | + }*/ | |
451 | 520 | |
452 | 521 | |
453 | 522 | |
454 | 523 | |
... | ... | @@ -457,8 +526,11 @@ |
457 | 526 | deliverAddRequest.setBabies(babies); |
458 | 527 | deliverAddRequest.setFmHospital("1000000114"); //设置为德州妇幼 |
459 | 528 | ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest); |
460 | - matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
529 | + if(users!=null && users.size()>0){ | |
530 | + matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
531 | + } | |
461 | 532 | |
533 | + | |
462 | 534 | } |
463 | 535 | |
464 | 536 | |
465 | 537 | |
... | ... | @@ -466,12 +538,12 @@ |
466 | 538 | } |
467 | 539 | |
468 | 540 | |
469 | - DbUtils.closeQuietly(conn); | |
470 | - } catch (SQLException e) { | |
541 | + //DbUtils.closeQuietly(conn); | |
542 | + } catch (Exception e) { | |
471 | 543 | ExceptionUtils.catchException(e, "sql执行异常"); |
472 | 544 | e.printStackTrace(); |
473 | 545 | } finally { |
474 | - DbUtils.closeQuietly(conn); | |
546 | + //DbUtils.closeQuietly(conn); | |
475 | 547 | } |
476 | 548 | } |
477 | 549 | |
... | ... | @@ -654,7 +726,7 @@ |
654 | 726 | try { |
655 | 727 | FmPatInfo patInfo = null; |
656 | 728 | |
657 | - List<FmPatInfo> list = queryRunner.query(conn, "SELECT ID as syxh,NAME as name,IDCARD as cardNo,PHONE as phone FROM zlhis.v_deliveryinfo WHERE PHONE <> '' and IDCARD is not null and IDCARD <> '' and length(PHONE) = 11 and ID = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class)); | |
729 | + List<FmPatInfo> list = queryRunner.query(conn, "SELECT ID as syxh,NAME as name,IDCARD as cardNo,PHONE as phone FROM zlhis.v_deliveryinfo WHERE PHONE is not null and IDCARD is not null and length(PHONE) = 11 and ID = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class)); | |
658 | 730 | if (CollectionUtils.isNotEmpty(list)) { |
659 | 731 | patInfo = list.get(0); |
660 | 732 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
bd4c3b8
1 | 1 | package com.lyms.platform.operate.web.controller; |
2 | 2 | |
3 | 3 | import com.lyms.hospitalapi.Nczxyy.NczxyyLisService; |
4 | +import com.lyms.hospitalapi.dzfy.DzfyFmService; | |
4 | 5 | import com.lyms.hospitalapi.dzfy.DzfyHisService; |
5 | 6 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
6 | 7 | import com.lyms.hospitalapi.v1.HisService; |
... | ... | @@ -51,6 +52,8 @@ |
51 | 52 | private QhdfyHisService qhdfyHisService; |
52 | 53 | @Autowired |
53 | 54 | private DzfyHisService dzfyHisService; |
55 | + @Autowired | |
56 | + private DzfyFmService dzfyFmService; | |
54 | 57 | |
55 | 58 | @Autowired |
56 | 59 | private NczxyyLisService nczxyyLisService; |
... | ... | @@ -89,6 +92,17 @@ |
89 | 92 | |
90 | 93 | } |
91 | 94 | } |
95 | + | |
96 | + | |
97 | + | |
98 | + /*@RequestMapping(method = RequestMethod.GET, value = "/fm") | |
99 | + @ResponseBody | |
100 | + public String getFm(String start,String end,String syxh){ | |
101 | + dzfyFmService.queryFmPatient(start,end,syxh); | |
102 | + return "1"; | |
103 | + }*/ | |
104 | + | |
105 | + | |
92 | 106 | |
93 | 107 | |
94 | 108 | /** |