Commit 6b7fe9054ee7ad6bc55c438971d803d338dcc0c6

Authored by liquanyu
1 parent 306d3f3ef6
Exists in dev

fix:优化儿童、产妇转诊相关逻辑

Showing 6 changed files with 131 additions and 31 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/ReferralApplyScreeningModel.java View file @ 6b7fe90
... ... @@ -63,6 +63,8 @@
63 63 private Integer expVip;
64 64 //转入科室
65 65 private String transferredDepartment;
  66 + //转出科室
  67 + private String outDepartment;
66 68 //病情描述
67 69 private String diseaseDesc;
68 70 //转院必要性
... ... @@ -429,6 +431,14 @@
429 431  
430 432 public void setTransferredHospital(String transferredHospital) {
431 433 this.transferredHospital = transferredHospital;
  434 + }
  435 +
  436 + public String getOutDepartment() {
  437 + return outDepartment;
  438 + }
  439 +
  440 + public void setOutDepartment(String outDepartment) {
  441 + this.outDepartment = outDepartment;
432 442 }
433 443  
434 444 @Override
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyScreeningQuery.java View file @ 6b7fe90
1 1 package com.lyms.platform.query;
2 2  
3 3 import com.lyms.platform.common.base.IConvertToNativeQuery;
  4 +import com.lyms.platform.common.core.annotation.form.FormParam;
4 5 import com.lyms.platform.common.dao.BaseQuery;
5 6 import com.lyms.platform.common.dao.operator.MongoCondition;
6 7 import com.lyms.platform.common.dao.operator.MongoOper;
7 8  
... ... @@ -51,7 +52,9 @@
51 52 private String hospitalName;
52 53 //转入医院
53 54 private String transferredHospital;
  55 + private String transferredDepartment;
54 56 private String outHospitalId;
  57 + private String outDepartment;
55 58 private String hospitalId;
56 59 private String phone;
57 60  
58 61  
59 62  
... ... @@ -94,8 +97,33 @@
94 97  
95 98 //查询号
96 99 private String queryNo;
  100 + //1 转入 0转出
  101 + private String action;
97 102  
  103 + public String getAction() {
  104 + return action;
  105 + }
98 106  
  107 + public void setAction(String action) {
  108 + this.action = action;
  109 + }
  110 +
  111 + public String getTransferredDepartment() {
  112 + return transferredDepartment;
  113 + }
  114 +
  115 + public void setTransferredDepartment(String transferredDepartment) {
  116 + this.transferredDepartment = transferredDepartment;
  117 + }
  118 +
  119 + public String getOutDepartment() {
  120 + return outDepartment;
  121 + }
  122 +
  123 + public void setOutDepartment(String outDepartment) {
  124 + this.outDepartment = outDepartment;
  125 + }
  126 +
99 127 public Date getLastMenses() {
100 128 return lastMenses;
101 129 }
... ... @@ -398,6 +426,21 @@
398 426 condition = condition.and("outHospitalId", outHospitalId, MongoOper.IN);
399 427 }
400 428  
  429 + if (StringUtils.isNotEmpty(action)){
  430 + //1 转入 0转出
  431 + if ("1".equals(action)){
  432 + condition = condition.and("transferredDepartment", true, MongoOper.EXISTS);
  433 + }else {
  434 + condition = condition.and("outDepartment", true, MongoOper.EXISTS);
  435 + }
  436 + }
  437 +
  438 + if (null != outDepartment) {
  439 + condition = condition.and("outDepartment", outDepartment, MongoOper.IS);
  440 + }
  441 + if (null != transferredDepartment) {
  442 + condition = condition.and("transferredDepartment", transferredDepartment, MongoOper.IS);
  443 + }
