Commit 1913631b60206b49072f9c666762b4d7691d49a7
1 parent
3935da59a8
Exists in
master
and in
6 other branches
微量元素
Showing 9 changed files with 308 additions and 86 deletions
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BoneModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ResidentsArchiveModel.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BoneController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BoneFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
1913631
| ... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 | private static Lock lock = new ReentrantLock(); |
| 13 | 13 | public static SimpleDateFormat dd = new SimpleDateFormat("dd"); |
| 14 | 14 | public static SimpleDateFormat yyyy = new SimpleDateFormat("yyyy"); |
| 15 | + public static SimpleDateFormat yyyyMM = new SimpleDateFormat("yyyyMM"); | |
| 15 | 16 | public static SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd"); |
| 16 | 17 | public static SimpleDateFormat y_m_d = new SimpleDateFormat("yyyy-MM-dd"); |
| 17 | 18 | public static SimpleDateFormat y_m = new SimpleDateFormat("yyyy年MM月"); |
| ... | ... | @@ -537,6 +538,16 @@ |
| 537 | 538 | } |
| 538 | 539 | try { |
| 539 | 540 | return y_m.format(d); |
| 541 | + } catch (Exception e) { | |
| 542 | + return null; | |
| 543 | + } | |
| 544 | + } | |
| 545 | + public static String getYyyyMM(Date d) { | |
| 546 | + if (d == null) { | |
| 547 | + return null; | |
| 548 | + } | |
| 549 | + try { | |
| 550 | + return yyyyMM.format(d); | |
| 540 | 551 | } catch (Exception e) { |
| 541 | 552 | return null; |
| 542 | 553 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/BoneModel.java
View file @
1913631
| ... | ... | @@ -58,12 +58,21 @@ |
| 58 | 58 | //骨生理年龄 |
| 59 | 59 | private Double age; |
| 60 | 60 | |
| 61 | - | |
| 62 | 61 | //0 孕前 1 儿童 |
| 63 | 62 | private Integer type; |
| 64 | 63 | |
| 64 | + //0正常 1骨质减少 2 骨质疏松 | |
| 65 | + private Integer result; | |
| 65 | 66 | |
| 66 | 67 | private String cardNo; |
| 68 | + | |
| 69 | + public Integer getResult() { | |
| 70 | + return result; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setResult(Integer result) { | |
| 74 | + this.result = result; | |
| 75 | + } | |
| 67 | 76 | |
| 68 | 77 | public String getId() { |
| 69 | 78 | return id; |
platform-dal/src/main/java/com/lyms/platform/pojo/ResidentsArchiveModel.java
View file @
1913631
| ... | ... | @@ -188,6 +188,16 @@ |
| 188 | 188 | private String trackHospitalId; |
| 189 | 189 | |
| 190 | 190 | |
| 191 | + private Long code; | |
| 192 | + | |
| 193 | + public Long getCode() { | |
| 194 | + return code; | |
| 195 | + } | |
| 196 | + | |
| 197 | + public void setCode(Long code) { | |
| 198 | + this.code = code; | |
| 199 | + } | |
| 200 | + | |
| 191 | 201 | public String getTrackHospitalId() { |
| 192 | 202 | return trackHospitalId; |
| 193 | 203 | } |
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
1913631
| ... | ... | @@ -106,6 +106,7 @@ |
| 106 | 106 | |
| 107 | 107 | //母亲证件号 |
| 108 | 108 | private String mcertNo; |
| 109 | + private String mcertNoEnd; | |
| 109 | 110 | |
| 110 | 111 | //就诊卡号 |
| 111 | 112 | private String vcCardNo; |
| ... | ... | @@ -967,6 +968,9 @@ |
| 967 | 968 | } |
| 968 | 969 | if (!StringUtils.isEmpty(mcertNo)) { |
| 969 | 970 | condition = condition.and("mcertNo", mcertNo, MongoOper.IS); |
| 971 | + } | |
| 972 | + if (!StringUtils.isEmpty(mcertNoEnd)) { | |
| 973 | + condition = condition.and("mcertNo", "^"+mcertNoEnd, MongoOper.LIKE); | |
| 970 | 974 | } |
| 971 | 975 | if (!StringUtils.isEmpty(cardNo)) { |
| 972 | 976 | condition = condition.and("cardNo", cardNo, MongoOper.IS); |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
1913631
| ... | ... | @@ -183,6 +183,7 @@ |
| 183 | 183 | * 身份证号码 |
| 184 | 184 | */ |
| 185 | 185 | private String cardNo; |
| 186 | + private String cardNoEnd; | |
| 186 | 187 | |
| 187 | 188 | |
| 188 | 189 | private Date birth; |
| ... | ... | @@ -370,6 +371,14 @@ |
| 370 | 371 | |
| 371 | 372 | private String trackHospitalId; |
| 372 | 373 | |
| 374 | + public String getCardNoEnd() { | |
| 375 | + return cardNoEnd; | |
| 376 | + } | |
| 377 | + | |
| 378 | + public void setCardNoEnd(String cardNoEnd) { | |
| 379 | + this.cardNoEnd = cardNoEnd; | |
| 380 | + } | |
| 381 | + | |
| 373 | 382 | public String getTrackHospitalId() { |
| 374 | 383 | return trackHospitalId; |
| 375 | 384 | } |
| ... | ... | @@ -669,6 +678,10 @@ |
| 669 | 678 | } |
| 670 | 679 | if (StringUtils.isNotEmpty(cardNo)) { |
| 671 | 680 | condition = condition.and("cardNo", cardNo, MongoOper.IS); |
| 681 | + | |
| 682 | + } | |
| 683 | + if (StringUtils.isNotEmpty(cardNoEnd)) { | |
| 684 | + condition = condition.and("cardNo", "^" + cardNoEnd, MongoOper.LIKE); | |
| 672 | 685 | |
| 673 | 686 | } |
| 674 | 687 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BoneController.java
View file @
1913631
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | /** |
| 29 | 29 | * 添加骨密度 |
| 30 | 30 | * @param request |
| 31 | - * @param BoneModel | |
| 31 | + * @param BoneModel type 0孕妇 1儿童 | |
| 32 | 32 | * @return |
| 33 | 33 | */ |
| 34 | 34 | @ResponseBody |
| ... | ... | @@ -43,7 +43,7 @@ |
| 43 | 43 | * 骨密度报告 |
| 44 | 44 | * @param request |
| 45 | 45 | * @param httpServletResponse |
| 46 | - * @param type | |
| 46 | + * @param type 0孕妇 1儿童 | |
| 47 | 47 | * @param id |
| 48 | 48 | * @return |
| 49 | 49 | */ |
| ... | ... | @@ -62,6 +62,7 @@ |
| 62 | 62 | /** |
| 63 | 63 | * 骨密度测量列表 |
| 64 | 64 | * @param request |
| 65 | + * @param type 0孕妇 1儿童 | |
| 65 | 66 | * @return |
| 66 | 67 | */ |
| 67 | 68 | @TokenRequired |
| 68 | 69 | |
| ... | ... | @@ -69,15 +70,15 @@ |
| 69 | 70 | @RequestMapping(value = "/queryBoneList", method = RequestMethod.GET) |
| 70 | 71 | public BaseResponse queryAmniocentesisList(HttpServletRequest request, |
| 71 | 72 | @RequestParam(required = false) String queryNo, |
| 72 | - @RequestParam(required = false) Integer weekStart, | |
| 73 | - @RequestParam(required = false) Integer weekEnd, | |
| 73 | + @RequestParam(required = false) Integer start, | |
| 74 | + @RequestParam(required = false) Integer end, | |
| 74 | 75 | @RequestParam(required = false) Integer age, |
| 75 | 76 | @RequestParam(required = false) Integer type, |
| 76 | 77 | @RequestParam(required = true) Integer page, |
| 77 | 78 | @RequestParam(required = true) Integer limit, |
| 78 | 79 | @RequestParam(required = false) String vcCardNo) { |
| 79 | 80 | |
| 80 | - return BoneFacade.queryBoneList(queryNo, weekStart, weekEnd, age, vcCardNo, type, page, limit, getUserId(request)); | |
| 81 | + return BoneFacade.queryBoneList(queryNo, start, end, age, vcCardNo, type, page, limit, getUserId(request)); | |
| 81 | 82 | |
| 82 | 83 | } |
| 83 | 84 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BoneFacade.java
View file @
1913631
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.lyms.platform.biz.service.BabyBookbuildingService; | |
| 4 | 5 | import com.lyms.platform.biz.service.BasicConfigService; |
| 5 | 6 | import com.lyms.platform.biz.service.BoneService; |
| 6 | 7 | import com.lyms.platform.biz.service.PatientsService; |
| 7 | 8 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 8 | 9 | import com.lyms.platform.common.dao.BaseQuery; |
| 10 | +import com.lyms.platform.common.enums.SexEnum; | |
| 9 | 11 | import com.lyms.platform.common.enums.YnEnums; |
| 10 | 12 | import com.lyms.platform.common.result.BaseListResponse; |
| 11 | 13 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 12 | 14 | import com.lyms.platform.common.result.BaseResponse; |
| 13 | 15 | import com.lyms.platform.common.utils.DateUtil; |
| 14 | 16 | import com.lyms.platform.operate.web.utils.FunvCommonUtil; |
| 17 | +import com.lyms.platform.pojo.BabyModel; | |
| 15 | 18 | import com.lyms.platform.pojo.BoneModel; |
| 19 | +import com.lyms.platform.pojo.MicroelementModel; | |
| 16 | 20 | import com.lyms.platform.pojo.Patients; |
| 21 | +import com.lyms.platform.query.BabyModelQuery; | |
| 17 | 22 | import com.lyms.platform.query.BoneQuery; |
| 18 | 23 | import com.lyms.platform.query.PatientsQuery; |
| 19 | 24 | import org.apache.commons.collections.CollectionUtils; |
| 20 | 25 | |
| 21 | 26 | |
| 22 | 27 | |
| 23 | 28 | |
| 24 | 29 | |
| 25 | 30 | |
| 26 | 31 | |
| 27 | 32 | |
| 28 | 33 | |
| 29 | 34 | |
| 30 | 35 | |
| 31 | 36 | |
| 32 | 37 | |
| ... | ... | @@ -47,77 +52,141 @@ |
| 47 | 52 | private PatientsService patientsService; |
| 48 | 53 | |
| 49 | 54 | @Autowired |
| 50 | - private MongoTemplate mongoTemplate; | |
| 55 | + private BabyBookbuildingService babyBookbuildingService; | |
| 51 | 56 | |
| 52 | - public BaseResponse queryBoneList(String queryNo, Integer weekStart, Integer weekEnd, Integer age, String vcCardNo,Integer type ,Integer page, Integer limit, Integer userId) { | |
| 57 | + public BaseResponse queryBoneList(String queryNo, Integer start, Integer end, Integer age, String vcCardNo,Integer type ,Integer page, Integer limit, Integer userId) { | |
| 53 | 58 | |
| 54 | 59 | |
| 55 | 60 | List dataList = new ArrayList(); |
| 56 | 61 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 57 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 58 | - List<Patients> patientses = null; | |
| 59 | - List<String> patientIds = new ArrayList<>(); | |
| 60 | - if (StringUtils.isNotEmpty(queryNo) ||StringUtils.isNotEmpty(vcCardNo) ) { | |
| 61 | - patientsQuery.setQueryNo(queryNo); | |
| 62 | - patientsQuery.setHospitalId(hospitalId); | |
| 63 | - patientsQuery.setVcCardNo(vcCardNo); | |
| 64 | - patientses = patientsService.queryPatient1(patientsQuery, "created"); | |
| 65 | - if (CollectionUtils.isEmpty(patientses)) | |
| 62 | + BoneQuery query = new BoneQuery(); | |
| 63 | + //孕妇骨密度 | |
| 64 | + if (type == 0) | |
| 65 | + { | |
| 66 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 67 | + List<Patients> patientses = null; | |
| 68 | + List<String> patientIds = new ArrayList<>(); | |
| 69 | + if (StringUtils.isNotEmpty(queryNo) ||StringUtils.isNotEmpty(vcCardNo) ) { | |
| 70 | + patientsQuery.setQueryNo(queryNo); | |
| 71 | + patientsQuery.setHospitalId(hospitalId); | |
| 72 | + patientsQuery.setVcCardNo(vcCardNo); | |
| 73 | + patientses = patientsService.queryPatient1(patientsQuery, "created"); | |
| 74 | + if (CollectionUtils.isEmpty(patientses)) | |
| 75 | + { | |
| 76 | + return new BaseListResponse().setData(dataList). | |
| 77 | + setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(new BaseQuery().getPageInfo()); | |
| 78 | + } | |
| 79 | + else | |
| 80 | + { | |
| 81 | + for (Patients pat : patientses) | |
| 82 | + { | |
| 83 | + patientIds.add(pat.getId()); | |
| 84 | + } | |
| 85 | + } | |
| 86 | + } | |
| 87 | + | |
| 88 | + query.setLimit(limit); | |
| 89 | + query.setPage(page); | |
| 90 | + query.setHospitalId(hospitalId); | |
| 91 | + query.setPatientIds(patientIds); | |
| 92 | + query.setType(0); | |
| 93 | + query.setSort(" created "); | |
| 94 | + | |
| 95 | + if (age != null) | |
| 66 | 96 | { |
| 67 | - return new BaseListResponse().setData(dataList). | |
| 68 | - setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(new BaseQuery().getPageInfo()); | |
| 97 | + Date start1 = DateUtil.getBeforeAge(age); | |
| 98 | + Date end1 = DateUtil.getBeforeAge(age + 1); | |
| 99 | + query.setBirthStart(start1); | |
| 100 | + query.setBirthEnd(end1); | |
| 69 | 101 | } |
| 70 | - else | |
| 102 | + | |
| 103 | + if (start != null && end != null) { | |
| 104 | + Date start1 = DateUtil.getWeekStart(start); | |
| 105 | + Date end1 = DateUtil.getWeekEnd(end); | |
| 106 | + query.setLastMensesStart(start1); | |
| 107 | + query.setLastMensesEnd(end1); | |
| 108 | + } | |
| 109 | + | |
| 110 | + | |
| 111 | + List<BoneModel> models = BoneService.queryBoneList(query); | |
| 112 | + if (CollectionUtils.isNotEmpty(models)) | |
| 71 | 113 | { |
| 72 | - for (Patients pat : patientses) | |
| 114 | + for (BoneModel model : models) | |
| 73 | 115 | { |
| 74 | - patientIds.add(pat.getId()); | |
| 116 | + Map data = new HashMap(); | |
| 117 | + Patients patients = patientsService.findOnePatientById(model.getPatientId()); | |
| 118 | + data.put("id",model.getId()); | |
| 119 | + data.put("userName",patients.getUsername()); | |
| 120 | + data.put("phone",patients.getPhone()); | |
| 121 | + data.put("vcCardNo",patients.getVcCardNo()); | |
| 122 | + data.put("cardNo",patients.getCardNo()); | |
| 123 | + data.put("age", DateUtil.getAge(patients.getBirth(), model.getCreated())); | |
| 124 | + data.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), model.getCreated())); | |
| 125 | + data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
| 126 | + dataList.add(data); | |
| 127 | + | |
| 75 | 128 | } |
| 76 | 129 | } |
| 77 | 130 | } |
| 78 | - BoneQuery query = new BoneQuery(); | |
| 79 | - query.setLimit(limit); | |
| 80 | - query.setPage(page); | |
| 81 | - query.setHospitalId(hospitalId); | |
| 82 | - query.setPatientIds(patientIds); | |
| 83 | - query.setType(0); | |
| 84 | - query.setSort(" created "); | |
| 85 | - | |
| 86 | - if (age != null) | |
| 131 | + else | |
| 87 | 132 | { |
| 88 | - Date start = DateUtil.getBeforeAge(age); | |
| 89 | - Date end = DateUtil.getBeforeAge(age + 1); | |
| 90 | - query.setBirthStart(start); | |
| 91 | - query.setBirthEnd(end); | |
| 92 | - } | |
| 133 | + BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
| 134 | + List<String> babayIds = new ArrayList<>(); | |
| 135 | + if (StringUtils.isNotEmpty(queryNo) ||StringUtils.isNotEmpty(vcCardNo) ) { | |
| 136 | + babyModelQuery.setQueryNo(queryNo); | |
| 137 | + babyModelQuery.setHospitalId(hospitalId); | |
| 138 | + babyModelQuery.setVcCardNo(vcCardNo); | |
| 139 | + List<BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
| 140 | + if (CollectionUtils.isEmpty(babyModels)) | |
| 141 | + { | |
| 142 | + return new BaseListResponse().setData(dataList). | |
| 143 | + setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(new BaseQuery().getPageInfo()); | |
| 144 | + } | |
| 145 | + else | |
| 146 | + { | |
| 147 | + for (BabyModel model : babyModels) | |
| 148 | + { | |
| 149 | + babayIds.add(model.getId()); | |
| 150 | + } | |
| 151 | + } | |
| 152 | + } | |
| 153 | + query.setLimit(limit); | |
| 154 | + query.setPage(page); | |
| 155 | + query.setHospitalId(hospitalId); | |
| 156 | + query.setPatientIds(babayIds); | |
| 157 | + query.setType(1); | |
| 158 | + query.setSort(" created "); | |
| 93 | 159 | |
| 94 | - if (weekStart != null && weekEnd != null) { | |
| 95 | - Date start = DateUtil.getWeekStart(weekStart); | |
| 96 | - Date end = DateUtil.getWeekEnd(weekEnd); | |
| 97 | - query.setLastMensesStart(start); | |
| 98 | - query.setLastMensesEnd(end); | |
| 99 | - } | |
| 160 | + if (start != null && end != null) | |
| 161 | + { | |
| 162 | + Date currentDate = new Date(); | |
| 163 | + Date start1 = DateUtil.addMonth(currentDate, -start); | |
| 164 | + Date end2 = DateUtil.addDay(DateUtil.addMonth(currentDate, -end - 1), 1); | |
| 165 | + query.setBirthStart(start1); | |
| 166 | + query.setBirthEnd(end2); | |
| 167 | + } | |
| 100 | 168 | |
| 101 | - | |
| 102 | - List<BoneModel> models = BoneService.queryBoneList(query); | |
| 103 | - if (CollectionUtils.isNotEmpty(models)) | |
| 104 | - { | |
| 105 | - for (BoneModel model : models) | |
| 169 | + List<BoneModel> models = BoneService.queryBoneList(query); | |
| 170 | + if (CollectionUtils.isNotEmpty(models)) | |
| 106 | 171 | { |
| 107 | - Map data = new HashMap(); | |
| 108 | - Patients patients = patientsService.findOnePatientById(model.getPatientId()); | |
| 109 | - data.put("id",model.getId()); | |
| 110 | - data.put("userName",patients.getUsername()); | |
| 111 | - data.put("phone",patients.getPhone()); | |
| 112 | - data.put("vcCardNo",patients.getVcCardNo()); | |
| 113 | - data.put("cardNo",patients.getCardNo()); | |
| 114 | - data.put("age", DateUtil.getAge(patients.getBirth(), model.getCreated())); | |
| 115 | - data.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), model.getCreated())); | |
| 116 | - data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
| 117 | - dataList.add(data); | |
| 172 | + for (BoneModel model : models) | |
| 173 | + { | |
| 174 | + Map data = new HashMap(); | |
| 175 | + BabyModel babyModel = babyBookbuildingService.queryBabyBuildById(model.getPatientId()); | |
| 176 | + data.put("id",model.getId()); | |
| 177 | + data.put("userName",babyModel.getName()); | |
| 178 | + data.put("phone",babyModel.getMphone()); | |
| 179 | + data.put("vcCardNo",babyModel.getVcCardNo()); | |
| 180 | + data.put("mcardNo",babyModel.getMcertNo()); | |
| 181 | + data.put("age", DateUtil.getBabyMonthAge(babyModel.getBirth(), model.getCreated())); | |
| 182 | + data.put("mname", babyModel.getMname()); | |
| 183 | + data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
| 184 | + dataList.add(data); | |
| 118 | 185 | |
| 186 | + } | |
| 119 | 187 | } |
| 120 | 188 | } |
| 189 | + | |
| 121 | 190 | return new BaseListResponse().setData(dataList). |
| 122 | 191 | setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(query.getPageInfo()); |
| 123 | 192 | } |
| 124 | 193 | |
| ... | ... | @@ -132,18 +201,52 @@ |
| 132 | 201 | BoneModel model = BoneService.queryOneBone(query); |
| 133 | 202 | if (model != null) |
| 134 | 203 | { |
| 135 | - Patients pat = patientsService.findOnePatientById(model.getPatientId()); | |
| 136 | - data.put("city", FunvCommonUtil.getBaseicConfigByid(pat.getCityRegisterId(), basicConfigService)); | |
| 137 | - data.put("area", FunvCommonUtil.getBaseicConfigByid(pat.getAreaRegisterId(), basicConfigService)); | |
| 138 | - data.put("userName",pat.getUsername()); | |
| 139 | - data.put("age", DateUtil.getAge(pat.getBirth(), model.getCreated())); | |
| 140 | - data.put("week", DateUtil.getWeekDesc(pat.getLastMenses(), model.getCreated())); | |
| 141 | - data.put("zvalue", model.getZvalue()); | |
| 142 | - data.put("tvalue", model.getTvalue()); | |
| 143 | - data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
| 144 | - Date lastMenses = DateUtil.addDay(pat.getLastMenses(),1); | |
| 145 | - int week = DateUtil.getWeek(lastMenses,model.getCreated()); | |
| 204 | + if (type == 0) | |
| 205 | + { | |
| 206 | + Patients pat = patientsService.findOnePatientById(model.getPatientId()); | |
| 207 | + data.put("city", FunvCommonUtil.getBaseicConfigByid(pat.getCityRegisterId(), basicConfigService)); | |
| 208 | + data.put("area", FunvCommonUtil.getBaseicConfigByid(pat.getAreaRegisterId(), basicConfigService)); | |
| 209 | + data.put("userName",pat.getUsername()); | |
| 210 | + data.put("age", DateUtil.getAge(pat.getBirth(), model.getCreated())); | |
| 211 | + data.put("week", DateUtil.getWeekDesc(pat.getLastMenses(), model.getCreated())); | |
| 212 | + data.put("position",model.getPosition()); | |
| 213 | + data.put("sos",model.getSos()); | |
| 214 | + data.put("tvalue",model.getTvalue()); | |
| 215 | + data.put("zvalue",model.getZvalue()); | |
| 216 | + data.put("bqi",model.getBqi()); | |
| 217 | + data.put("rrf",model.getRrf()); | |
| 218 | + data.put("eoa",model.getEoa()); | |
| 219 | + data.put("adultPercent",model.getAdultPercent()); | |
| 220 | + data.put("agePercent",model.getAgePercent()); | |
| 221 | + data.put("slAge",model.getAge()); | |
| 222 | + data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
| 223 | + Date lastMenses = DateUtil.addDay(pat.getLastMenses(),1); | |
| 224 | + int week = DateUtil.getWeek(lastMenses,model.getCreated()); | |
| 146 | 225 | |
| 226 | + } | |
| 227 | + else | |
| 228 | + { | |
| 229 | + BabyModel babyModel = babyBookbuildingService.queryBabyBuildById(model.getPatientId()); | |
| 230 | + data.put("city", FunvCommonUtil.getBaseicConfigByid(babyModel.getCityId(), basicConfigService)); | |
| 231 | + data.put("area", FunvCommonUtil.getBaseicConfigByid(babyModel.getAreaId(), basicConfigService)); | |
| 232 | + data.put("userName",babyModel.getName()); | |
| 233 | + data.put("age", DateUtil.getBabyMonthAge(babyModel.getBirth(), model.getCreated())); | |
| 234 | + data.put("position",model.getPosition()); | |
| 235 | + data.put("sos",model.getSos()); | |
| 236 | + data.put("tvalue",model.getTvalue()); | |
| 237 | + data.put("zvalue",model.getZvalue()); | |
| 238 | + data.put("bqi",model.getBqi()); | |
| 239 | + data.put("rrf",model.getRrf()); | |
| 240 | + data.put("eoa",model.getEoa()); | |
| 241 | + data.put("adultPercent",model.getAdultPercent()); | |
| 242 | + data.put("agePercent",model.getAgePercent()); | |
| 243 | + data.put("slAge",model.getAge()); | |
| 244 | + data.put("sex", babyModel.getSex() == null ? "" : SexEnum.getTextById(babyModel.getSex())); | |
| 245 | + data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
| 246 | + int month = DateUtil.getBabyAgeMonth(babyModel.getBirth(),model.getCreated()); | |
| 247 | + } | |
| 248 | + | |
| 249 | + | |
| 147 | 250 | } |
| 148 | 251 | |
| 149 | 252 | healthChargeFacade.addHealthCharge(hospitalId,8, model.getPatientId(), 1, 1, userId, doctorId, false); |
| 150 | 253 | |
| 151 | 254 | |
| ... | ... | @@ -153,24 +256,50 @@ |
| 153 | 256 | |
| 154 | 257 | |
| 155 | 258 | public BaseResponse saveBone(BoneModel boneModel) { |
| 156 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 157 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 158 | - patientsQuery.setType(1); | |
| 159 | - patientsQuery.setCardNo(boneModel.getCardNo()); | |
| 160 | - List<Patients> patients = patientsService.queryPatient(patientsQuery); | |
| 161 | - if (CollectionUtils.isNotEmpty(patients)) | |
| 259 | + | |
| 260 | + //孕妇骨密度 | |
| 261 | + if (boneModel.getType() == 0) | |
| 162 | 262 | { |
| 163 | - Patients pat = patients.get(0); | |
| 164 | - boneModel.setHospitalId(pat.getHospitalId()); | |
| 165 | - boneModel.setPatientId(pat.getId()); | |
| 166 | - boneModel.setPid(pat.getPid()); | |
| 167 | - boneModel.setBirthday(pat.getBirth()); | |
| 168 | - boneModel.setLastMenses(pat.getLastMenses()); | |
| 169 | - boneModel.setType(0); | |
| 170 | - boneModel.setCreated(new Date()); | |
| 171 | - boneModel.setModified(new Date()); | |
| 172 | - BoneService.add(boneModel); | |
| 263 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 264 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 265 | + patientsQuery.setType(1); | |
| 266 | + patientsQuery.setCardNo(boneModel.getCardNo()); | |
| 267 | + List<Patients> patients = patientsService.queryPatient(patientsQuery); | |
| 268 | + if (CollectionUtils.isNotEmpty(patients)) | |
| 269 | + { | |
| 270 | + Patients pat = patients.get(0); | |
| 271 | + boneModel.setHospitalId(pat.getHospitalId()); | |
| 272 | + boneModel.setPatientId(pat.getId()); | |
| 273 | + boneModel.setPid(pat.getPid()); | |
| 274 | + boneModel.setBirthday(pat.getBirth()); | |
| 275 | + boneModel.setLastMenses(pat.getLastMenses()); | |
| 276 | + boneModel.setType(0); | |
| 277 | + boneModel.setCreated(new Date()); | |
| 278 | + boneModel.setModified(new Date()); | |
| 279 | + BoneService.add(boneModel); | |
| 280 | + } | |
| 173 | 281 | } |
| 282 | + //儿童骨密度 | |
| 283 | + else | |
| 284 | + { | |
| 285 | + BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
| 286 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 287 | + babyModelQuery.setMcertNo(boneModel.getCardNo()); | |
| 288 | + List<BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
| 289 | + | |
| 290 | + if (CollectionUtils.isNotEmpty(babyModels)) { | |
| 291 | + BabyModel babyModel = babyModels.get(0); | |
| 292 | + boneModel.setHospitalId(babyModel.getHospitalId()); | |
| 293 | + boneModel.setPatientId(babyModel.getId()); | |
| 294 | + boneModel.setPid(babyModel.getPid()); | |
| 295 | + boneModel.setBirthday(babyModel.getBirth()); | |
| 296 | + boneModel.setType(1); | |
| 297 | + boneModel.setCreated(new Date()); | |
| 298 | + boneModel.setModified(new Date()); | |
| 299 | + BoneService.add(boneModel); | |
| 300 | + } | |
| 301 | + } | |
| 302 | + | |
| 174 | 303 | |
| 175 | 304 | return new BaseResponse(). |
| 176 | 305 | setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
View file @
1913631
| ... | ... | @@ -188,6 +188,24 @@ |
| 188 | 188 | archiveMap.put("hjXiang", hjXiang); |
| 189 | 189 | |
| 190 | 190 | archiveMap.put("photo", archiveModel.getPhoto()); |
| 191 | + archiveMap.put("code", archiveModel.getCode()); | |
| 192 | + | |
| 193 | + String spouseCode = ""; | |
| 194 | + //当婚检ID为空,用证件号或者就诊卡去查询居民建档的信息 | |
| 195 | + if (StringUtils.isNotEmpty(archiveModel.getSpouseCardNo())) { | |
| 196 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 197 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
| 198 | + archiveQuery.setHospitalId(requestParam.getHospitalId()); | |
| 199 | + archiveQuery.setCertificateNum(archiveModel.getSpouseCardNo()); | |
| 200 | + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery); | |
| 201 | + if (CollectionUtils.isNotEmpty(modelList)) | |
| 202 | + { | |
| 203 | + ResidentsArchiveModel model = modelList.get(0); | |
| 204 | + spouseCode = model.getCode() == null ? "" : String.valueOf(model.getCode()); | |
| 205 | + } | |
| 206 | + } | |
| 207 | + | |
| 208 | + archiveMap.put("spouseCode", spouseCode); | |
| 191 | 209 | |
| 192 | 210 | } |
| 193 | 211 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
1913631
| ... | ... | @@ -30,6 +30,7 @@ |
| 30 | 30 | import org.apache.commons.collections.CollectionUtils; |
| 31 | 31 | import org.apache.commons.lang.StringUtils; |
| 32 | 32 | import org.springframework.beans.factory.annotation.Autowired; |
| 33 | +import org.springframework.data.domain.Sort; | |
| 33 | 34 | import org.springframework.stereotype.Component; |
| 34 | 35 | |
| 35 | 36 | import javax.servlet.http.HttpServletResponse; |
| ... | ... | @@ -384,7 +385,7 @@ |
| 384 | 385 | }*/ |
| 385 | 386 | |
| 386 | 387 | getTrackHospital(archiveModel); |
| 387 | - | |
| 388 | + setCode(archiveModel); | |
| 388 | 389 | ResidentsArchiveModel residentsArchiveModel = residentsArchiveService.addResident(archiveModel); |
| 389 | 390 | |
| 390 | 391 | //新增婚检追访信息,默认进入婚检追访 |
| ... | ... | @@ -400,6 +401,32 @@ |
| 400 | 401 | br.setErrormsg("成功"); |
| 401 | 402 | br.setData(residentsArchiveModel.getId()); |
| 402 | 403 | return br; |
| 404 | + } | |
| 405 | + | |
| 406 | + | |
| 407 | + private void setCode(ResidentsArchiveModel archiveModel) | |
| 408 | + { | |
| 409 | + ResidentsArchiveQuery query = new ResidentsArchiveQuery(); | |
| 410 | + query.setYn(YnEnums.YES.getId()); | |
| 411 | + query.setHospitalId(archiveModel.getHospitalId()); | |
| 412 | + if (StringUtils.isNotEmpty(archiveModel.getCertificateNum())) { | |
| 413 | + //判断该证件号码是否在该医院建档 | |
| 414 | + query.setCertificateNum(archiveModel.getCertificateNum()); | |
| 415 | + query.setCertificateTypeId(archiveModel.getCertificateTypeId()); | |
| 416 | + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResidentWithSort(query,"code",Sort.Direction.DESC); | |
| 417 | + if (CollectionUtils.isNotEmpty(modelList)) { | |
| 418 | + ResidentsArchiveModel model = modelList.get(0); | |
| 419 | + if (model.getCode() != null) | |
| 420 | + { | |
| 421 | + archiveModel.setCode(model.getCode()+1); | |
| 422 | + } | |
| 423 | + } | |
| 424 | + else | |
| 425 | + { | |
| 426 | + archiveModel.setCode(Long.valueOf(DateUtil.getYyyyMM(new Date())+"001")); | |
| 427 | + } | |
| 428 | + } | |
| 429 | + | |
| 403 | 430 | } |
| 404 | 431 | |
| 405 | 432 | /** |