Commit 6eb532c34618fb590e292eef6ff9955bb93619a7
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 5 changed files
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.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/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
6eb532c
| ... | ... | @@ -61,7 +61,17 @@ |
| 61 | 61 | |
| 62 | 62 | //面部识别是否存在 |
| 63 | 63 | private boolean isFace; |
| 64 | + //是否存在筛查结果 | |
| 65 | + private boolean isScreenResult; | |
| 64 | 66 | |
| 67 | + public boolean isScreenResult() { | |
| 68 | + return isScreenResult; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setScreenResult(boolean screenResult) { | |
| 72 | + isScreenResult = screenResult; | |
| 73 | + } | |
| 74 | + | |
| 65 | 75 | public Integer getDueStatus() { |
| 66 | 76 | return dueStatus; |
| 67 | 77 | } |
| ... | ... | @@ -1170,6 +1180,10 @@ |
| 1170 | 1180 | |
| 1171 | 1181 | if (isFace) { |
| 1172 | 1182 | condition = condition.and("face", true, MongoOper.EXISTS); |
| 1183 | + } | |
| 1184 | + | |
| 1185 | + if (isScreenResult) { | |
| 1186 | + condition = condition.and("screenResult", true, MongoOper.EXISTS); | |
| 1173 | 1187 | } |
| 1174 | 1188 | |
| 1175 | 1189 | if (bookbuildingDoctor != null) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
6eb532c
| ... | ... | @@ -160,7 +160,7 @@ |
| 160 | 160 | |
| 161 | 161 | //表示区域的 |
| 162 | 162 | if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId)) && StringUtils.isNotEmpty(pid)) { |
| 163 | - System.out.println("复诊时开始隐藏建档:"+parentId); | |
| 163 | + System.out.println("复诊时开始隐藏建档:" + parentId); | |
| 164 | 164 | patients = findOnePatient(null, null, null, null, type, false, pid, false); |
| 165 | 165 | patients.setSource(patients.getId()); |
| 166 | 166 | patients.setId(null); |
| ... | ... | @@ -342,7 +342,7 @@ |
| 342 | 342 | e.printStackTrace(); |
| 343 | 343 | } |
| 344 | 344 | try { |
| 345 | - //修改孕妇高危等级 | |
| 345 | + //修改的时候设置最新的高危/冗余筛查结果和下次产检预约时间 | |
| 346 | 346 | updateLastRisk(antExamModel.getParentId()); |
| 347 | 347 | } catch (Exception e) { |
| 348 | 348 | e.printStackTrace(); |
| ... | ... | @@ -368,7 +368,7 @@ |
| 368 | 368 | try { |
| 369 | 369 | //复诊冗余到产检表 |
| 370 | 370 | antenatalExaminationService.updateAntExRecord(antExamModel.getId(), 2); |
| 371 | - }catch (Exception e){ | |
| 371 | + } catch (Exception e) { | |
| 372 | 372 | e.printStackTrace(); |
| 373 | 373 | } |
| 374 | 374 | try { |
| ... | ... | @@ -439,7 +439,7 @@ |
| 439 | 439 | e.printStackTrace(); |
| 440 | 440 | } |
| 441 | 441 | //同步更新两条转诊记录信息 |
| 442 | - applyOrderFacade.updataReferral(patients.getId(),model1); | |
| 442 | + applyOrderFacade.updataReferral(patients.getId(), model1); | |
| 443 | 443 | |
| 444 | 444 | System.out.println("查询转诊条件:" + referralApplyOrderQuery.convertToQuery().convertToMongoQuery()); |
| 445 | 445 | } |
| ... | ... | @@ -482,7 +482,6 @@ |
| 482 | 482 | antExChuModel.setHospitalId(hospitalId); |
| 483 | 483 | if (StringUtils.isNotEmpty(antExChuModel.getId()) && StringUtils.isNotEmpty(antExChuModel.getParentId())) { |
| 484 | 484 | antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId()); |
| 485 | - | |
| 486 | 485 | antenatalExaminationService.updatePatientAbortion(antExChuModel.getId(), antExChuModel.getAbortionZR(), antExChuModel.getAbortionRG()); |
| 487 | 486 | commonThreadPool.execute(new Runnable() { |
| 488 | 487 | @Override |
| 489 | 488 | |
| ... | ... | @@ -495,12 +494,10 @@ |
| 495 | 494 | } |
| 496 | 495 | patientsService.updateNextCheckTime(excAddRequest.getNextCheckTime(), patients.getId()); |
| 497 | 496 | patientsService.updatePatient(patients); |
| 498 | - | |
| 499 | - //修改本系统最后的高危 | |
| 497 | + //修改的时候设置最新的高危/冗余筛查结果和下次产检预约时间 | |
| 500 | 498 | updateLastRisk(patients.getId()); |
| 501 | 499 | //修改本院最后一次定义高危 |
| 502 | 500 | updateLastRhTime(patients.getId(), hospitalId); |
| 503 | - | |
| 504 | 501 | setLashCTimes(excAddRequest.getParentId()); |
| 505 | 502 | //冗余到产检表 |
| 506 | 503 | antenatalExaminationService.updateAntExRecord(excAddRequest.getId(), 1); |
| ... | ... | @@ -524,7 +521,6 @@ |
| 524 | 521 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 525 | 522 | patientsQuery.setPid(patients.getPid()); |
| 526 | 523 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 527 | - | |
| 528 | 524 | antExChuModel.setHospitalId(hospitalId); |
| 529 | 525 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
| 530 | 526 | antExChuQuery.setYn(YnEnums.YES.getId()); |
| 531 | 527 | |
| 532 | 528 | |
| ... | ... | @@ -553,19 +549,12 @@ |
| 553 | 549 | commonThreadPool.execute(new Runnable() { |
| 554 | 550 | @Override |
| 555 | 551 | public void run() { |
| 556 | - //查询最后一次产检筛查结果冗余到patient表 | |
| 557 | - Map<String, Object> map = getPatLastScreenResult(patients.getId()); | |
| 558 | - if (map != null && map.containsKey("screenResult")) { | |
| 559 | - patients.setScreenResult((List<String>) map.get("screenResult")); | |
| 560 | - } | |
| 561 | 552 | patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor()); |
| 562 | 553 | patientsService.updatePatient(patients); |
| 563 | - | |
| 564 | 554 | /** 把优惠券设置为已使用状态 */ |
| 565 | 555 | couponService.use(hospitalId, excAddRequest.getCouponCode(), userId, chuId); |
| 566 | 556 | //修改患者风险等级 |
| 567 | 557 | patientsService.updateNextCheckTime(excAddRequest.getNextCheckTime(), patients.getId()); |
| 568 | - | |
| 569 | 558 | updateLastRisk(patients.getId()); |
| 570 | 559 | //修改本院最后一次定义高危 |
| 571 | 560 | updateLastRhTime(patients.getId(), hospitalId); |
| ... | ... | @@ -634,9 +623,8 @@ |
| 634 | 623 | } |
| 635 | 624 | |
| 636 | 625 | //聊城东昌府医院初诊的身高更新到随心测 |
| 637 | - if ("1000000116".equals(hospitalId) || "2100001305".equals(hospitalId)) | |
| 638 | - { | |
| 639 | - measureInfoFacade.updateHeight(antExChuModel.getParentId(),hospitalId,antExChuModel.getHeight()); | |
| 626 | + if ("1000000116".equals(hospitalId) || "2100001305".equals(hospitalId)) { | |
| 627 | + measureInfoFacade.updateHeight(antExChuModel.getParentId(), hospitalId, antExChuModel.getHeight()); | |
| 640 | 628 | } |
| 641 | 629 | |
| 642 | 630 | |
| ... | ... | @@ -933,6 +921,10 @@ |
| 933 | 921 | break; |
| 934 | 922 | } |
| 935 | 923 | highScoreResult.put("screenResult", model.getScreenResult()); |
| 924 | + if(model.getNextCheckTime()!=null){ | |
| 925 | + //最后一次预约下次产检时间 | |
| 926 | + highScoreResult.put("nextCheckTime", model.getNextCheckTime()); | |
| 927 | + } | |
| 936 | 928 | next = false; |
| 937 | 929 | } |
| 938 | 930 | } |
| ... | ... | @@ -952,6 +944,10 @@ |
| 952 | 944 | break; |
| 953 | 945 | } |
| 954 | 946 | highScoreResult.put("screenResult", antExChuModel.getScreenResult()); |
| 947 | + //最后一次预约下次产检时间 | |
| 948 | + if(antExChuModel.getNextCheckTime()!=null) { | |
| 949 | + highScoreResult.put("nextCheckTime", antExChuModel.getNextCheckTime()); | |
| 950 | + } | |
| 955 | 951 | next = false; |
| 956 | 952 | } |
| 957 | 953 | } |
| ... | ... | @@ -1720,7 +1716,20 @@ |
| 1720 | 1716 | HighScoreResult highScoreResult = findLastRisk(patients.getPid(), true); |
| 1721 | 1717 | resultMap.put("highRisk", highScoreResult.getHighRisk()); |
| 1722 | 1718 | resultMap.put("highriskDesc", highScoreResult.getHighriskDesc()); |
| 1723 | - resultMap.put("screenResult", getscreenResult(patients.getScreenResult())); | |
| 1719 | + if (patients.getScreenResult() != null) {//优先继承当前医院的筛查结果 | |
| 1720 | + resultMap.put("screenResult", getscreenResult(patients.getScreenResult())); | |
| 1721 | + } else {//查询区域的patient数据 | |
| 1722 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 1723 | + patientsQuery.setPid(patients.getPid()); | |
| 1724 | + patientsQuery.setType(1); | |
| 1725 | + patientsQuery.setScreenResult(true); | |
| 1726 | + patientsQuery.setSort("created"); | |
| 1727 | + List<Patients> patients1 = patientsService.queryPatient(patientsQuery); | |
| 1728 | + if (CollectionUtils.isNotEmpty(patients1)) { | |
| 1729 | + patients = patients1.get(0); | |
| 1730 | + resultMap.put("screenResult", getscreenResult(patients.getScreenResult())); | |
| 1731 | + } | |
| 1732 | + } | |
| 1724 | 1733 | } |
| 1725 | 1734 | return new BaseObjectResponse().setData(resultMap).setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1726 | 1735 | } |
| ... | ... | @@ -2013,7 +2022,7 @@ |
| 2013 | 2022 | } |
| 2014 | 2023 | |
| 2015 | 2024 | /** |
| 2016 | - * 修改的时候设置最新的高危 | |
| 2025 | + * 修改的时候设置最新的高危/冗余筛查结果和下次产检预约时间 | |
| 2017 | 2026 | * |
| 2018 | 2027 | * @param parentId |
| 2019 | 2028 | */ |
| ... | ... | @@ -2041,6 +2050,9 @@ |
| 2041 | 2050 | if (map != null && map.containsKey("screenResult")) { |
| 2042 | 2051 | patients1.setScreenResult((List<String>) map.get("screenResult")); |
| 2043 | 2052 | } |
| 2053 | + if (map != null && map.containsKey("nextCheckTime")) { | |
| 2054 | + patients1.setNextCheckTime((Date) map.get("nextCheckTime")); | |
| 2055 | + } | |
| 2044 | 2056 | patientsService.findAndModify(patientsQuery1, patients1); |
| 2045 | 2057 | } |
| 2046 | 2058 | |
| ... | ... | @@ -2077,7 +2089,7 @@ |
| 2077 | 2089 | patientsQuery.setEnable("2"); |
| 2078 | 2090 | } |
| 2079 | 2091 | Patients patients = null; |
| 2080 | - System.out.println("复诊时查询当前医院是否有隐藏建档条件:"+patientsQuery.convertToQuery().convertToMongoQuery()); | |
| 2092 | + System.out.println("复诊时查询当前医院是否有隐藏建档条件:" + patientsQuery.convertToQuery().convertToMongoQuery()); | |
| 2081 | 2093 | List<Patients> list = patientsService.queryPatient1(patientsQuery, "modified"); |
| 2082 | 2094 | if (CollectionUtils.isNotEmpty(list)) { |
| 2083 | 2095 | return list.get(0); |
| 2084 | 2096 | |
| ... | ... | @@ -2631,9 +2643,8 @@ |
| 2631 | 2643 | } |
| 2632 | 2644 | |
| 2633 | 2645 | /** |
| 2634 | - * | |
| 2635 | 2646 | * @param id |
| 2636 | - * @param n 是否要高危等级 | |
| 2647 | + * @param n 是否要高危等级 | |
| 2637 | 2648 | * @return |
| 2638 | 2649 | */ |
| 2639 | 2650 | public synchronized HighScoreResult queryRisk(List<String> id, boolean n) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
6eb532c
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
6eb532c
| ... | ... | @@ -106,8 +106,7 @@ |
| 106 | 106 | List<BabyCheckModel> models = babyCheckService.queryBabyCheckRecord(query); |
| 107 | 107 | babyCheckService.updateBabyCheck(model, request.getId()); |
| 108 | 108 | |
| 109 | - if (CollectionUtils.isNotEmpty(models)) | |
| 110 | - { | |
| 109 | + if (CollectionUtils.isNotEmpty(models)) { | |
| 111 | 110 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), models.get(0), model, OptActionEnums.UPDATE.getId(), "修改儿童检查"); |
| 112 | 111 | } |
| 113 | 112 | |
| 114 | 113 | |
| 115 | 114 | |
| 116 | 115 | |
| ... | ... | @@ -367,17 +366,17 @@ |
| 367 | 366 | public BaseResponse addBabyCheck(BabyCheckRequest request, Integer userId) { |
| 368 | 367 | |
| 369 | 368 | /** 验证产检券是否可用 可用就改为已使用状态 */ |
| 370 | - if(org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode())) { | |
| 369 | + if (org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode())) { | |
| 371 | 370 | BaseObjectResponse resp = couponService.validate(request.getCouponCode(), 8, autoMatchFacade.getHospitalId(userId)); |
| 372 | - if(resp.getErrorcode() != 0) { | |
| 371 | + if (resp.getErrorcode() != 0) { | |
| 373 | 372 | return resp; |
| 374 | 373 | } |
| 375 | 374 | } |
| 376 | 375 | |
| 377 | 376 | /** 验证产检券是否可用 可用就改为已使用状态(血红蛋白) */ |
| 378 | - if(org.apache.commons.lang3.StringUtils.isNotBlank(request.getHemoglobinCoupon())) { | |
| 377 | + if (org.apache.commons.lang3.StringUtils.isNotBlank(request.getHemoglobinCoupon())) { | |
| 379 | 378 | BaseObjectResponse resp = couponService.validate(request.getHemoglobinCoupon(), 10, autoMatchFacade.getHospitalId(userId)); |
| 380 | - if(resp.getErrorcode() != 0) { | |
| 379 | + if (resp.getErrorcode() != 0) { | |
| 381 | 380 | return resp; |
| 382 | 381 | } |
| 383 | 382 | } |
| 384 | 383 | |
| ... | ... | @@ -428,10 +427,10 @@ |
| 428 | 427 | operateLogFacade.addAddOptLog(userId, Integer.valueOf(hospitalId), model, OptActionEnums.ADD.getId(), "添加儿童检查"); |
| 429 | 428 | |
| 430 | 429 | /** 使用优惠券 */ |
| 431 | - if(org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode())) { | |
| 430 | + if (org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode())) { | |
| 432 | 431 | couponService.use(autoMatchFacade.getHospitalId(userId), request.getCouponCode(), userId, model.getId()); |
| 433 | 432 | } |
| 434 | - if(org.apache.commons.lang3.StringUtils.isNotBlank(request.getHemoglobinCoupon())) { | |
| 433 | + if (org.apache.commons.lang3.StringUtils.isNotBlank(request.getHemoglobinCoupon())) { | |
| 435 | 434 | couponService.use(autoMatchFacade.getHospitalId(userId), request.getHemoglobinCoupon(), userId, model.getId()); |
| 436 | 435 | } |
| 437 | 436 | |
| ... | ... | @@ -537,7 +536,7 @@ |
| 537 | 536 | * |
| 538 | 537 | * @param id |
| 539 | 538 | */ |
| 540 | - public void deleteBabyCheckById(String id,Integer userId) { | |
| 539 | + public void deleteBabyCheckById(String id, Integer userId) { | |
| 541 | 540 | |
| 542 | 541 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 543 | 542 | |
| ... | ... | @@ -550,7 +549,7 @@ |
| 550 | 549 | babyCheckService.deleteBabyCheckById(id); |
| 551 | 550 | if (CollectionUtils.isNotEmpty(checkModels)) { |
| 552 | 551 | |
| 553 | - operateLogFacade.addDeleteOptLog(userId, Integer.valueOf(hospitalId),checkModels.get(0), OptActionEnums.DELETE.getId(), "删除儿童检查"); | |
| 552 | + operateLogFacade.addDeleteOptLog(userId, Integer.valueOf(hospitalId), checkModels.get(0), OptActionEnums.DELETE.getId(), "删除儿童检查"); | |
| 554 | 553 | |
| 555 | 554 | query.setId(null); |
| 556 | 555 | query.setBuildId(checkModels.get(0).getBuildId()); |
| ... | ... | @@ -632,7 +631,7 @@ |
| 632 | 631 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
| 633 | 632 | Date lastDate = null; |
| 634 | 633 | for (BabyModel b : models) { |
| 635 | - if(lastDate == null) { | |
| 634 | + if (lastDate == null) { | |
| 636 | 635 | lastDate = b.getBuildDate(); |
| 637 | 636 | } else { |
| 638 | 637 | if (b.getBuildDate() != null && lastDate.getTime() < b.getBuildDate().getTime()) { |
| ... | ... | @@ -640,7 +639,7 @@ |
| 640 | 639 | } |
| 641 | 640 | } |
| 642 | 641 | } |
| 643 | - if(lastDate != null) { | |
| 642 | + if (lastDate != null) { | |
| 644 | 643 | resMap.put("lastDate", DateUtil.getyyyy_MM_dd(lastDate)); |
| 645 | 644 | } |
| 646 | 645 | |
| 647 | 646 | |
| 648 | 647 | |
| 649 | 648 | |
| 650 | 649 | |
| ... | ... | @@ -782,25 +781,25 @@ |
| 782 | 781 | base.setPregnantCertificateTypeId(model.getMcertTypeId()); |
| 783 | 782 | base.setMonthAge(DateUtil.getBabyMonthAge(model.getBirth(), new Date())); |
| 784 | 783 | //计算儿童的预产期 |
| 785 | - if(model.getBirth()!=null&&model.getDueWeek()!=null&&model.getDueWeek()<37){//早产儿,根据出生孕周计算末次月经,在根据末次月经计算预产期 | |
| 784 | + if (model.getBirth() != null && model.getDueWeek() != null && model.getDueWeek() < 37) {//早产儿,根据出生孕周计算末次月经,在根据末次月经计算预产期 | |
| 786 | 785 | String birthStr = DateUtil.getyyyy_MM_dd(model.getBirth()); |
| 787 | 786 | Date ymdBirth = DateUtil.parseYMD(birthStr); |
| 788 | - if(model.getDueDate()==null || ymdBirth.getTime() == model.getDueDate().getTime()){//预产期为空或者预产期与生日一致进行计算真实预产期 | |
| 787 | + if (model.getDueDate() == null || ymdBirth.getTime() == model.getDueDate().getTime()) {//预产期为空或者预产期与生日一致进行计算真实预产期 | |
| 789 | 788 | //根据出生孕周计算末次月经 |
| 790 | - Date LastMens = DateUtil.addWeek(model.getBirth(),-model.getDueWeek()); | |
| 789 | + Date LastMens = DateUtil.addWeek(model.getBirth(), -model.getDueWeek()); | |
| 791 | 790 | //根据末次月经计算预产期 |
| 792 | 791 | // Date dueDate = DateUtil.addMonth(LastMens, 9); |
| 793 | 792 | // dueDate = DateUtil.addDay(dueDate, 7); |
| 794 | 793 | Date dueDate = DateUtil.addDay(LastMens, 280); |
| 795 | 794 | //返回预产期 |
| 796 | 795 | base.setDueDate(DateUtil.getyyyy_MM_dd(dueDate)); |
| 797 | - }else{ | |
| 796 | + } else { | |
| 798 | 797 | base.setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); |
| 799 | 798 | } |
| 800 | 799 | } |
| 801 | 800 | |
| 802 | 801 | base.setBirthday(DateUtil.getyyyy_MM_dd(model.getBirth())); |
| 803 | - base.setSourceId(org.apache.commons.lang.StringUtils.isNotEmpty(model.getSource())?model.getSource():model.getId()); | |
| 802 | + base.setSourceId(org.apache.commons.lang.StringUtils.isNotEmpty(model.getSource()) ? model.getSource() : model.getId()); | |
| 804 | 803 | if (model.getPid() != null) { |
| 805 | 804 | //诊断 |
| 806 | 805 | List list = getBabyLastDiagnose(model.getPid()); |
| 807 | 806 | |
| ... | ... | @@ -994,10 +993,10 @@ |
| 994 | 993 | babyQuery.setYn(YnEnums.YES.getId()); |
| 995 | 994 | |
| 996 | 995 | /** 处理优惠券查询 */ |
| 997 | - if(StringUtils.isNotEmpty(coupon)) { | |
| 996 | + if (StringUtils.isNotEmpty(coupon)) { | |
| 998 | 997 | Map<String, Object> m = couponMapper.findUrl(coupon); |
| 999 | 998 | Object personId = m.get("user_id"); |
| 1000 | - if(personId != null) { | |
| 999 | + if (personId != null) { | |
| 1001 | 1000 | babyQuery.setPid(personId.toString()); |
| 1002 | 1001 | } |
| 1003 | 1002 | } |
| 1004 | 1003 | |
| 1005 | 1004 | |
| 1006 | 1005 | |
| 1007 | 1006 | |
| ... | ... | @@ -1013,32 +1012,29 @@ |
| 1013 | 1012 | List<String> hList = groupsFacade.findGroupHospital(userId, false); |
| 1014 | 1013 | babyQuery.setHospitalIdList(hList); |
| 1015 | 1014 | |
| 1016 | - Map<String,List<BabyChooseResult>> listMap = new HashMap<>(); | |
| 1015 | + Map<String, List<BabyChooseResult>> listMap = new HashMap<>(); | |
| 1017 | 1016 | |
| 1018 | 1017 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
| 1019 | 1018 | |
| 1020 | - if (CollectionUtils.isEmpty(models) && StringUtils.isNotEmpty(vcCardNo)) | |
| 1021 | - { | |
| 1022 | - if ("4".equals(HIS_VERSION)) { | |
| 1023 | - List<Map<String,Object>> hisPatient = qhdfyHisService.getPatientInfoList(vcCardNo); | |
| 1019 | + if (CollectionUtils.isEmpty(models) && StringUtils.isNotEmpty(vcCardNo)) { | |
| 1020 | + if ("4".equals(HIS_VERSION)) { | |
| 1021 | + List<Map<String, Object>> hisPatient = qhdfyHisService.getPatientInfoList(vcCardNo); | |
| 1024 | 1022 | |
| 1025 | - if (CollectionUtils.isNotEmpty(hisPatient)) { | |
| 1026 | - Map<String, Object> babyHis = hisPatient.get(0); | |
| 1027 | - if (babyHis != null && babyHis.get("phone") != null && StringUtils.isNotEmpty(babyHis.get("phone").toString())) { | |
| 1028 | - babyQuery.setPhoneOrcardNo(null); //手机号码或者身份证号码 | |
| 1029 | - babyQuery.setVcCardNo(null); | |
| 1030 | - babyQuery.setMphone(babyHis.get("phone").toString()); | |
| 1031 | - models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
| 1032 | - } | |
| 1033 | - } | |
| 1034 | - } | |
| 1023 | + if (CollectionUtils.isNotEmpty(hisPatient)) { | |
| 1024 | + Map<String, Object> babyHis = hisPatient.get(0); | |
| 1025 | + if (babyHis != null && babyHis.get("phone") != null && StringUtils.isNotEmpty(babyHis.get("phone").toString())) { | |
| 1026 | + babyQuery.setPhoneOrcardNo(null); //手机号码或者身份证号码 | |
| 1027 | + babyQuery.setVcCardNo(null); | |
| 1028 | + babyQuery.setMphone(babyHis.get("phone").toString()); | |
| 1029 | + models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
| 1030 | + } | |
| 1031 | + } | |
| 1032 | + } | |
| 1035 | 1033 | } |
| 1036 | 1034 | |
| 1037 | - if (CollectionUtils.isNotEmpty(models)) | |
| 1038 | - { | |
| 1035 | + if (CollectionUtils.isNotEmpty(models)) { | |
| 1039 | 1036 | |
| 1040 | 1037 | |
| 1041 | - | |
| 1042 | 1038 | for (BabyModel model : models) { |
| 1043 | 1039 | if (model != null && model.getHospitalId() != null && hList.contains(hospitalId)) { |
| 1044 | 1040 | isBuild = true; |
| 1045 | 1041 | |
| 1046 | 1042 | |
| 1047 | 1043 | |
| 1048 | 1044 | |
| 1049 | 1045 | |
| 1050 | 1046 | |
| 1051 | 1047 | |
| ... | ... | @@ -1058,46 +1054,36 @@ |
| 1058 | 1054 | hospital = organization.getName(); |
| 1059 | 1055 | } |
| 1060 | 1056 | } |
| 1061 | - result.setHospitalName(hospital); | |
| 1057 | + result.setHospitalName(hospital); | |
| 1062 | 1058 | |
| 1063 | 1059 | List<BabyChooseResult> list = new ArrayList<>(); |
| 1064 | - if (listMap.get(model.getPid()) != null) | |
| 1065 | - { | |
| 1060 | + if (listMap.get(model.getPid()) != null) { | |
| 1066 | 1061 | list = listMap.get(model.getPid()); |
| 1067 | 1062 | list.add(result); |
| 1068 | - } | |
| 1069 | - else | |
| 1070 | - { | |
| 1063 | + } else { | |
| 1071 | 1064 | list.add(result); |
| 1072 | 1065 | } |
| 1073 | - listMap.put(model.getPid(),list); | |
| 1066 | + listMap.put(model.getPid(), list); | |
| 1074 | 1067 | |
| 1075 | 1068 | // results.add(result); |
| 1076 | 1069 | } |
| 1077 | 1070 | } |
| 1078 | 1071 | |
| 1079 | 1072 | |
| 1080 | - if (listMap != null) | |
| 1081 | - { | |
| 1082 | - for (String pid : listMap.keySet()) | |
| 1083 | - { | |
| 1073 | + if (listMap != null) { | |
| 1074 | + for (String pid : listMap.keySet()) { | |
| 1084 | 1075 | List<BabyChooseResult> currentBuildRecord = new ArrayList<>(); |
| 1085 | 1076 | |
| 1086 | 1077 | List<BabyChooseResult> list = listMap.get(pid); |
| 1087 | - for(BabyChooseResult baby : list) | |
| 1088 | - { | |
| 1089 | - if (StringUtils.isNotEmpty(hospitalId) && hospitalId.equals(baby.getHospitalId())) | |
| 1090 | - { | |
| 1078 | + for (BabyChooseResult baby : list) { | |
| 1079 | + if (StringUtils.isNotEmpty(hospitalId) && hospitalId.equals(baby.getHospitalId())) { | |
| 1091 | 1080 | currentBuildRecord.add(baby); |
| 1092 | 1081 | break; |
| 1093 | 1082 | } |
| 1094 | 1083 | } |
| 1095 | - if (CollectionUtils.isNotEmpty(currentBuildRecord)) | |
| 1096 | - { | |
| 1084 | + if (CollectionUtils.isNotEmpty(currentBuildRecord)) { | |
| 1097 | 1085 | results.addAll(currentBuildRecord); |
| 1098 | - } | |
| 1099 | - else | |
| 1100 | - { | |
| 1086 | + } else { | |
| 1101 | 1087 | results.addAll(list); |
| 1102 | 1088 | } |
| 1103 | 1089 | } |
| ... | ... | @@ -1146,7 +1132,7 @@ |
| 1146 | 1132 | result.setCouponCode(couponService.findByType(id, 8)); |
| 1147 | 1133 | /** 优惠券编号 */ |
| 1148 | 1134 | String hemoglobinCoupon = couponService.findByType(id, 10); |
| 1149 | - if(StringUtils.isNotEmpty(hemoglobinCoupon)) { | |
| 1135 | + if (StringUtils.isNotEmpty(hemoglobinCoupon)) { | |
| 1150 | 1136 | result.setHemoglobinCoupon(hemoglobinCoupon); |
| 1151 | 1137 | } |
| 1152 | 1138 | } |
| ... | ... | @@ -1508,6 +1494,7 @@ |
| 1508 | 1494 | * 身高别体重》M-2s && 年龄别身高小于M-2s |
| 1509 | 1495 | * 4.慢性严重营养不良 |
| 1510 | 1496 | * 身高别体重小于M-2s && 年龄别身高小于M-2s。 |
| 1497 | + * | |
| 1511 | 1498 | * @return |
| 1512 | 1499 | */ |
| 1513 | 1500 | public List<String> getBabyGrowthEvaluate(Double height, Integer sex, String birth, Double weight) { |
| 1514 | 1501 | |
| ... | ... | @@ -1613,18 +1600,17 @@ |
| 1613 | 1600 | date = DateUtil.parseYMD(checkDate); |
| 1614 | 1601 | } |
| 1615 | 1602 | |
| 1616 | - boolean isShowNavel = false; | |
| 1617 | - int monthes = DateUtil.getBabyAgeMonth(birthDate,date); | |
| 1618 | - if (monthes == 0 || monthes == 1 || monthes == 3) | |
| 1619 | - { | |
| 1620 | - isShowNavel = true; | |
| 1603 | + boolean isShowNavel = false; | |
| 1604 | + int monthes = DateUtil.getBabyAgeMonth(birthDate, date); | |
| 1605 | + if (monthes == 0 || monthes == 1 || monthes == 3) { | |
| 1606 | + isShowNavel = true; | |
| 1621 | 1607 | } |
| 1622 | 1608 | |
| 1623 | 1609 | String ageStr = DateUtil.getBabyMonthAge(birthDate, date); |
| 1624 | 1610 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
| 1625 | - Map<String,Object> map = new HashMap<>(); | |
| 1626 | - map.put("monthAge",ageStr); | |
| 1627 | - map.put("isShowNavel",isShowNavel); | |
| 1611 | + Map<String, Object> map = new HashMap<>(); | |
| 1612 | + map.put("monthAge", ageStr); | |
| 1613 | + map.put("isShowNavel", isShowNavel); | |
| 1628 | 1614 | objectResponse.setData(map); |
| 1629 | 1615 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1630 | 1616 | objectResponse.setErrormsg("成功"); |
| ... | ... | @@ -1676,7 +1662,7 @@ |
| 1676 | 1662 | |
| 1677 | 1663 | public BaseResponse getBabyCurve(String babyId, Integer id) { |
| 1678 | 1664 | |
| 1679 | - Map<String,Object> map = new HashMap<>(); | |
| 1665 | + Map<String, Object> map = new HashMap<>(); | |
| 1680 | 1666 | |
| 1681 | 1667 | List<Integer> weightTitles = new LinkedList<>(); |
| 1682 | 1668 | List<String> weightValues = new LinkedList<>(); |
| 1683 | 1669 | |
| 1684 | 1670 | |
| 1685 | 1671 | |
| 1686 | 1672 | |
| 1687 | 1673 | |
| 1688 | 1674 | |
| 1689 | 1675 | |
| 1690 | 1676 | |
| 1691 | 1677 | |
| 1692 | 1678 | |
| ... | ... | @@ -1684,63 +1670,63 @@ |
| 1684 | 1670 | List<Integer> heightTitles = new LinkedList<>(); |
| 1685 | 1671 | List<String> heightValues = new LinkedList<>(); |
| 1686 | 1672 | |
| 1687 | - List<Map<String,Object>> tables = new LinkedList<>(); | |
| 1673 | + List<Map<String, Object>> tables = new LinkedList<>(); | |
| 1688 | 1674 | |
| 1689 | 1675 | BabyModel babyModel = babyService.getOneBabyById(babyId); |
| 1690 | 1676 | |
| 1677 | + BabyModelQuery babyQuery = new BabyModelQuery(); | |
| 1678 | + babyQuery.setYn(YnEnums.YES.getId()); | |
| 1679 | + | |
| 1680 | + //查询建档记录 得到pid 通过pid查询所有的儿童建档记录 | |
| 1681 | + babyQuery.setPid(babyModel.getPid()); | |
| 1682 | + //查询建档记录 | |
| 1683 | + List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
| 1684 | + String[] buildIds = new String[models.size()]; | |
| 1685 | + for (int i = 0; i < models.size(); i++) { | |
| 1686 | + buildIds[i] = models.get(i).getId(); | |
| 1687 | + } | |
| 1688 | + | |
| 1691 | 1689 | BabyCheckModelQuery query = new BabyCheckModelQuery(); |
| 1692 | 1690 | query.setYn(YnEnums.YES.getId()); |
| 1693 | - query.setBuildId(babyId); | |
| 1691 | + query.setBuildIds(buildIds); | |
| 1694 | 1692 | //查询儿童的检查记录 |
| 1695 | - List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query, "checkDate,created", Sort.Direction.ASC); | |
| 1693 | + List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query, "checkDate,created", Sort.Direction.ASC); | |
| 1696 | 1694 | |
| 1697 | - if (CollectionUtils.isNotEmpty(checkModels)) | |
| 1698 | - { | |
| 1699 | - for (BabyCheckModel checkModel : checkModels) | |
| 1700 | - { | |
| 1701 | - if (checkModel != null) | |
| 1702 | - { | |
| 1703 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getHeight()) || org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getWeight())) | |
| 1704 | - { | |
| 1705 | - int month = DateUtil.getBabyAgeMonth(babyModel.getBirth(),checkModel.getCheckDate()); | |
| 1706 | - Map<String,Object> heightMap = new HashMap<>(); | |
| 1707 | - heightMap.put("time",month); | |
| 1708 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getHeight())) | |
| 1709 | - { | |
| 1710 | - if (org.apache.commons.lang.StringUtils.isNumeric(checkModel.getHeight()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(checkModel.getHeight()).matches()) | |
| 1711 | - { | |
| 1712 | - if(heightTitles.contains(month)){ | |
| 1695 | + if (CollectionUtils.isNotEmpty(checkModels)) { | |
| 1696 | + for (BabyCheckModel checkModel : checkModels) { | |
| 1697 | + if (checkModel != null) { | |
| 1698 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getHeight()) || org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getWeight())) { | |
| 1699 | + int month = DateUtil.getBabyAgeMonth(babyModel.getBirth(), checkModel.getCheckDate()); | |
| 1700 | + Map<String, Object> heightMap = new HashMap<>(); | |
| 1701 | + heightMap.put("time", month); | |
| 1702 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getHeight())) { | |
| 1703 | + if (org.apache.commons.lang.StringUtils.isNumeric(checkModel.getHeight()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(checkModel.getHeight()).matches()) { | |
| 1704 | + if (heightTitles.contains(month)) { | |
| 1713 | 1705 | int index = heightTitles.indexOf(month); |
| 1714 | - heightValues.set(index,checkModel.getHeight()); | |
| 1715 | - }else { | |
| 1706 | + heightValues.set(index, checkModel.getHeight()); | |
| 1707 | + } else { | |
| 1716 | 1708 | heightTitles.add(month); |
| 1717 | 1709 | heightValues.add(checkModel.getHeight()); |
| 1718 | 1710 | } |
| 1719 | 1711 | } |
| 1720 | 1712 | heightMap.put("height", checkModel.getHeight()); |
| 1721 | - } | |
| 1722 | - else | |
| 1723 | - { | |
| 1713 | + } else { | |
| 1724 | 1714 | heightMap.put("height", "--"); |
| 1725 | 1715 | } |
| 1726 | 1716 | |
| 1727 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getWeight())) | |
| 1728 | - { | |
| 1729 | - if (org.apache.commons.lang.StringUtils.isNumeric(checkModel.getWeight()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(checkModel.getWeight()).matches()) | |
| 1730 | - { | |
| 1717 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(checkModel.getWeight())) { | |
| 1718 | + if (org.apache.commons.lang.StringUtils.isNumeric(checkModel.getWeight()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(checkModel.getWeight()).matches()) { | |
| 1731 | 1719 | |
| 1732 | - if(weightTitles.contains(month)){//如果存在月的数据则更新对应索引的值 | |
| 1720 | + if (weightTitles.contains(month)) {//如果存在月的数据则更新对应索引的值 | |
| 1733 | 1721 | int index = weightTitles.indexOf(month); |
| 1734 | - weightValues.set(index,checkModel.getWeight()); | |
| 1735 | - }else { | |
| 1722 | + weightValues.set(index, checkModel.getWeight()); | |
| 1723 | + } else { | |
| 1736 | 1724 | weightTitles.add(month); |
| 1737 | 1725 | weightValues.add(checkModel.getWeight()); |
| 1738 | 1726 | } |
| 1739 | 1727 | } |
| 1740 | - heightMap.put("weight",checkModel.getWeight()); | |
| 1741 | - } | |
| 1742 | - else | |
| 1743 | - { | |
| 1728 | + heightMap.put("weight", checkModel.getWeight()); | |
| 1729 | + } else { | |
| 1744 | 1730 | heightMap.put("weight", "--"); |
| 1745 | 1731 | } |
| 1746 | 1732 | tables.add(heightMap); |
| 1747 | 1733 | |
| 1748 | 1734 | |
| ... | ... | @@ -1748,15 +1734,15 @@ |
| 1748 | 1734 | } |
| 1749 | 1735 | } |
| 1750 | 1736 | } |
| 1751 | - map.put("weightTitles",weightTitles); | |
| 1752 | - map.put("weightValues",weightValues); | |
| 1737 | + map.put("weightTitles", weightTitles); | |
| 1738 | + map.put("weightValues", weightValues); | |
| 1753 | 1739 | |
| 1754 | - map.put("heightTitles",heightTitles); | |
| 1755 | - map.put("heightValues",heightValues); | |
| 1740 | + map.put("heightTitles", heightTitles); | |
| 1741 | + map.put("heightValues", heightValues); | |
| 1756 | 1742 | |
| 1757 | - map.put("tables",tables); | |
| 1758 | - if(babyModel!=null){ | |
| 1759 | - map.put("sex",babyModel.getSex()); | |
| 1743 | + map.put("tables", tables); | |
| 1744 | + if (babyModel != null) { | |
| 1745 | + map.put("sex", babyModel.getSex()); | |
| 1760 | 1746 | } |
| 1761 | 1747 | return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 1762 | 1748 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
6eb532c
| ... | ... | @@ -3280,7 +3280,7 @@ |
| 3280 | 3280 | model.setTcType(checkModel.getTcType()); |
| 3281 | 3281 | model.setBabyName(babyModel.getName()); |
| 3282 | 3282 | model.setBabyBirthday(DateUtil.getyyyy_MM_dd(babyModel.getBirth())); |
| 3283 | - model.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); | |
| 3283 | + model.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), checkModel.getCheckDate())); | |
| 3284 | 3284 | model.setMommyPhone(babyModel.getMphone()); |
| 3285 | 3285 | model.setMommyName(babyModel.getMname()); |
| 3286 | 3286 | model.setRemark(babyModel.getMremark()); |