401 444 if (null != transferredHospital) {
402 445 List<String> list = new ArrayList<>();
403 446 list.add(transferredHospital);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyScreeningController.java View file @ 6b7fe90
... ... @@ -37,7 +37,7 @@
37 37 @TokenRequired
38 38 public BaseResponse addReferralApplyOrder(@Valid @RequestBody ReferralApplyScreeningAddRequest applyScreeningAddRequest, HttpServletRequest request) {
39 39 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
40   - return applyScreeningFacade.addOneReferralApplyScreening(applyScreeningAddRequest, loginState.getId(), 2);
  40 + return applyScreeningFacade.addOneReferralApplyScreening(applyScreeningAddRequest, loginState.getId(), applyScreeningAddRequest.getType());
41 41 }
42 42  
43 43 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyScreeningFacade.java View file @ 6b7fe90
... ... @@ -343,44 +343,49 @@
343 343 if (StringUtils.isNotEmpty(applyScreeningQueryRequest.getHandleType())) {
344 344 referralApplyScreeningQuery.setStatus(Integer.valueOf(applyScreeningQueryRequest.getHandleType()));
345 345 }
346   - //1 转入 0转出
347   - if ("1".equals(applyScreeningQueryRequest.getAction())) {
348   - if (StringUtils.isNotEmpty(applyScreeningQueryRequest.getTransferredHospital())) {
349   - if (NumberUtils.isNumber(applyScreeningQueryRequest.getTransferredHospital())) {
350   - referralApplyScreeningQuery.setOutHospitalId(applyScreeningQueryRequest.getTransferredHospital());
351   - } else {
352   - OrganizationQuery organizationQuery = new OrganizationQuery();
353   - organizationQuery.setYn(YnEnums.YES.getId());
354   - organizationQuery.setName(applyScreeningQueryRequest.getTransferredHospital());
355   - List<Organization> organization = organizationService.queryOrganization(organizationQuery);
356   - if (CollectionUtils.isNotEmpty(organization)) {
357   - referralApplyScreeningQuery.setOutHospitalId(organization.get(0).getId() + "");
358   - } else {
  346 + if (applyScreeningQueryRequest.getType()==2){
  347 + //1 转入 0转出
  348 + if ("1".equals(applyScreeningQueryRequest.getAction())) {
  349 + if (StringUtils.isNotEmpty(applyScreeningQueryRequest.getTransferredHospital())) {
  350 + if (NumberUtils.isNumber(applyScreeningQueryRequest.getTransferredHospital())) {
359 351 referralApplyScreeningQuery.setOutHospitalId(applyScreeningQueryRequest.getTransferredHospital());
  352 + } else {
  353 + OrganizationQuery organizationQuery = new OrganizationQuery();
  354 + organizationQuery.setYn(YnEnums.YES.getId());
  355 + organizationQuery.setName(applyScreeningQueryRequest.getTransferredHospital());
  356 + List<Organization> organization = organizationService.queryOrganization(organizationQuery);
  357 + if (CollectionUtils.isNotEmpty(organization)) {
  358 + referralApplyScreeningQuery.setOutHospitalId(organization.get(0).getId() + "");
  359 + } else {
  360 + referralApplyScreeningQuery.setOutHospitalId(applyScreeningQueryRequest.getTransferredHospital());
  361 + }
360 362 }
361 363 }
362   - }
363 364  
364   - referralApplyScreeningQuery.setTransferredHospital(hospital);
365   - } else if ("0".equals(applyScreeningQueryRequest.getAction())) {
366   - if (StringUtils.isNotEmpty(applyScreeningQueryRequest.getTransferredHospital())) {
367   - if (NumberUtils.isNumber(applyScreeningQueryRequest.getTransferredHospital())) {
368   - referralApplyScreeningQuery.setTransferredHospital(applyScreeningQueryRequest.getTransferredHospital());
369   - } else {
370   - OrganizationQuery organizationQuery = new OrganizationQuery();
371   - organizationQuery.setYn(YnEnums.YES.getId());
372   - organizationQuery.setName(applyScreeningQueryRequest.getTransferredHospital());
373   - List<Organization> organization = organizationService.queryOrganization(organizationQuery);
374   - if (CollectionUtils.isNotEmpty(organization)) {
375   - referralApplyScreeningQuery.setTransferredHospital(organization.get(0).getId() + "");
376   - } else {
  365 + referralApplyScreeningQuery.setTransferredHospital(hospital);
  366 + } else if ("0".equals(applyScreeningQueryRequest.getAction())) {
  367 + if (StringUtils.isNotEmpty(applyScreeningQueryRequest.getTransferredHospital())) {
  368 + if (NumberUtils.isNumber(applyScreeningQueryRequest.getTransferredHospital())) {
377 369 referralApplyScreeningQuery.setTransferredHospital(applyScreeningQueryRequest.getTransferredHospital());
  370 + } else {
  371 + OrganizationQuery organizationQuery = new OrganizationQuery();
  372 + organizationQuery.setYn(YnEnums.YES.getId());
  373 + organizationQuery.setName(applyScreeningQueryRequest.getTransferredHospital());
  374 + List<Organization> organization = organizationService.queryOrganization(organizationQuery);
  375 + if (CollectionUtils.isNotEmpty(organization)) {
  376 + referralApplyScreeningQuery.setTransferredHospital(organization.get(0).getId() + "");
  377 + } else {
  378 + referralApplyScreeningQuery.setTransferredHospital(applyScreeningQueryRequest.getTransferredHospital());
  379 + }
378 380 }
379 381 }
  382 + referralApplyScreeningQuery.setOutHospitalId(hospital);
380 383 }
381   - referralApplyScreeningQuery.setOutHospitalId(hospital);
  384 + }else {
  385 + referralApplyScreeningQuery.setAction(applyScreeningQueryRequest.getAction());
382 386 }
383 387  
  388 +
384 389 List<ReferralApplyScreeningModel> screeningModels =
385 390 applyScreeningService.queryReferralApplyScreeningWithQuery(referralApplyScreeningQuery);
386 391  
... ... @@ -646,8 +651,10 @@
646 651  
647 652 //查询转入申请单
648 653 ReferralApplyScreeningQuery referralApplyScreeningQuery1 = new ReferralApplyScreeningQuery();
649   - referralApplyScreeningQuery1.setOutHospitalId(outHospitalId);
650   - referralApplyScreeningQuery1.setTransferredHospital(patients.getHospitalId());
  654 + if (!outHospitalId.equals("2100002419")){
  655 + referralApplyScreeningQuery1.setOutHospitalId(outHospitalId);
  656 + referralApplyScreeningQuery1.setTransferredHospital(patients.getHospitalId());
  657 + }
651 658 referralApplyScreeningQuery1.setPid(patients.getPid());
652 659 referralApplyModel.setReceived(new Date());//接诊日期
653 660 applyScreeningService.updateByParentId(referralApplyScreeningQuery1, referralApplyModel);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ApplyScreeningQueryRequest.java View file @ 6b7fe90
... ... @@ -56,6 +56,24 @@
56 56  
57 57 //状态
58 58 private String handleType;
  59 + private String outDepartment;
  60 + private String transferredDepartment;
  61 +
  62 + public String getTransferredDepartment() {
  63 + return transferredDepartment;
  64 + }
  65 +
  66 + public void setTransferredDepartment(String transferredDepartment) {
  67 + this.transferredDepartment = transferredDepartment;
  68 + }
  69 +
  70 + public String getOutDepartment() {
  71 + return outDepartment;
  72 + }
  73 +
  74 + public void setOutDepartment(String outDepartment) {
  75 + this.outDepartment = outDepartment;
  76 + }
59 77  
60 78 public String getHandleType() {
61 79 return handleType;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ReferralApplyScreeningAddRequest.java View file @ 6b7fe90
... ... @@ -23,6 +23,8 @@
23 23 @FormParam
24 24 private String transferredDepartment;
25 25 @FormParam
  26 + private String outDepartment;
  27 + @FormParam
26 28 private String diseaseDesc;
27 29 @FormParam
28 30 private String transferredDisease;
... ... @@ -32,6 +34,8 @@
32 34 private String transferMode;
33 35 @FormParam
34 36 private String applyDoctor;
  37 + @FormParam
  38 + private Integer type;
35 39 public String getPid() {
36 40 return pid;
37 41 }
... ... @@ -104,6 +108,22 @@
104 108 this.transferredHospital = transferredHospital;
105 109 }
106 110  
  111 + public String getOutDepartment() {
  112 + return outDepartment;
  113 + }
  114 +
  115 + public void setOutDepartment(String outDepartment) {
  116 + this.outDepartment = outDepartment;
  117 + }
  118 +
  119 + public Integer getType() {
  120 + return type;
  121 + }
  122 +
  123 + public void setType(Integer type) {
  124 + this.type = type;
  125 + }
  126 +
107 127 @Override
108 128 public ReferralApplyScreeningModel convertToDataModel() {
109 129 ReferralApplyScreeningModel applyScreeningModel = new ReferralApplyScreeningModel();
... ... @@ -115,6 +135,8 @@
115 135 applyScreeningModel.setTransferredDepartment(transferredDepartment);
116 136 applyScreeningModel.setTransferredHospital(transferredHospital);
117 137 applyScreeningModel.setTransferredDisease(transferredDisease);
  138 + applyScreeningModel.setOutDepartment(outDepartment);
  139 + applyScreeningModel.setType(type);
118 140 return applyScreeningModel;
119 141 }
120 142 }