Commit f9eda7cc0661bff34522c3a2a4d0a061ca9834f3
1 parent
9b0c5caadd
Exists in
master
and in
1 other branch
孕妇分娩后 变成产妇
Showing 4 changed files with 131 additions and 59 deletions
- 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/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HighScoreResult.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
f9eda7c
| ... | ... | @@ -10,14 +10,12 @@ |
| 10 | 10 | import com.lyms.platform.common.utils.JsonUtil; |
| 11 | 11 | import com.lyms.platform.common.utils.SystemConfig; |
| 12 | 12 | import com.lyms.platform.operate.web.request.*; |
| 13 | -import com.lyms.platform.operate.web.result.AntData; | |
| 14 | -import com.lyms.platform.operate.web.result.AntenatalExaminationResult; | |
| 15 | -import com.lyms.platform.operate.web.result.AntexChuResult; | |
| 16 | -import com.lyms.platform.operate.web.result.AntexListResult; | |
| 13 | +import com.lyms.platform.operate.web.result.*; | |
| 17 | 14 | import com.lyms.platform.permission.model.Organization; |
| 18 | 15 | import com.lyms.platform.permission.service.OrganizationService; |
| 19 | 16 | import com.lyms.platform.pojo.*; |
| 20 | 17 | import com.lyms.platform.query.*; |
| 18 | +import com.sun.javafx.collections.MappingChange; | |
| 21 | 19 | import org.apache.commons.collections.CollectionUtils; |
| 22 | 20 | import org.apache.commons.lang.StringUtils; |
| 23 | 21 | import org.apache.commons.lang.math.NumberUtils; |
| 24 | 22 | |
| 25 | 23 | |
| 26 | 24 | |
| 27 | 25 | |
| 28 | 26 | |
| 29 | 27 | |
| 30 | 28 | |
| 31 | 29 | |
| ... | ... | @@ -149,35 +147,66 @@ |
| 149 | 147 | * |
| 150 | 148 | * @return |
| 151 | 149 | */ |
| 152 | - public List findLastRisk(String parentId) { | |
| 150 | + public HighScoreResult findLastRisk(String parentId) { | |
| 153 | 151 | List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(parentId); |
| 152 | + List result = new ArrayList(); | |
| 154 | 153 | AntenatalExaminationModel model = null; |
| 155 | 154 | if (CollectionUtils.isNotEmpty(list)) { |
| 156 | 155 | model = list.get(0); |
| 157 | 156 | } |
| 157 | + HighScoreResult highScoreResult = new HighScoreResult(); | |
| 158 | 158 | try { |
| 159 | - if (null != model && StringUtils.isNotEmpty(model.getRiskFactor())) { | |
| 159 | + //复诊 | |
| 160 | + if (null != model && StringUtils.isNotEmpty(model.getRiskFactor()) && !"{}".equals(model.getRiskFactor())) { | |
| 160 | 161 | List list1 = JsonUtil.toList(model.getRiskFactor(), List.class); |
| 161 | - return queryRisk(list1); | |
| 162 | + highScoreResult = queryRisk(list1); | |
| 163 | + result.addAll(highScoreResult.getHighRisk()); | |
| 162 | 164 | } |
| 163 | - } catch (Exception e) { | |
| 164 | - } | |
| 165 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 166 | - antExChuQuery.setParentId(parentId); | |
| 167 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 168 | - List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 169 | - AntExChuModel antExChuModel = null; | |
| 170 | - if (CollectionUtils.isNotEmpty(list1)) { | |
| 171 | - antExChuModel = list1.get(0); | |
| 172 | - } | |
| 173 | - try { | |
| 174 | - if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { | |
| 165 | + if (null != model &&!"{}".equals(model.getOtherRisk())) { | |
| 166 | + Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class); | |
| 167 | + | |
| 168 | + //风险因素 | |
| 169 | + Map map1 = new HashMap(); | |
| 170 | + map1.put("id", ""); | |
| 171 | + map1.put("name", map.get("fxysu")); | |
| 172 | + result.add(map1); | |
| 173 | + //风险评分 | |
| 174 | + Object idObj = map.get("fxpf"); | |
| 175 | + if (null != idObj) { | |
| 176 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); | |
| 177 | + highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0)); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + //初诊 | |
| 181 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 182 | + antExChuQuery.setParentId(parentId); | |
| 183 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 184 | + List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 185 | + AntExChuModel antExChuModel = null; | |
| 186 | + if (CollectionUtils.isNotEmpty(list1)) { | |
| 187 | + antExChuModel = list1.get(0); | |
| 188 | + } | |
| 189 | + if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"{}".equals(antExChuModel.getHighrisk())) { | |
| 175 | 190 | List list2 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
| 176 | - return queryRisk(list2); | |
| 191 | + highScoreResult = queryRisk(list2); | |
| 177 | 192 | } |
| 193 | + if (null != antExChuModel && !"{}".equals(antExChuModel.getOtherHighRisk())) { | |
| 194 | + Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class); | |
| 195 | + //风险因素 | |
| 196 | + Map map1 = new HashMap(); | |
| 197 | + map1.put("id", ""); | |
| 198 | + map1.put("name", map.get("fxysu")); | |
| 199 | + result.add(map1); | |
| 200 | + //风险评分 | |
| 201 | + Object idObj = map.get("fxpf"); | |
| 202 | + if (null != idObj) { | |
| 203 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); | |
| 204 | + highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0)); | |
| 205 | + } | |
| 206 | + } | |
| 178 | 207 | } catch (Exception e) { |
| 179 | 208 | } |
| 180 | - return Collections.emptyList(); | |
| 209 | + return highScoreResult; | |
| 181 | 210 | } |
| 182 | 211 | |
| 183 | 212 | /** |
| ... | ... | @@ -387,7 +416,7 @@ |
| 387 | 416 | * @param queryRequest |
| 388 | 417 | * @return |
| 389 | 418 | */ |
| 390 | - public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest,Integer userId) { | |
| 419 | + public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest, Integer userId) { | |
| 391 | 420 | |
| 392 | 421 | Patients patients = null; |
| 393 | 422 | Patients patients1 = null; |
| 394 | 423 | |
| 395 | 424 | |
| ... | ... | @@ -399,17 +428,17 @@ |
| 399 | 428 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
| 400 | 429 | if (CollectionUtils.isNotEmpty(list)) { |
| 401 | 430 | patients = list.get(0); |
| 402 | - patients1=patients; | |
| 431 | + patients1 = patients; | |
| 403 | 432 | } |
| 404 | 433 | } else { |
| 405 | - List<Integer> list1 =autoMatchFacade.matchOrgId(userId); | |
| 406 | - String hospital =null; | |
| 407 | - if(CollectionUtils.isNotEmpty(list1)){ | |
| 408 | - hospital= list1.get(0) + ""; | |
| 434 | + List<Integer> list1 = autoMatchFacade.matchOrgId(userId); | |
| 435 | + String hospital = null; | |
| 436 | + if (CollectionUtils.isNotEmpty(list1)) { | |
| 437 | + hospital = list1.get(0) + ""; | |
| 409 | 438 | } |
| 410 | 439 | //查询产妇数据 |
| 411 | - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(),null, hospital); | |
| 412 | - patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(),null, null); | |
| 440 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital); | |
| 441 | + patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null); | |
| 413 | 442 | } |
| 414 | 443 | |
| 415 | 444 | if (null == patients) { |
| 416 | 445 | |
| 417 | 446 | |
| 418 | 447 | |
| 419 | 448 | |
| ... | ... | @@ -426,17 +455,30 @@ |
| 426 | 455 | if (CollectionUtils.isNotEmpty(antExChulist)) { |
| 427 | 456 | antExChuModel = antExChulist.get(0); |
| 428 | 457 | } |
| 458 | + HighScoreResult highScoreResult = findLastRisk(patients1.getId()); | |
| 429 | 459 | //查询产前检查记录 |
| 430 | - List list = antenatalExaminationService.findAllByParentId(patients1.getId()); | |
| 431 | - List data = new ArrayList(); | |
| 460 | + List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(patients1.getId()); | |
| 461 | + /* List data = new ArrayList(); | |
| 432 | 462 | if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { |
| 433 | 463 | List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
| 434 | 464 | data = queryRiskName(l); |
| 435 | 465 | } |
| 466 | + if(CollectionUtils.isNotEmpty(list)){ | |
| 467 | + AntenatalExaminationModel antEx= list.get(0); | |
| 468 | + try{ | |
| 469 | + if(!"{}".equals(antEx.getOtherRisk())){ | |
| 470 | + JsonUtil.str2Obj(antEx.getOtherRisk(), java.util.Map.class); | |
| 471 | + } | |
| 472 | + }catch (Exception e){ | |
| 473 | + } | |
| 474 | + data.add(); | |
| 475 | + }*/ | |
| 436 | 476 | |
| 477 | + | |
| 437 | 478 | antexListResult.convertToResult(list, patients, antExChulist); |
| 438 | 479 | antexListResult.setIsSieve(cap(patients.getLastMenses(), patients1.getId())); |
| 439 | - antexListResult.setRiskFactor(data); | |
| 480 | + antexListResult.setRiskFactor(highScoreResult.getHighRisk()); | |
| 481 | + antexListResult.setRiskScore(highScoreResult.getScore()+""); | |
| 440 | 482 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult); |
| 441 | 483 | } |
| 442 | 484 | |
| 443 | 485 | |
| ... | ... | @@ -469,14 +511,15 @@ |
| 469 | 511 | try { |
| 470 | 512 | if (StringUtils.isNotEmpty(examinationModel.getRiskFactor())) { |
| 471 | 513 | List list1 = JsonUtil.toList(examinationModel.getRiskFactor(), List.class); |
| 472 | - antenatalExaminationResult.setRiskFactor(queryRisk(list1)); | |
| 514 | + HighScoreResult highScoreResult = queryRisk(list1); | |
| 515 | + antenatalExaminationResult.setRiskFactor(highScoreResult.getHighRisk()); | |
| 473 | 516 | } |
| 474 | 517 | } catch (Exception e) { |
| 475 | 518 | } |
| 476 | 519 | try { |
| 477 | 520 | if (StringUtils.isNotEmpty(examinationModel.getDiagnosis())) { |
| 478 | 521 | List list = JsonUtil.toList(examinationModel.getDiagnosis(), List.class); |
| 479 | - antenatalExaminationResult.setDiagnosis(queryRisk(list)); | |
| 522 | + antenatalExaminationResult.setDiagnosis(queryRisk(list).getHighRisk()); | |
| 480 | 523 | } |
| 481 | 524 | } catch (Exception e) { |
| 482 | 525 | } |
| 483 | 526 | |
| ... | ... | @@ -510,14 +553,14 @@ |
| 510 | 553 | try { |
| 511 | 554 | if (StringUtils.isNotEmpty(antExChuModel.getDiagnosis())) { |
| 512 | 555 | List list = JsonUtil.toList(antExChuModel.getDiagnosis(), List.class); |
| 513 | - antexChuResult.setDiagnosis(queryRisk(list)); | |
| 556 | + antexChuResult.setDiagnosis(queryRisk(list).getHighRisk()); | |
| 514 | 557 | } |
| 515 | 558 | } catch (Exception e) { |
| 516 | 559 | } |
| 517 | 560 | try { |
| 518 | 561 | if (StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { |
| 519 | 562 | List list1 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
| 520 | - antexChuResult.setHighrisk(queryRisk(list1)); | |
| 563 | + antexChuResult.setHighrisk(queryRisk(list1).getHighRisk()); | |
| 521 | 564 | } |
| 522 | 565 | } catch (Exception e) { |
| 523 | 566 | } |
| 524 | 567 | |
| 525 | 568 | |
| ... | ... | @@ -536,11 +579,14 @@ |
| 536 | 579 | return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 537 | 580 | } |
| 538 | 581 | |
| 539 | - public List queryRisk(List<String> id) { | |
| 582 | + public HighScoreResult queryRisk(List<String> id) { | |
| 583 | + HighScoreResult highScoreResult = new HighScoreResult(); | |
| 540 | 584 | BasicConfigQuery |
| 541 | 585 | basicConfigQuery = new BasicConfigQuery(); |
| 542 | 586 | List data = new ArrayList(); |
| 587 | + Integer score = null; | |
| 543 | 588 | if (CollectionUtils.isNotEmpty(id)) { |
| 589 | + score = 0; | |
| 544 | 590 | for (String i : id) { |
| 545 | 591 | basicConfigQuery.setId(i); |
| 546 | 592 | List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery); |
| 547 | 593 | |
| ... | ... | @@ -549,12 +595,17 @@ |
| 549 | 595 | Map<String, Object> map = new HashMap<>(); |
| 550 | 596 | map.put("id", basicConfig.getId()); |
| 551 | 597 | map.put("name", basicConfig.getName()); |
| 598 | + if (StringUtils.isNotEmpty(basicConfig.getCode())) { | |
| 599 | + score += NumberUtils.toInt(basicConfig.getCode(), 0); | |
| 600 | + } | |
| 552 | 601 | data.add(map); |
| 553 | 602 | } |
| 554 | 603 | } |
| 555 | 604 | } |
| 556 | 605 | } |
| 557 | - return data; | |
| 606 | + highScoreResult.setHighRisk(data); | |
| 607 | + highScoreResult.setScore(score); | |
| 608 | + return highScoreResult; | |
| 558 | 609 | } |
| 559 | 610 | |
| 560 | 611 | public BaseResponse getEnums() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
f9eda7c
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.*; |
| 4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | -import com.lyms.platform.common.enums.ServiceObjEnums; | |
| 6 | 5 | import com.lyms.platform.common.enums.SmsServiceEnums; |
| 7 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| 8 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
| ... | ... | @@ -55,7 +54,6 @@ |
| 55 | 54 | private AntenatalExaminationFacade antenatalExaminationFacade; |
| 56 | 55 | |
| 57 | 56 | |
| 58 | - | |
| 59 | 57 | /** |
| 60 | 58 | * 修改产妇的社区 |
| 61 | 59 | * |
| ... | ... | @@ -202,7 +200,7 @@ |
| 202 | 200 | patientsQuery.setName(riskPatientsQueryRequest.getName()); |
| 203 | 201 | patientsQuery.sethScore(riskPatientsQueryRequest.gethScore()); |
| 204 | 202 | patientsQuery.setrFactor(riskPatientsQueryRequest.getrFactor()); |
| 205 | - if(null!=riskPatientsQueryRequest.getServiceType()){ | |
| 203 | + if (null != riskPatientsQueryRequest.getServiceType()) { | |
| 206 | 204 | patientsQuery.setServiceType(Integer.valueOf(riskPatientsQueryRequest.getServiceType())); |
| 207 | 205 | } |
| 208 | 206 | patientsQuery.setAge(riskPatientsQueryRequest.getAge()); |
| 209 | 207 | |
| ... | ... | @@ -241,14 +239,15 @@ |
| 241 | 239 | patientBaseResult.convert(patients); |
| 242 | 240 | } |
| 243 | 241 | try { |
| 244 | - patientBaseResult.setRiskFactor(antenatalExaminationFacade.findLastRisk(patients.getId())); | |
| 242 | + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId()); | |
| 243 | + patientBaseResult.setRiskFactor(highScoreResult.getHighRisk()); | |
| 244 | + patientBaseResult.setRiskScore(highScoreResult.getScore()+""); | |
| 245 | 245 | } catch (Exception e) { |
| 246 | 246 | } |
| 247 | 247 | return new BaseObjectResponse().setData(patientBaseResult).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| 251 | - | |
| 252 | 251 | /** |
| 253 | 252 | * 转成全部产妇的返回数据 |
| 254 | 253 | * |
| 255 | 254 | |
| 256 | 255 | |
| 257 | 256 | |
| ... | ... | @@ -328,24 +327,20 @@ |
| 328 | 327 | return data; |
| 329 | 328 | } |
| 330 | 329 | |
| 331 | - public BaseResponse patientGuildSms(PatientGuideSmsRequest patientGuideSmsRequest){ | |
| 330 | + public BaseResponse patientGuildSms(PatientGuideSmsRequest patientGuideSmsRequest) { | |
| 332 | 331 | MessageListRequest smsList = new MessageListRequest(); |
| 333 | - List<MessageRequest> messages = new ArrayList<>(); | |
| 332 | + List<MessageRequest> messages = new ArrayList<>(); | |
| 334 | 333 | List<Patients> sendModels = new ArrayList<>(); |
| 335 | - if (CollectionUtils.isNotEmpty(patientGuideSmsRequest.getIds())) | |
| 336 | - { | |
| 337 | - for(String patientId:patientGuideSmsRequest.getIds()){ | |
| 338 | - Patients patients= patientsService.findOnePatientById(patientId); | |
| 339 | - if(null!=patients){ | |
| 334 | + if (CollectionUtils.isNotEmpty(patientGuideSmsRequest.getIds())) { | |
| 335 | + for (String patientId : patientGuideSmsRequest.getIds()) { | |
| 336 | + Patients patients = patientsService.findOnePatientById(patientId); | |
| 337 | + if (null != patients) { | |
| 340 | 338 | sendModels.add(patients); |
| 341 | 339 | } |
| 342 | 340 | } |
| 343 | - if (CollectionUtils.isNotEmpty(sendModels)) | |
| 344 | - { | |
| 345 | - for (Patients model : sendModels) | |
| 346 | - { | |
| 347 | - if (model != null && com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getPhone())) | |
| 348 | - { | |
| 341 | + if (CollectionUtils.isNotEmpty(sendModels)) { | |
| 342 | + for (Patients model : sendModels) { | |
| 343 | + if (model != null && com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getPhone())) { | |
| 349 | 344 | MessageRequest mr = new MessageRequest(); |
| 350 | 345 | mr.setContent(patientGuideSmsRequest.getSmsContent()); |
| 351 | 346 | mr.setObjType(Integer.valueOf(patientGuideSmsRequest.getType())); |
| ... | ... | @@ -362,8 +357,7 @@ |
| 362 | 357 | } |
| 363 | 358 | } |
| 364 | 359 | |
| 365 | - if (CollectionUtils.isNotEmpty(messages)) | |
| 366 | - { | |
| 360 | + if (CollectionUtils.isNotEmpty(messages)) { | |
| 367 | 361 | smsList.setTypeId(1); |
| 368 | 362 | smsList.setMessages(messages); |
| 369 | 363 | //调用发送接口 TODO |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
f9eda7c
| ... | ... | @@ -102,7 +102,7 @@ |
| 102 | 102 | try { |
| 103 | 103 | if(StringUtils.isNotEmpty(postReviewModel.getDiagnosis())){ |
| 104 | 104 | List list = JsonUtil.toList(postReviewModel.getDiagnosis(), List.class); |
| 105 | - postReviewResult.setDiagnosis(examinationFacade.queryRisk(list)); | |
| 105 | + postReviewResult.setDiagnosis(examinationFacade.queryRisk(list).getHighRisk()); | |
| 106 | 106 | } |
| 107 | 107 | } catch (Exception e) { |
| 108 | 108 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HighScoreResult.java
View file @
f9eda7c
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Created by Administrator on 2016/8/2 0002. | |
| 7 | + */ | |
| 8 | +public class HighScoreResult { | |
| 9 | + private List highRisk; | |
| 10 | + private Integer score; | |
| 11 | + | |
| 12 | + public List getHighRisk() { | |
| 13 | + return highRisk; | |
| 14 | + } | |
| 15 | + | |
| 16 | + public void setHighRisk(List highRisk) { | |
| 17 | + this.highRisk = highRisk; | |
| 18 | + } | |
| 19 | + | |
| 20 | + public Integer getScore() { | |
| 21 | + return score; | |
| 22 | + } | |
| 23 | + | |
| 24 | + public void setScore(Integer score) { | |
| 25 | + this.score = score; | |
| 26 | + } | |
| 27 | +} |