Commit 8a34eccd89c28497cb02fda730f2d337e6dca274
1 parent
525114967d
Exists in
master
and in
1 other branch
处方报表
Showing 8 changed files with 189 additions and 7 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyCheckModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/CheckItemOrder.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CheckItemManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.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/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyCheckRequest.java
platform-dal/src/main/java/com/lyms/platform/pojo/BabyCheckModel.java
View file @
8a34ecc
| ... | ... | @@ -499,6 +499,19 @@ |
| 499 | 499 | //精细运动 |
| 500 | 500 | private String fineExercise ; |
| 501 | 501 | |
| 502 | + /** | |
| 503 | + * 儿童检项 | |
| 504 | + */ | |
| 505 | + private String configItemId; | |
| 506 | + | |
| 507 | + public String getConfigItemId() { | |
| 508 | + return configItemId; | |
| 509 | + } | |
| 510 | + | |
| 511 | + public void setConfigItemId(String configItemId) { | |
| 512 | + this.configItemId = configItemId; | |
| 513 | + } | |
| 514 | + | |
| 502 | 515 | public String getOtherDiagnose() { |
| 503 | 516 | return otherDiagnose; |
| 504 | 517 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/CheckItemOrder.java
View file @
8a34ecc
| ... | ... | @@ -22,6 +22,15 @@ |
| 22 | 22 | private String hospitalId; |
| 23 | 23 | private Date created; |
| 24 | 24 | private String checkId; |
| 25 | + private Integer type;// 1孕妇 2儿童 | |
| 26 | + | |
| 27 | + public Integer getType() { | |
| 28 | + return type; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setType(Integer type) { | |
| 32 | + this.type = type; | |
| 33 | + } | |
| 25 | 34 | |
| 26 | 35 | public String getCheckId() { |
| 27 | 36 | return checkId; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
8a34ecc
| ... | ... | @@ -131,7 +131,7 @@ |
| 131 | 131 | @RequestParam(required = false) String sINCard, |
| 132 | 132 | String coupon, @RequestParam(required = false) String ynStatus) { |
| 133 | 133 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 134 | - return babyCheckFacade.queryChooseBabys(vcCardNo, cardNo,encoded,sINCard, loginState.getId(), coupon, ynStatus); | |
| 134 | + return babyCheckFacade.queryChooseBabys(vcCardNo, cardNo, encoded, sINCard, loginState.getId(), coupon, ynStatus); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| ... | ... | @@ -485,6 +485,34 @@ |
| 485 | 485 | @ResponseBody |
| 486 | 486 | public BaseResponse saveBuildByUpload(@RequestBody BabyBuildInfoParam param) { |
| 487 | 487 | return babyCheckFacade.saveBuildByUpload(param); |
| 488 | + } | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + /** | |
| 493 | + *处方计划报表 | |
| 494 | + * @param orderTime 预约时间 | |
| 495 | + * @param request | |
| 496 | + * @return | |
| 497 | + */ | |
| 498 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyPlanReport") | |
| 499 | + @ResponseBody | |
| 500 | + @TokenRequired | |
| 501 | + public BaseResponse getBabyPlanReport(@RequestParam String orderTime, HttpServletRequest request) { | |
| 502 | + return babyCheckFacade.getBabyPlanReport(orderTime, getUserId(request)); | |
| 503 | + } | |
| 504 | + | |
| 505 | + /** | |
| 506 | + * 处方实际报表 | |
| 507 | + * @param checkTime 产检时间 | |
| 508 | + * @param request | |
| 509 | + * @return | |
| 510 | + */ | |
| 511 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyActualReport") | |
| 512 | + @ResponseBody | |
| 513 | + @TokenRequired | |
| 514 | + public BaseResponse getBabyActualReport(@RequestParam String checkTime, HttpServletRequest request) { | |
| 515 | + return babyCheckFacade.getBabyActualReport(checkTime, getUserId(request)); | |
| 488 | 516 | } |
| 489 | 517 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CheckItemManageController.java
View file @
8a34ecc
| ... | ... | @@ -126,6 +126,7 @@ |
| 126 | 126 | boolean end = true; |
| 127 | 127 | CheckItemManageQuery checkItemManageQuery = new CheckItemManageQuery(); |
| 128 | 128 | checkItemManageQuery.setAffiliateId(affiliateId); |
| 129 | + checkItemManageQuery.setType(type); | |
| 129 | 130 | List<CheckItemManage> list = checkItemManageService.getCheckItemManage(affiliateId); |
| 130 | 131 | if (CollectionUtils.isNotEmpty(list)) { |
| 131 | 132 | for (CheckItemManage checkItemManage : list) { |
| ... | ... | @@ -153,7 +154,7 @@ |
| 153 | 154 | checkItemManageService.addCheckItem(checkItemManage); |
| 154 | 155 | ResultUtils.buildSuccessResultAndWrite(response); |
| 155 | 156 | } else { |
| 156 | - ResultUtils.buildParameterErrorResultAndWrite(response, "此范围以填写!"); | |
| 157 | + ResultUtils.buildParameterErrorResultAndWrite(response, "此范围已填写!"); | |
| 157 | 158 | } |
| 158 | 159 | } |
| 159 | 160 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
8a34ecc
| ... | ... | @@ -1957,7 +1957,7 @@ |
| 1957 | 1957 | String[] arrs = orderTime.split(" - "); |
| 1958 | 1958 | Date start = DateUtil.parseYMD(arrs[0]); |
| 1959 | 1959 | Date end = DateUtil.parseYMD(arrs[1]); |
| 1960 | - long count = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("nextCheckTime").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), CheckItemOrder.class); | |
| 1960 | + long count = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(2).and("nextCheckTime").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), CheckItemOrder.class); | |
| 1961 | 1961 | data.put("allCount", String.valueOf(count)); |
| 1962 | 1962 | |
| 1963 | 1963 | Map param = new HashMap(); |
| ... | ... | @@ -1967,7 +1967,7 @@ |
| 1967 | 1967 | if (CollectionUtils.isNotEmpty(checkItems)) { |
| 1968 | 1968 | List<Map> list = new ArrayList<>(); |
| 1969 | 1969 | for (CheckItem item : checkItems) { |
| 1970 | - long itemCount = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("nextCheckTime") | |
| 1970 | + long itemCount = mongoTemplate.count(Query.query(Criteria.where("hospitalId").and("type").is(2).is(hospitalId).and("nextCheckTime") | |
| 1971 | 1971 | .gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end)).and("itemId").is(item.getId())), CheckItemOrder.class); |
| 1972 | 1972 | if (itemCount == 0) |
| 1973 | 1973 | { |
| ... | ... | @@ -1992,7 +1992,7 @@ |
| 1992 | 1992 | String[] arrs = checkTime.split(" - "); |
| 1993 | 1993 | Date start = DateUtil.parseYMD(arrs[0]); |
| 1994 | 1994 | Date end = DateUtil.parseYMD(arrs[1]); |
| 1995 | - long count = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("nextCheckTime").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), CheckItemOrder.class); | |
| 1995 | + long count = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(2).and("nextCheckTime").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), CheckItemOrder.class); | |
| 1996 | 1996 | data.put("allCount", String.valueOf(count)); |
| 1997 | 1997 | |
| 1998 | 1998 | Map param = new HashMap(); |
| ... | ... | @@ -2002,7 +2002,7 @@ |
| 2002 | 2002 | if (CollectionUtils.isNotEmpty(checkItems)) { |
| 2003 | 2003 | List<Map> list = new ArrayList<>(); |
| 2004 | 2004 | for (CheckItem item : checkItems) { |
| 2005 | - long itemCount = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("nextCheckTime") | |
| 2005 | + long itemCount = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(2).and("nextCheckTime") | |
| 2006 | 2006 | .gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end)).and("itemId").is(item.getId())), CheckItemOrder.class); |
| 2007 | 2007 | if (itemCount == 0) |
| 2008 | 2008 | { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
8a34ecc
| ... | ... | @@ -1408,11 +1408,13 @@ |
| 1408 | 1408 | } |
| 1409 | 1409 | |
| 1410 | 1410 | public void saveCheckItem(Date nextCheckTime, Patients patients,String checkItems,String checkId,String hospitalId) { |
| 1411 | + mongoTemplate.remove(Query.query(Criteria.where("checkId").is(checkId)), CheckItemOrder.class); | |
| 1411 | 1412 | if (StringUtils.isNotEmpty(checkItems)) { |
| 1412 | 1413 | String[] arrs = checkItems.split(","); |
| 1413 | 1414 | for (String id : arrs) |
| 1414 | 1415 | { |
| 1415 | 1416 | CheckItemOrder order = new CheckItemOrder(); |
| 1417 | + order.setType(1); | |
| 1416 | 1418 | order.setCreated(new Date()); |
| 1417 | 1419 | order.setHospitalId(hospitalId); |
| 1418 | 1420 | order.setNextCheckTime(nextCheckTime); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
8a34ecc
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | import com.lyms.platform.common.enums.*; |
| 11 | 11 | import com.lyms.platform.common.result.*; |
| 12 | 12 | import com.lyms.platform.common.utils.*; |
| 13 | +import com.lyms.platform.common.utils.StringUtils; | |
| 13 | 14 | import com.lyms.platform.operate.web.request.*; |
| 14 | 15 | import com.lyms.platform.operate.web.result.*; |
| 15 | 16 | import com.lyms.platform.operate.web.service.BabyAfterVisitService; |
| ... | ... | @@ -18,6 +19,7 @@ |
| 18 | 19 | import com.lyms.platform.operate.web.utils.MongoUtil; |
| 19 | 20 | import com.lyms.platform.operate.web.utils.ReflectUtil; |
| 20 | 21 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 22 | +import com.lyms.platform.permission.model.CheckItem; | |
| 21 | 23 | import com.lyms.platform.permission.model.Organization; |
| 22 | 24 | import com.lyms.platform.permission.model.PatientService; |
| 23 | 25 | import com.lyms.platform.permission.model.Users; |
| ... | ... | @@ -25,6 +27,7 @@ |
| 25 | 27 | import com.lyms.platform.pojo.*; |
| 26 | 28 | import com.lyms.platform.query.*; |
| 27 | 29 | import org.apache.commons.collections.CollectionUtils; |
| 30 | +import org.apache.commons.lang.*; | |
| 28 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
| 29 | 32 | import org.springframework.data.domain.Sort; |
| 30 | 33 | import org.springframework.data.mongodb.core.MongoTemplate; |
| ... | ... | @@ -113,6 +116,10 @@ |
| 113 | 116 | @Autowired |
| 114 | 117 | private BabyAfterVisitService babyAfterVisitService; |
| 115 | 118 | |
| 119 | + | |
| 120 | + @Autowired | |
| 121 | + private CheckItemService checkItemService; | |
| 122 | + | |
| 116 | 123 | public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); |
| 117 | 124 | /** |
| 118 | 125 | * 更新检查 |
| ... | ... | @@ -132,6 +139,12 @@ |
| 132 | 139 | List<BabyCheckModel> models = babyCheckService.queryBabyCheckRecord(query); |
| 133 | 140 | babyCheckService.updateBabyCheck(model, request.getId()); |
| 134 | 141 | |
| 142 | + | |
| 143 | + if (StringUtils.isNotEmpty(request.getNextDate())) | |
| 144 | + { | |
| 145 | + saveCheckItem(model.getNextDate(), request.getBuildId(),request.getConfigItemId(),model.getId(),hospitalId); | |
| 146 | + } | |
| 147 | + | |
| 135 | 148 | if (CollectionUtils.isNotEmpty(models)) { |
| 136 | 149 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), models.get(0), model, OptActionEnums.UPDATE.getId(), "修改儿童检查"); |
| 137 | 150 | } |
| 138 | 151 | |
| ... | ... | @@ -494,8 +507,8 @@ |
| 494 | 507 | model.setAlotExercise(request.getAlotExercise()); |
| 495 | 508 | model.setFineExercise(request.getFineExercise()); |
| 496 | 509 | |
| 510 | + model.setConfigItemId(request.getConfigItemId()); | |
| 497 | 511 | |
| 498 | - | |
| 499 | 512 | return model; |
| 500 | 513 | } |
| 501 | 514 | |
| ... | ... | @@ -597,6 +610,13 @@ |
| 597 | 610 | model.setCreated(new Date()); |
| 598 | 611 | model = babyCheckService.addBabyCheck(model); |
| 599 | 612 | |
| 613 | + if (StringUtils.isNotEmpty(request.getNextDate())) | |
| 614 | + { | |
| 615 | + saveCheckItem(model.getNextDate(), request.getBuildId(),request.getConfigItemId(),model.getId(),hospitalId); | |
| 616 | + } | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 600 | 620 | // 添加追访记录 |
| 601 | 621 | Date nextDate = bm.getNextDate(); |
| 602 | 622 | if (nextDate != null) { |
| ... | ... | @@ -709,6 +729,28 @@ |
| 709 | 729 | } |
| 710 | 730 | |
| 711 | 731 | |
| 732 | + | |
| 733 | + | |
| 734 | + public void saveCheckItem(Date nextCheckTime, String buildId,String checkItems,String checkId,String hospitalId) { | |
| 735 | + mongoTemplate.remove(Query.query(Criteria.where("checkId").is(checkId)), CheckItemOrder.class); | |
| 736 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(checkItems)) { | |
| 737 | + String[] arrs = checkItems.split(","); | |
| 738 | + for (String id : arrs) | |
| 739 | + { | |
| 740 | + CheckItemOrder order = new CheckItemOrder(); | |
| 741 | + order.setType(2); | |
| 742 | + order.setCreated(new Date()); | |
| 743 | + order.setHospitalId(hospitalId); | |
| 744 | + order.setNextCheckTime(nextCheckTime); | |
| 745 | + order.setItemId(id); | |
| 746 | + order.setCheckId(checkId); | |
| 747 | + order.setPatientId(buildId); | |
| 748 | + mongoTemplate.save(order); | |
| 749 | + } | |
| 750 | + | |
| 751 | + } | |
| 752 | + } | |
| 753 | + | |
| 712 | 754 | public void updateLastGrowth(BabyCheckModel model) { |
| 713 | 755 | babyBookbuildingService.updateBabyLastGrowth(model); |
| 714 | 756 | } |
| ... | ... | @@ -3208,6 +3250,77 @@ |
| 3208 | 3250 | mongoTemplate.insert(m); |
| 3209 | 3251 | } |
| 3210 | 3252 | return new BaseResponse(); |
| 3253 | + } | |
| 3254 | + | |
| 3255 | + public BaseResponse getBabyPlanReport(String orderTime, Integer userId) { | |
| 3256 | + | |
| 3257 | + Map<String, Object> data = new HashMap<>(); | |
| 3258 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 3259 | + if (orderTime != null) { | |
| 3260 | + String[] arrs = orderTime.split(" - "); | |
| 3261 | + Date start = DateUtil.parseYMD(arrs[0]); | |
| 3262 | + Date end = DateUtil.parseYMD(arrs[1]); | |
| 3263 | + long count = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(1).and("nextCheckTime").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), CheckItemOrder.class); | |
| 3264 | + data.put("allCount", String.valueOf(count)); | |
| 3265 | + | |
| 3266 | + Map param = new HashMap(); | |
| 3267 | + param.put("type",null); | |
| 3268 | + param.put("hospitalId",hospitalId); | |
| 3269 | + List<CheckItem> checkItems = checkItemService.getCheckItemList(param); | |
| 3270 | + if (CollectionUtils.isNotEmpty(checkItems)) { | |
| 3271 | + List<Map> list = new ArrayList<>(); | |
| 3272 | + for (CheckItem item : checkItems) { | |
| 3273 | + long itemCount = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(1).and("nextCheckTime") | |
| 3274 | + .gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end)).and("itemId").is(item.getId())), CheckItemOrder.class); | |
| 3275 | + if (itemCount == 0) | |
| 3276 | + { | |
| 3277 | + continue; | |
| 3278 | + } | |
| 3279 | + Map<String, String> map = new HashMap<>(); | |
| 3280 | + map.put("itemName", item.getProject()); | |
| 3281 | + map.put("itemCount", String.valueOf(itemCount)); | |
| 3282 | + list.add(map); | |
| 3283 | + } | |
| 3284 | + data.put("itemList", list); | |
| 3285 | + } | |
| 3286 | + } | |
| 3287 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setErrormsg("成功"); | |
| 3288 | + } | |
| 3289 | + | |
| 3290 | + public BaseResponse getBabyActualReport(String checkTime, Integer userId) { | |
| 3291 | + | |
| 3292 | + Map<String, Object> data = new HashMap<>(); | |
| 3293 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 3294 | + if (checkTime != null) { | |
| 3295 | + String[] arrs = checkTime.split(" - "); | |
| 3296 | + Date start = DateUtil.parseYMD(arrs[0]); | |
| 3297 | + Date end = DateUtil.parseYMD(arrs[1]); | |
| 3298 | + long count = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(1).and("nextCheckTime").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), CheckItemOrder.class); | |
| 3299 | + data.put("allCount", String.valueOf(count)); | |
| 3300 | + | |
| 3301 | + Map param = new HashMap(); | |
| 3302 | + param.put("type",null); | |
| 3303 | + param.put("hospitalId",hospitalId); | |
| 3304 | + List<CheckItem> checkItems = checkItemService.getCheckItemList(param); | |
| 3305 | + if (CollectionUtils.isNotEmpty(checkItems)) { | |
| 3306 | + List<Map> list = new ArrayList<>(); | |
| 3307 | + for (CheckItem item : checkItems) { | |
| 3308 | + long itemCount = mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospitalId).and("type").is(1).and("nextCheckTime") | |
| 3309 | + .gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end)).and("itemId").is(item.getId())), CheckItemOrder.class); | |
| 3310 | + if (itemCount == 0) | |
| 3311 | + { | |
| 3312 | + continue; | |
| 3313 | + } | |
| 3314 | + Map<String, String> map = new HashMap<>(); | |
| 3315 | + map.put("itemName", item.getProject()); | |
| 3316 | + map.put("itemCount", String.valueOf(itemCount)); | |
| 3317 | + map.put("actualCount", "0"); | |
| 3318 | + list.add(map); | |
| 3319 | + } | |
| 3320 | + data.put("itemList", list); | |
| 3321 | + } | |
| 3322 | + } | |
| 3323 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setErrormsg("成功"); | |
| 3211 | 3324 | } |
| 3212 | 3325 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyCheckRequest.java
View file @
8a34ecc
| ... | ... | @@ -459,6 +459,22 @@ |
| 459 | 459 | private String socialContactIA; |
| 460 | 460 | private String socialContactDQ; |
| 461 | 461 | |
| 462 | + | |
| 463 | + | |
| 464 | + /** | |
| 465 | + * 儿童检项 | |
| 466 | + */ | |
| 467 | + private String configItemId; | |
| 468 | + | |
| 469 | + | |
| 470 | + public String getConfigItemId() { | |
| 471 | + return configItemId; | |
| 472 | + } | |
| 473 | + | |
| 474 | + public void setConfigItemId(String configItemId) { | |
| 475 | + this.configItemId = configItemId; | |
| 476 | + } | |
| 477 | + | |
| 462 | 478 | public String getHeightEvaluateStandard() { |
| 463 | 479 | return heightEvaluateStandard; |
| 464 | 480 | } |