Commit 116c625759d336f9e13c911333d5ba5e3acbb1a2
1 parent
a0cb7e9fbe
Exists in
master
and in
6 other branches
转诊单查看问题
Showing 5 changed files with 75 additions and 47 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ReferralReceiptRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ReferralApplyOrderResult.java
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
116c625
... | ... | @@ -322,13 +322,10 @@ |
322 | 322 | //丈夫生日 |
323 | 323 | private Date husbandBirth; |
324 | 324 | private String vcCardNo; |
325 | - | |
326 | 325 | //丈夫文化程度Id |
327 | 326 | private String hlevelTypeId; |
328 | - | |
329 | 327 | //体验类型 |
330 | 328 | private Integer expType; |
331 | - | |
332 | 329 | //person表主键 |
333 | 330 | private String pid; |
334 | 331 | //是否隐藏 0 隐藏 1 显示 更改为:0,转诊建档,待接收 1,转诊建档,已接收 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
116c625
... | ... | @@ -73,6 +73,8 @@ |
73 | 73 | @Autowired |
74 | 74 | private AutoMatchFacade autoMatchFacade; |
75 | 75 | @Autowired |
76 | + private ApplyOrderFacade applyOrderFacade; | |
77 | + @Autowired | |
76 | 78 | private StopPregnancyService stopPregnancyService; |
77 | 79 | @Autowired |
78 | 80 | private UsersService usersService; |
79 | 81 | |
... | ... | @@ -402,12 +404,7 @@ |
402 | 404 | List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); |
403 | 405 | if (CollectionUtils.isNotEmpty(orderModelList)) { |
404 | 406 | ReferralApplyOrderModel referralApplyOrderModel = orderModelList.get(0); |
405 | - String outHospitalId = referralApplyOrderModel.getOutHospitalId(); | |
406 | 407 | //查询转入申请单 |
407 | - ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
408 | - referralApplyOrderQuery1.setOutHospitalId(outHospitalId); | |
409 | - referralApplyOrderQuery1.setTransferredHospital(patients.getHospitalId()); | |
410 | - referralApplyOrderQuery1.setPid(patients.getPid()); | |
411 | 408 | ReferralApplyOrderModel model1 = new ReferralApplyOrderModel(); |
412 | 409 | if (referralApplyOrderModel.getStatus() == 1) { |
413 | 410 | //设置接收时间 |
414 | 411 | |
... | ... | @@ -437,16 +434,9 @@ |
437 | 434 | } catch (Exception e) { |
438 | 435 | e.printStackTrace(); |
439 | 436 | } |
440 | - //设置转入申请单的状态为接收 | |
441 | - applyOrderService.updateByParentId(referralApplyOrderQuery1, model1); | |
437 | + //同步更新两条转诊记录信息 | |
438 | + applyOrderFacade.updataReferral(patients.getId(),model1); | |
442 | 439 | |
443 | - //查询转出申请单 | |
444 | - ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery(); | |
445 | - referralApplyOrderQuery2.setOutHospitalId(patients.getHospitalId()); | |
446 | - referralApplyOrderQuery2.setTransferredHospital(outHospitalId); | |
447 | - referralApplyOrderQuery2.setPid(patients.getPid()); | |
448 | - //设置转出申请单的状态为接收 | |
449 | - applyOrderService.updateByParentId(referralApplyOrderQuery2, model1); | |
450 | 440 | System.out.println("查询转诊条件:" + referralApplyOrderQuery.convertToQuery().convertToMongoQuery()); |
451 | 441 | } |
452 | 442 | } |
... | ... | @@ -2678,19 +2668,6 @@ |
2678 | 2668 | BasicConfig basicConfig1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); |
2679 | 2669 | if (null != basicConfig1) { |
2680 | 2670 | Map<String, Object> map1 = new HashMap<>(); |
2681 | - // map1.put("id", basicConfig1.getId()); | |
2682 | - // String name = basicConfig1.getName(); | |
2683 | - // if (name.indexOf("黄色") > -1) { | |
2684 | - // name = "黄色"; | |
2685 | - // }else if (name.indexOf("橙色") > -1) { | |
2686 | - // name = "橙色"; | |
2687 | - // }else if (name.indexOf("红色") > -1) { | |
2688 | - // name = "红色"; | |
2689 | - // }else if (name.indexOf("紫色") > -1) { | |
2690 | - // name = "紫色"; | |
2691 | - // } | |
2692 | - // map1.put("name", name); | |
2693 | - // map1.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
2694 | 2671 | basicConfig1.replenRisk(map1); |
2695 | 2672 | dat1a.add(map1); |
2696 | 2673 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
View file @
116c625
... | ... | @@ -67,22 +67,51 @@ |
67 | 67 | @Autowired |
68 | 68 | private CommonService commonService; |
69 | 69 | |
70 | + //添加回执单 | |
70 | 71 | public BaseResponse addReferralReceipt(ReferralReceiptRequest referralReceipt) { |
71 | - | |
72 | 72 | ReferralApplyOrderModel referralApplyOrderModel = applyOrderService.findByIdReferralApplyOrder(referralReceipt.getId()); |
73 | 73 | referralReceipt.convertToDataModel(referralApplyOrderModel); |
74 | 74 | referralApplyOrderModel.setrRisk(queryRiskName(referralReceipt.getrRisk())); |
75 | 75 | referralApplyOrderModel.setRiskFactorId(referralReceipt.getrRisk()); |
76 | + int score = antenatalExaminationFacade.queryRisk(referralReceipt.getrRisk(), false).getScore(); | |
77 | + //高危评分 | |
78 | + referralApplyOrderModel.setScore(score); | |
76 | 79 | if (StringUtils.isNotEmpty(referralApplyOrderModel.getId())) { |
77 | - ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
78 | - referralApplyOrderQuery1.setId(referralReceipt.getId()); | |
79 | - applyOrderService.updateByParentId(referralApplyOrderQuery1, referralApplyOrderModel); | |
80 | + updataReferral(referralReceipt.getPatientId(),referralApplyOrderModel); | |
80 | 81 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
81 | 82 | } else { |
82 | 83 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("错误"); |
83 | 84 | } |
84 | 85 | } |
85 | 86 | |
87 | + //同步更新两条转诊记录信息 | |
88 | + public void updataReferral(String patientId,ReferralApplyOrderModel referralApplyModel){ | |
89 | + Patients patients = patientsService.findOnePatientById(patientId); | |
90 | + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
91 | + referralApplyOrderQuery.setParentId(patientId); | |
92 | + //申请单状态 1 已转出 2 接收转诊 | |
93 | + //转诊单状态为待接收状态 | |
94 | + List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); | |
95 | + if (CollectionUtils.isNotEmpty(orderModelList)) { | |
96 | + ReferralApplyOrderModel referralApplyOrderModel = orderModelList.get(0); | |
97 | + String outHospitalId = referralApplyOrderModel.getOutHospitalId(); | |
98 | + | |
99 | + //查询转入申请单 | |
100 | + ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
101 | + referralApplyOrderQuery1.setOutHospitalId(outHospitalId); | |
102 | + referralApplyOrderQuery1.setTransferredHospital(patients.getHospitalId()); | |
103 | + referralApplyOrderQuery1.setPid(patients.getPid()); | |
104 | + applyOrderService.updateByParentId(referralApplyOrderQuery1, referralApplyModel); | |
105 | + | |
106 | + //查询转出申请单 | |
107 | + ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery(); | |
108 | + referralApplyOrderQuery2.setOutHospitalId(patients.getHospitalId()); | |
109 | + referralApplyOrderQuery2.setTransferredHospital(outHospitalId); | |
110 | + referralApplyOrderQuery2.setPid(patients.getPid()); | |
111 | + applyOrderService.updateByParentId(referralApplyOrderQuery2, referralApplyModel); | |
112 | + } | |
113 | + } | |
114 | + | |
86 | 115 | private List queryRiskName(List l) { |
87 | 116 | List data = new ArrayList(); |
88 | 117 | if (CollectionUtils.isNotEmpty(l)) { |
... | ... | @@ -115,9 +144,6 @@ |
115 | 144 | //表示区域的 |
116 | 145 | if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospital)) && type == 2) { |
117 | 146 | String parentId = antenatalExaminationFacade.handHideBuild(referralApplyOrderAddRequest.getPid(), referralApplyOrderAddRequest.getParentId(), userId, -1); |
118 | - if (StringUtils.isEmpty(parentId)) { | |
119 | - //打印日志 | |
120 | - } | |
121 | 147 | referralApplyOrderModel.setParentId(parentId); |
122 | 148 | referralApplyOrderAddRequest.setParentId(parentId); |
123 | 149 | } |
124 | 150 | |
... | ... | @@ -429,11 +455,12 @@ |
429 | 455 | List<ReferralApplyOrderModel> list = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); |
430 | 456 | ReferralApplyOrderResult referralApplyOrderResult = new ReferralApplyOrderResult(); |
431 | 457 | if (CollectionUtils.isNotEmpty(list)) { |
458 | + ReferralApplyOrderModel referralApplyOrderModel = list.get(0); | |
432 | 459 | String zhuanCName = ""; |
433 | 460 | String zhuanRname = ""; |
434 | - Patients patients = patientsService.findOnePatientById(list.get(0).getParentId()); | |
435 | - String zhuanchu = list.get(0).getOutHospitalId(); | |
436 | - String zhuanru = list.get(0).getTransferredHospital(); | |
461 | + Patients patients = patientsService.findOnePatientById(referralApplyOrderModel.getParentId()); | |
462 | + String zhuanchu = referralApplyOrderModel.getOutHospitalId(); | |
463 | + String zhuanru = referralApplyOrderModel.getTransferredHospital(); | |
437 | 464 | Map map1 = new HashMap(); |
438 | 465 | zhuanCName = zhuanchu; |
439 | 466 | zhuanRname = zhuanru; |
440 | 467 | |
... | ... | @@ -461,12 +488,12 @@ |
461 | 488 | |
462 | 489 | } |
463 | 490 | } |
464 | - referralApplyOrderResult.convertToResult(list.get(0), patients, zhuanCName, zhuanRname); | |
491 | + referralApplyOrderResult.convertToResult(referralApplyOrderModel, patients, zhuanCName, zhuanRname); | |
465 | 492 | referralApplyOrderResult.setTransferredHospital(map1); |
466 | 493 | |
467 | 494 | try { |
468 | - if (StringUtils.isNotEmpty(list.get(0).getDiagnosis())) { | |
469 | - List diagnosis = JsonUtil.toList(list.get(0).getDiagnosis(), List.class); | |
495 | + if (StringUtils.isNotEmpty(referralApplyOrderModel.getDiagnosis())) { | |
496 | + List diagnosis = JsonUtil.toList(referralApplyOrderModel.getDiagnosis(), List.class); | |
470 | 497 | referralApplyOrderResult.setDiagnosis(antenatalExaminationFacade.queryRisk(diagnosis, false).getHighRisk()); |
471 | 498 | } |
472 | 499 | } catch (Exception e) { |
473 | 500 | |
... | ... | @@ -474,15 +501,15 @@ |
474 | 501 | } |
475 | 502 | |
476 | 503 | Map map = new HashMap(); |
477 | - if (StringUtils.isNotEmpty(list.get(0).getApplyDoctor())) { | |
478 | - Users users = usersService.getUsers(Integer.valueOf(list.get(0).getApplyDoctor())); | |
504 | + if (StringUtils.isNotEmpty(referralApplyOrderModel.getApplyDoctor())) { | |
505 | + Users users = usersService.getUsers(Integer.valueOf(referralApplyOrderModel.getApplyDoctor())); | |
479 | 506 | if (null != users) { |
480 | 507 | map.put("id", users.getId()); |
481 | 508 | map.put("name", users.getName()); |
482 | 509 | } |
483 | 510 | } |
484 | 511 | try { |
485 | - if (CollectionUtils.isNotEmpty(list.get(0).getRiskFactorId())) { | |
512 | + if (CollectionUtils.isNotEmpty(referralApplyOrderModel.getRiskFactorId())) { | |
486 | 513 | HighScoreResult highScoreResult = antenatalExaminationFacade.queryRisk(list.get(0).getRiskFactorId(), false); |
487 | 514 | referralApplyOrderResult.setRiskFactor(highScoreResult.getHighRisk()); |
488 | 515 | } |
... | ... | @@ -494,6 +521,13 @@ |
494 | 521 | List<Map<String, Object>> screenList = antenatalExaminationFacade.getscreenResult(patients.getScreenResult()); |
495 | 522 | referralApplyOrderResult.setScreenResult(screenList); |
496 | 523 | |
524 | + //接诊医生 | |
525 | + if (NumberUtils.isNumber(referralApplyOrderModel.getRecDoctor())) { | |
526 | + Users users = usersService.getUsers(NumberUtils.toInt(referralApplyOrderModel.getRecDoctor())); | |
527 | + if (null != users) { | |
528 | + referralApplyOrderResult.setRecDoctor(users.getName()); | |
529 | + } | |
530 | + } | |
497 | 531 | } |
498 | 532 | return new BaseObjectResponse().setData(referralApplyOrderResult).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
499 | 533 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ReferralReceiptRequest.java
View file @
116c625
... | ... | @@ -20,6 +20,16 @@ |
20 | 20 | private String otherDiagn; |
21 | 21 | //接收医生 |
22 | 22 | private String recDoctor; |
23 | + //当前医院的patient | |
24 | + private String patientId; | |
25 | + | |
26 | + public String getPatientId() { | |
27 | + return patientId; | |
28 | + } | |
29 | + | |
30 | + public void setPatientId(String patientId) { | |
31 | + this.patientId = patientId; | |
32 | + } | |
23 | 33 | |
24 | 34 | public String getRecDoctor() { |
25 | 35 | return recDoctor; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ReferralApplyOrderResult.java
View file @
116c625
... | ... | @@ -68,10 +68,20 @@ |
68 | 68 | private String zhuanCName; |
69 | 69 | //转入医院 |
70 | 70 | private String zhuanRname; |
71 | + //接诊医生 | |
72 | + private String recDoctor; | |
71 | 73 | //目前诊断 |
72 | 74 | private List diagnosis; |
73 | 75 | //其他诊断 |
74 | 76 | private String otherDiagn; |
77 | + | |
78 | + public String getRecDoctor() { | |
79 | + return recDoctor; | |
80 | + } | |
81 | + | |
82 | + public void setRecDoctor(String recDoctor) { | |
83 | + this.recDoctor = recDoctor; | |
84 | + } | |
75 | 85 | |
76 | 86 | public List getDiagnosis() { |
77 | 87 | return diagnosis; |