Commit 8bd77d8c49f7d8ba5839feacbd887bbd3e441faa
Exists in
master
and in
3 other branches
Merge remote-tracking branch 'origin/master'
Showing 17 changed files
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyCheckModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
- platform-data-api/src/main/java/com/lyms/platform/data/util/AmsMessageService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.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/ResidentsArchiveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyBookbuildingAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyCheckRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ResidentsArchiveQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBuildResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCheckResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyGrowthCountResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/GrowthCountTask.java
platform-dal/src/main/java/com/lyms/platform/pojo/BabyCheckModel.java
View file @
8bd77d8
| ... | ... | @@ -225,6 +225,37 @@ |
| 225 | 225 | |
| 226 | 226 | private String hospitalId; |
| 227 | 227 | |
| 228 | + //体重评价 | |
| 229 | + private String weightEvaluate; | |
| 230 | + //身长评价 | |
| 231 | + private String heightEvaluate; | |
| 232 | + //头围评价 | |
| 233 | + private String headEvaluate; | |
| 234 | + | |
| 235 | + public String getWeightEvaluate() { | |
| 236 | + return weightEvaluate; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public void setWeightEvaluate(String weightEvaluate) { | |
| 240 | + this.weightEvaluate = weightEvaluate; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public String getHeightEvaluate() { | |
| 244 | + return heightEvaluate; | |
| 245 | + } | |
| 246 | + | |
| 247 | + public void setHeightEvaluate(String heightEvaluate) { | |
| 248 | + this.heightEvaluate = heightEvaluate; | |
| 249 | + } | |
| 250 | + | |
| 251 | + public String getHeadEvaluate() { | |
| 252 | + return headEvaluate; | |
| 253 | + } | |
| 254 | + | |
| 255 | + public void setHeadEvaluate(String headEvaluate) { | |
| 256 | + this.headEvaluate = headEvaluate; | |
| 257 | + } | |
| 258 | + | |
| 228 | 259 | public String getHospitalId() { |
| 229 | 260 | return hospitalId; |
| 230 | 261 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java
View file @
8bd77d8
| ... | ... | @@ -210,6 +210,59 @@ |
| 210 | 210 | //儿童诊断 |
| 211 | 211 | private String babyDiagnosis; |
| 212 | 212 | |
| 213 | + //体重评价 | |
| 214 | + private String weightEvaluate; | |
| 215 | + //身长评价 | |
| 216 | + private String heightEvaluate; | |
| 217 | + //头围评价 | |
| 218 | + private String headEvaluate; | |
| 219 | + | |
| 220 | + //身长别体重 | |
| 221 | + private String heightWeight; | |
| 222 | + | |
| 223 | + //病历号(住院号) | |
| 224 | + private String blNo; | |
| 225 | + | |
| 226 | + public String getBlNo() { | |
| 227 | + return blNo; | |
| 228 | + } | |
| 229 | + | |
| 230 | + public void setBlNo(String blNo) { | |
| 231 | + this.blNo = blNo; | |
| 232 | + } | |
| 233 | + | |
| 234 | + public String getWeightEvaluate() { | |
| 235 | + return weightEvaluate; | |
| 236 | + } | |
| 237 | + | |
| 238 | + public void setWeightEvaluate(String weightEvaluate) { | |
| 239 | + this.weightEvaluate = weightEvaluate; | |
| 240 | + } | |
| 241 | + | |
| 242 | + public String getHeightEvaluate() { | |
| 243 | + return heightEvaluate; | |
| 244 | + } | |
| 245 | + | |
| 246 | + public void setHeightEvaluate(String heightEvaluate) { | |
| 247 | + this.heightEvaluate = heightEvaluate; | |
| 248 | + } | |
| 249 | + | |
| 250 | + public String getHeadEvaluate() { | |
| 251 | + return headEvaluate; | |
| 252 | + } | |
| 253 | + | |
| 254 | + public void setHeadEvaluate(String headEvaluate) { | |
| 255 | + this.headEvaluate = headEvaluate; | |
| 256 | + } | |
| 257 | + | |
| 258 | + public String getHeightWeight() { | |
| 259 | + return heightWeight; | |
| 260 | + } | |
| 261 | + | |
| 262 | + public void setHeightWeight(String heightWeight) { | |
| 263 | + this.heightWeight = heightWeight; | |
| 264 | + } | |
| 265 | + | |
| 213 | 266 | public String getBabyDiagnosis() { |
| 214 | 267 | return babyDiagnosis; |
| 215 | 268 | } |
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
8bd77d8
| ... | ... | @@ -245,6 +245,48 @@ |
| 245 | 245 | |
| 246 | 246 | private String queryNo; |
| 247 | 247 | |
| 248 | + //体重评价 | |
| 249 | + private String weightEvaluate; | |
| 250 | + //身长评价 | |
| 251 | + private String heightEvaluate; | |
| 252 | + //头围评价 | |
| 253 | + private String headEvaluate; | |
| 254 | + | |
| 255 | + //身长别体重 | |
| 256 | + private String heightWeight; | |
| 257 | + | |
| 258 | + public String getWeightEvaluate() { | |
| 259 | + return weightEvaluate; | |
| 260 | + } | |
| 261 | + | |
| 262 | + public void setWeightEvaluate(String weightEvaluate) { | |
| 263 | + this.weightEvaluate = weightEvaluate; | |
| 264 | + } | |
| 265 | + | |
| 266 | + public String getHeightEvaluate() { | |
| 267 | + return heightEvaluate; | |
| 268 | + } | |
| 269 | + | |
| 270 | + public void setHeightEvaluate(String heightEvaluate) { | |
| 271 | + this.heightEvaluate = heightEvaluate; | |
| 272 | + } | |
| 273 | + | |
| 274 | + public String getHeadEvaluate() { | |
| 275 | + return headEvaluate; | |
| 276 | + } | |
| 277 | + | |
| 278 | + public void setHeadEvaluate(String headEvaluate) { | |
| 279 | + this.headEvaluate = headEvaluate; | |
| 280 | + } | |
| 281 | + | |
| 282 | + public String getHeightWeight() { | |
| 283 | + return heightWeight; | |
| 284 | + } | |
| 285 | + | |
| 286 | + public void setHeightWeight(String heightWeight) { | |
| 287 | + this.heightWeight = heightWeight; | |
| 288 | + } | |
| 289 | + | |
| 248 | 290 | public String getQueryNo() { |
| 249 | 291 | return queryNo; |
| 250 | 292 | } |
| ... | ... | @@ -448,6 +490,20 @@ |
| 448 | 490 | if (null != pregnancyOut) { |
| 449 | 491 | condition = condition.and("pregnancyOut", pregnancyOut, MongoOper.IS); |
| 450 | 492 | } |
| 493 | + | |
| 494 | + if (null != weightEvaluate) { | |
| 495 | + condition = condition.and("weightEvaluate", weightEvaluate, MongoOper.IS); | |
| 496 | + } | |
| 497 | + if (null != heightEvaluate) { | |
| 498 | + condition = condition.and("heightEvaluate", heightEvaluate, MongoOper.IS); | |
| 499 | + } | |
| 500 | + if (null != headEvaluate) { | |
| 501 | + condition = condition.and("pregnancyOut", headEvaluate, MongoOper.IS); | |
| 502 | + } | |
| 503 | + if (null != heightWeight) { | |
| 504 | + condition = condition.and("pregnancyOut", heightWeight, MongoOper.IS); | |
| 505 | + } | |
| 506 | + | |
| 451 | 507 | |
| 452 | 508 | if (!StringUtils.isEmpty(mcertNo)) { |
| 453 | 509 | condition = condition.and("mcertNo", mcertNo, MongoOper.IS); |
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
View file @
8bd77d8
| ... | ... | @@ -140,6 +140,15 @@ |
| 140 | 140 | if (StringUtils.isNotBlank(areaId)) { |
| 141 | 141 | condition = condition.and("areaId", areaId, MongoOper.IS); |
| 142 | 142 | } |
| 143 | + if (StringUtils.isNotBlank(provinceRegisterId)) { | |
| 144 | + condition = condition.and("provinceRegisterId", provinceRegisterId, MongoOper.IS); | |
| 145 | + } | |
| 146 | + if (StringUtils.isNotBlank(cityRegisterId)) { | |
| 147 | + condition = condition.and("cityRegisterId", cityRegisterId, MongoOper.IS); | |
| 148 | + } | |
| 149 | + if (StringUtils.isNotBlank(areaRegisterId)) { | |
| 150 | + condition = condition.and("areaRegisterId", areaRegisterId, MongoOper.IS); | |
| 151 | + } | |
| 143 | 152 | if (StringUtils.isNotBlank(vcCardNo)) { |
| 144 | 153 | condition = condition.and("vcCardNo", vcCardNo, MongoOper.IS); |
| 145 | 154 | } |
platform-data-api/src/main/java/com/lyms/platform/data/util/AmsMessageService.java
View file @
8bd77d8
| ... | ... | @@ -183,12 +183,12 @@ |
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | public static void main(String[] args) { |
| 186 | - Map<String,List<MessageContent>> list = getMessageTemplateMap("204", | |
| 186 | + Map<String,List<MessageContent>> list = getMessageTemplateMap("241", | |
| 187 | 187 | AmsServiceTypeEnum.CHILD_GUIDE); |
| 188 | 188 | |
| 189 | -// List<MessageContent> msgs = list.get("肺结核"); | |
| 189 | + List<MessageContent> msgs = list.get("高血压"); | |
| 190 | 190 | // |
| 191 | -// System.out.println(list); | |
| 191 | + System.out.println(msgs); | |
| 192 | 192 | |
| 193 | 193 | // for (int i = 0;i< 100 ;i++) |
| 194 | 194 | // { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
8bd77d8
| ... | ... | @@ -371,5 +371,19 @@ |
| 371 | 371 | return babyBookbuildingFacade.queryHisBabyDiagnosis(blNo); |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | + | |
| 375 | + /** | |
| 376 | + * 儿童生长统计 | |
| 377 | + * @return | |
| 378 | + */ | |
| 379 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyGroupCount") | |
| 380 | + @ResponseBody | |
| 381 | + public BaseResponse getBabyGroupCount(@Valid @RequestBody BabyManageRequest babyManageRequest, | |
| 382 | + HttpServletRequest request) { | |
| 383 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 384 | + return babyBookbuildingFacade.getBabyGroupCount(babyManageRequest,loginState.getId()); | |
| 385 | + } | |
| 386 | + | |
| 387 | + | |
| 374 | 388 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
8bd77d8
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | import com.lyms.platform.operate.web.request.*; |
| 15 | 15 | import com.lyms.platform.operate.web.result.*; |
| 16 | 16 | import com.lyms.platform.operate.web.utils.BabyListTask; |
| 17 | +import com.lyms.platform.operate.web.utils.GrowthCountTask; | |
| 17 | 18 | import com.lyms.platform.operate.web.utils.HiskCountTask; |
| 18 | 19 | import com.lyms.platform.operate.web.utils.MessageCenterService; |
| 19 | 20 | import com.lyms.platform.permission.model.Organization; |
| ... | ... | @@ -798,6 +799,7 @@ |
| 798 | 799 | |
| 799 | 800 | bm.setDueWeek(b.getDueWeek()); |
| 800 | 801 | bm.setBabyDiagnosis(b.getBabyDiagnosis()); |
| 802 | + bm.setBlNo(b.getBlNo()); | |
| 801 | 803 | |
| 802 | 804 | return bm; |
| 803 | 805 | } |
| ... | ... | @@ -965,7 +967,7 @@ |
| 965 | 967 | result.setExpType(model.getExpType()); |
| 966 | 968 | |
| 967 | 969 | result.setBabyDiagnosis(model.getBabyDiagnosis()); |
| 968 | - | |
| 970 | + result.setBlNo(model.getBlNo()); | |
| 969 | 971 | result.setDueWeek(model.getDueWeek()); |
| 970 | 972 | return result; |
| 971 | 973 | } |
| ... | ... | @@ -2110,6 +2112,212 @@ |
| 2110 | 2112 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 2111 | 2113 | objectResponse.setErrormsg("成功"); |
| 2112 | 2114 | return objectResponse; |
| 2115 | + } | |
| 2116 | + | |
| 2117 | + /** | |
| 2118 | + * 儿童生长发育统计 | |
| 2119 | + * @param request | |
| 2120 | + * @param userId | |
| 2121 | + * @return | |
| 2122 | + */ | |
| 2123 | + public BaseResponse getBabyGroupCount(BabyManageRequest request, Integer userId) { | |
| 2124 | + String hospitalId = ""; | |
| 2125 | + //得到当前登录的医院id | |
| 2126 | + if (userId != null) { | |
| 2127 | + Users dbuser = usersService.getUsers(userId); | |
| 2128 | + if (dbuser != null) { | |
| 2129 | + hospitalId = String.valueOf(dbuser.getOrgId()); | |
| 2130 | + } | |
| 2131 | + } | |
| 2132 | + | |
| 2133 | + BabyModelQuery babyQuery = new BabyModelQuery(); | |
| 2134 | + List buildType = new ArrayList(); | |
| 2135 | + buildType.add(1); | |
| 2136 | + buildType.add(2); | |
| 2137 | + babyQuery.setBuildTypeList(buildType); | |
| 2138 | + babyQuery.setHospitalId(hospitalId); | |
| 2139 | + | |
| 2140 | + babyQuery.setYn(YnEnums.YES.getId()); | |
| 2141 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 2142 | + | |
| 2143 | + if(StringUtils.isNotEmpty(request.getBirth()) && request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) | |
| 2144 | + { | |
| 2145 | + | |
| 2146 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 2147 | + String birthStr = request.getBirth(); | |
| 2148 | + String[] dates = birthStr.split(" - "); | |
| 2149 | + | |
| 2150 | + if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime()) | |
| 2151 | + { | |
| 2152 | + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); | |
| 2153 | + | |
| 2154 | + } | |
| 2155 | + else | |
| 2156 | + { | |
| 2157 | + babyQuery.setBirthEnd(start); | |
| 2158 | + } | |
| 2159 | + | |
| 2160 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 2161 | + | |
| 2162 | + if (DateUtil.parseYMD(dates[0]).getTime() < end.getTime()) | |
| 2163 | + { | |
| 2164 | + babyQuery.setBirthStart(end); | |
| 2165 | + } | |
| 2166 | + else | |
| 2167 | + { | |
| 2168 | + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 2169 | + } | |
| 2170 | + } | |
| 2171 | + else if (StringUtils.isNotEmpty(request.getBirth()) && request.getMonthAgeStart() != null ) | |
| 2172 | + { | |
| 2173 | + | |
| 2174 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 2175 | + String birthStr = request.getBirth(); | |
| 2176 | + String[] dates = birthStr.split(" - "); | |
| 2177 | + | |
| 2178 | + if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime()) | |
| 2179 | + { | |
| 2180 | + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); | |
| 2181 | + } | |
| 2182 | + else | |
| 2183 | + { | |
| 2184 | + babyQuery.setBirthEnd(start); | |
| 2185 | + } | |
| 2186 | + | |
| 2187 | + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 2188 | + | |
| 2189 | + } | |
| 2190 | + else if (StringUtils.isNotEmpty(request.getBirth())) | |
| 2191 | + { | |
| 2192 | + String birthStr = request.getBirth(); | |
| 2193 | + String[] dates = birthStr.split(" - "); | |
| 2194 | + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 2195 | + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); | |
| 2196 | + } | |
| 2197 | + else if (request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) | |
| 2198 | + { | |
| 2199 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 2200 | + babyQuery.setBirthEnd(start); | |
| 2201 | + | |
| 2202 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 2203 | + babyQuery.setBirthStart(end); | |
| 2204 | + } | |
| 2205 | + else if (request.getMonthAgeStart() != null) | |
| 2206 | + { | |
| 2207 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 2208 | + babyQuery.setBirthEnd(start); | |
| 2209 | + } | |
| 2210 | + else if (request.getMonthAgeEnd() != null) | |
| 2211 | + { | |
| 2212 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 2213 | + babyQuery.setBirthStart(end); | |
| 2214 | + } | |
| 2215 | + Map<String,List<BabyGrowthCountResult>> result = new HashMap<>(); | |
| 2216 | + | |
| 2217 | + Map<String,List<BabyGrowthCountResult>> mapItems = getCountGroupItemMaps(); | |
| 2218 | + for(String key : mapItems.keySet()) | |
| 2219 | + { | |
| 2220 | + List<BabyGrowthCountResult> groups = mapItems.get(key); | |
| 2221 | + GrowthCountTask task = new GrowthCountTask(groups,babyQuery,babyBookbuildingService,key); | |
| 2222 | + result.put(key,task.getResults()); | |
| 2223 | + } | |
| 2224 | + | |
| 2225 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 2226 | + objectResponse.setData(result); | |
| 2227 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2228 | + objectResponse.setErrormsg("成功"); | |
| 2229 | + return objectResponse; | |
| 2230 | + } | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + public Map<String,List<BabyGrowthCountResult>> getCountGroupItemMaps() | |
| 2234 | + { | |
| 2235 | + List<BabyGrowthCountResult> list1 = new ArrayList<>(); | |
| 2236 | + BabyGrowthCountResult growH = new BabyGrowthCountResult(); | |
| 2237 | + growH.setBzc("> +3SD"); | |
| 2238 | + growH.setEvaluate("上"); | |
| 2239 | + list1.add(growH); | |
| 2240 | + | |
| 2241 | + BabyGrowthCountResult growH1 = new BabyGrowthCountResult(); | |
| 2242 | + growH1.setBzc("+2SD - +3SD"); | |
| 2243 | + growH1.setEvaluate("中上"); | |
| 2244 | + list1.add(growH1); | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + BabyGrowthCountResult growH2 = new BabyGrowthCountResult(); | |
| 2248 | + growH2.setBzc("+1SD > +2SD"); | |
| 2249 | + growH2.setEvaluate("中+"); | |
| 2250 | + list1.add(growH2); | |
| 2251 | + | |
| 2252 | + BabyGrowthCountResult growH3 = new BabyGrowthCountResult(); | |
| 2253 | + growH3.setBzc("-1SD - +1SD"); | |
| 2254 | + growH3.setEvaluate("中"); | |
| 2255 | + list1.add(growH3); | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + BabyGrowthCountResult growH4 = new BabyGrowthCountResult(); | |
| 2259 | + growH4.setBzc("-2SD> -1SD"); | |
| 2260 | + growH4.setEvaluate("中-"); | |
| 2261 | + list1.add(growH4); | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + BabyGrowthCountResult growH5 = new BabyGrowthCountResult(); | |
| 2265 | + growH5.setBzc("-3SD - -2SD"); | |
| 2266 | + growH5.setEvaluate("中下"); | |
| 2267 | + list1.add(growH5); | |
| 2268 | + | |
| 2269 | + BabyGrowthCountResult growH6 = new BabyGrowthCountResult(); | |
| 2270 | + growH6.setBzc("< -3SD"); | |
| 2271 | + growH6.setEvaluate("下"); | |
| 2272 | + list1.add(growH5); | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + List<BabyGrowthCountResult> list2 = new ArrayList<>(); | |
| 2277 | + BabyGrowthCountResult growW = new BabyGrowthCountResult(); | |
| 2278 | + growW.setBzc("> +3SD"); | |
| 2279 | + growW.setEvaluate("上"); | |
| 2280 | + list2.add(growW); | |
| 2281 | + | |
| 2282 | + BabyGrowthCountResult growW1 = new BabyGrowthCountResult(); | |
| 2283 | + growW1.setBzc("+2SD - +3SD"); | |
| 2284 | + growW1.setEvaluate("中上"); | |
| 2285 | + list2.add(growW1); | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + BabyGrowthCountResult growW2 = new BabyGrowthCountResult(); | |
| 2289 | + growW2.setBzc("+1SD > +2SD"); | |
| 2290 | + growW2.setEvaluate("中+"); | |
| 2291 | + list2.add(growW2); | |
| 2292 | + | |
| 2293 | + BabyGrowthCountResult growW3 = new BabyGrowthCountResult(); | |
| 2294 | + growW3.setBzc("-1SD - +1SD"); | |
| 2295 | + growW3.setEvaluate("中"); | |
| 2296 | + list2.add(growW3); | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + BabyGrowthCountResult growW4 = new BabyGrowthCountResult(); | |
| 2300 | + growW4.setBzc("-2SD> -1SD"); | |
| 2301 | + growW4.setEvaluate("中-"); | |
| 2302 | + list2.add(growW4); | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + BabyGrowthCountResult growW5 = new BabyGrowthCountResult(); | |
| 2306 | + growW5.setBzc("-3SD - -2SD"); | |
| 2307 | + growW5.setEvaluate("中下"); | |
| 2308 | + list2.add(growH5); | |
| 2309 | + | |
| 2310 | + BabyGrowthCountResult growW6 = new BabyGrowthCountResult(); | |
| 2311 | + growW6.setBzc("< -3SD"); | |
| 2312 | + growW6.setEvaluate("下"); | |
| 2313 | + list2.add(growW6); | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + Map<String,List<BabyGrowthCountResult>> map1 = new HashMap<>(); | |
| 2317 | + map1.put("身长",list1); | |
| 2318 | + map1.put("体重",list2); | |
| 2319 | + | |
| 2320 | + return map1; | |
| 2113 | 2321 | } |
| 2114 | 2322 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
8bd77d8
| ... | ... | @@ -182,9 +182,10 @@ |
| 182 | 182 | |
| 183 | 183 | model.setDrugGllergic(JsonUtil.obj2JsonString(request.getDrugGllergic())); |
| 184 | 184 | model.setChestw(request.getChestw()); |
| 185 | - | |
| 186 | - | |
| 187 | 185 | model.setCheckDate(DateUtil.parseYMD(request.getCheckDate())); |
| 186 | + model.setWeightEvaluate(request.getWeightEvaluate()); | |
| 187 | + model.setHeadEvaluate(request.getHeadEvaluate()); | |
| 188 | + model.setHeightEvaluate(request.getHeightEvaluate()); | |
| 188 | 189 | |
| 189 | 190 | return model; |
| 190 | 191 | } |
| ... | ... | @@ -861,6 +862,10 @@ |
| 861 | 862 | |
| 862 | 863 | model.setDrugGllergic(JsonUtil.str2Obj(checkModel.getDrugGllergic(), Map.class)); |
| 863 | 864 | model.setChestw(checkModel.getChestw()); |
| 865 | + | |
| 866 | + model.setWeightEvaluate(checkModel.getWeightEvaluate()); | |
| 867 | + model.setHeadEvaluate(checkModel.getHeadEvaluate()); | |
| 868 | + model.setHeightEvaluate(checkModel.getHeightEvaluate()); | |
| 864 | 869 | |
| 865 | 870 | return model; |
| 866 | 871 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
8bd77d8
| ... | ... | @@ -148,11 +148,18 @@ |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + ResidentsArchiveModel newModel = null; | |
| 152 | + | |
| 151 | 153 | //历史建档记录 |
| 152 | 154 | List<Map> list = new ArrayList<>(); |
| 153 | 155 | List<ResidentsArchiveHistoryResult> resultList = new ArrayList<>(); |
| 154 | 156 | if (CollectionUtils.isNotEmpty(residents)){ |
| 157 | + | |
| 158 | + //如果该身份证号或者就诊卡号已经在某家医院建档,拉取最新的一条建档记录返回给前端 | |
| 159 | + newModel = residents.get(0); | |
| 160 | + | |
| 155 | 161 | for (ResidentsArchiveModel data : residents){ |
| 162 | + | |
| 156 | 163 | ResidentsArchiveHistoryResult result = new ResidentsArchiveHistoryResult(); |
| 157 | 164 | //查询医院机构 |
| 158 | 165 | if (StringUtils.isNotEmpty(data.getHospitalId())){ |
| ... | ... | @@ -167,6 +174,7 @@ |
| 167 | 174 | resultList.add(result); |
| 168 | 175 | } |
| 169 | 176 | } |
| 177 | + | |
| 170 | 178 | //性别 |
| 171 | 179 | List<BasicConfigResult> sexResults = basicConfigFacade.getBaseicConfigByParentId(SystemConfig.SEX_ID); |
| 172 | 180 | typeMap.put("sex", sexResults); |
| ... | ... | @@ -208,6 +216,7 @@ |
| 208 | 216 | |
| 209 | 217 | //历史建档记录 |
| 210 | 218 | Map<String,Object> mapData = new HashMap<>(); |
| 219 | + mapData.put("firstBuildData",newModel); | |
| 211 | 220 | mapData.put("archiveHistory",resultList); |
| 212 | 221 | mapData.put("initBuildDate", DateUtil.getyyyy_MM_dd(new Date())); |
| 213 | 222 | list.add(mapData); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java
View file @
8bd77d8
| ... | ... | @@ -186,11 +186,12 @@ |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | map.put("hospitalName",name); |
| 189 | + map.put("id",model.getId()); | |
| 189 | 190 | |
| 190 | 191 | list.add(map); |
| 191 | 192 | } |
| 192 | 193 | } |
| 193 | - return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(list); | |
| 194 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(list).setPageInfo(query.getPageInfo()); | |
| 194 | 195 | } |
| 195 | 196 | |
| 196 | 197 | //查询孕次 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyBookbuildingAddRequest.java
View file @
8bd77d8
| ... | ... | @@ -166,6 +166,17 @@ |
| 166 | 166 | //儿童诊断 |
| 167 | 167 | private String babyDiagnosis; |
| 168 | 168 | |
| 169 | + //病历号(住院号) | |
| 170 | + private String blNo; | |
| 171 | + | |
| 172 | + public String getBlNo() { | |
| 173 | + return blNo; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public void setBlNo(String blNo) { | |
| 177 | + this.blNo = blNo; | |
| 178 | + } | |
| 179 | + | |
| 169 | 180 | public String getBabyDiagnosis() { |
| 170 | 181 | return babyDiagnosis; |
| 171 | 182 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyCheckRequest.java
View file @
8bd77d8
| ... | ... | @@ -70,6 +70,13 @@ |
| 70 | 70 | //头围 |
| 71 | 71 | private String head; |
| 72 | 72 | |
| 73 | + //体重评价 | |
| 74 | + private String weightEvaluate; | |
| 75 | + //身长评价 | |
| 76 | + private String heightEvaluate; | |
| 77 | + //头围评价 | |
| 78 | + private String headEvaluate; | |
| 79 | + | |
| 73 | 80 | //胸围 |
| 74 | 81 | private String chestw; |
| 75 | 82 | |
| ... | ... | @@ -221,6 +228,30 @@ |
| 221 | 228 | private String checkDate; |
| 222 | 229 | |
| 223 | 230 | private String monthAge; |
| 231 | + | |
| 232 | + public String getWeightEvaluate() { | |
| 233 | + return weightEvaluate; | |
| 234 | + } | |
| 235 | + | |
| 236 | + public void setWeightEvaluate(String weightEvaluate) { | |
| 237 | + this.weightEvaluate = weightEvaluate; | |
| 238 | + } | |
| 239 | + | |
| 240 | + public String getHeightEvaluate() { | |
| 241 | + return heightEvaluate; | |
| 242 | + } | |
| 243 | + | |
| 244 | + public void setHeightEvaluate(String heightEvaluate) { | |
| 245 | + this.heightEvaluate = heightEvaluate; | |
| 246 | + } | |
| 247 | + | |
| 248 | + public String getHeadEvaluate() { | |
| 249 | + return headEvaluate; | |
| 250 | + } | |
| 251 | + | |
| 252 | + public void setHeadEvaluate(String headEvaluate) { | |
| 253 | + this.headEvaluate = headEvaluate; | |
| 254 | + } | |
| 224 | 255 | |
| 225 | 256 | public String getMonthAge() { |
| 226 | 257 | return monthAge; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ResidentsArchiveQueryRequest.java
View file @
8bd77d8
| ... | ... | @@ -40,9 +40,9 @@ |
| 40 | 40 | private String cityRegisterId; |
| 41 | 41 | private String areaRegisterId; |
| 42 | 42 | |
| 43 | - //年龄(如: 24-26) | |
| 43 | + //年龄(如: 24 - 26) | |
| 44 | 44 | private String age; |
| 45 | - //出生日期(范围值 - ) | |
| 45 | + //出生日期(范围值 1991-01-01 - 1994-02-02 ) | |
| 46 | 46 | private String birthday; |
| 47 | 47 | |
| 48 | 48 | public String getBuildProvinceId() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBuildResult.java
View file @
8bd77d8
| ... | ... | @@ -137,6 +137,18 @@ |
| 137 | 137 | //儿童诊断 |
| 138 | 138 | private String babyDiagnosis; |
| 139 | 139 | |
| 140 | + | |
| 141 | + //病历号(住院号) | |
| 142 | + private String blNo; | |
| 143 | + | |
| 144 | + public String getBlNo() { | |
| 145 | + return blNo; | |
| 146 | + } | |
| 147 | + | |
| 148 | + public void setBlNo(String blNo) { | |
| 149 | + this.blNo = blNo; | |
| 150 | + } | |
| 151 | + | |
| 140 | 152 | public String getBabyDiagnosis() { |
| 141 | 153 | return babyDiagnosis; |
| 142 | 154 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCheckResult.java
View file @
8bd77d8
| ... | ... | @@ -209,7 +209,37 @@ |
| 209 | 209 | private String checkDate; |
| 210 | 210 | private String monthAge; |
| 211 | 211 | |
| 212 | + //体重评价 | |
| 213 | + private String weightEvaluate; | |
| 214 | + //身长评价 | |
| 215 | + private String heightEvaluate; | |
| 216 | + //头围评价 | |
| 217 | + private String headEvaluate; | |
| 212 | 218 | |
| 219 | + | |
| 220 | + public String getWeightEvaluate() { | |
| 221 | + return weightEvaluate; | |
| 222 | + } | |
| 223 | + | |
| 224 | + public void setWeightEvaluate(String weightEvaluate) { | |
| 225 | + this.weightEvaluate = weightEvaluate; | |
| 226 | + } | |
| 227 | + | |
| 228 | + public String getHeightEvaluate() { | |
| 229 | + return heightEvaluate; | |
| 230 | + } | |
| 231 | + | |
| 232 | + public void setHeightEvaluate(String heightEvaluate) { | |
| 233 | + this.heightEvaluate = heightEvaluate; | |
| 234 | + } | |
| 235 | + | |
| 236 | + public String getHeadEvaluate() { | |
| 237 | + return headEvaluate; | |
| 238 | + } | |
| 239 | + | |
| 240 | + public void setHeadEvaluate(String headEvaluate) { | |
| 241 | + this.headEvaluate = headEvaluate; | |
| 242 | + } | |
| 213 | 243 | |
| 214 | 244 | public String getMonthAge() { |
| 215 | 245 | return monthAge; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyGrowthCountResult.java
View file @
8bd77d8
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by lqy on 2016-12-21. | |
| 10 | + */ | |
| 11 | +public class BabyGrowthCountResult { | |
| 12 | + | |
| 13 | + //标准差 | |
| 14 | + private String bzc; | |
| 15 | + | |
| 16 | + //评价 | |
| 17 | + private String evaluate; | |
| 18 | + | |
| 19 | + //人数 | |
| 20 | + private String count; | |
| 21 | + | |
| 22 | + public String getBzc() { | |
| 23 | + return bzc; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setBzc(String bzc) { | |
| 27 | + this.bzc = bzc; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public String getEvaluate() { | |
| 31 | + return evaluate; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setEvaluate(String evaluate) { | |
| 35 | + this.evaluate = evaluate; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getCount() { | |
| 39 | + return count; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setCount(String count) { | |
| 43 | + this.count = count; | |
| 44 | + } | |
| 45 | + | |
| 46 | + | |
| 47 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/GrowthCountTask.java
View file @
8bd77d8
| 1 | +package com.lyms.platform.operate.web.utils; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.BabyBookbuildingService; | |
| 4 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 5 | +import com.lyms.platform.operate.web.result.BabyGrowthCountResult; | |
| 6 | +import com.lyms.platform.query.BabyModelQuery; | |
| 7 | +import org.apache.commons.collections.CollectionUtils; | |
| 8 | + | |
| 9 | +import java.util.ArrayList; | |
| 10 | +import java.util.List; | |
| 11 | +import java.util.concurrent.*; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * Created by lqy on 2016-12-21. | |
| 15 | + */ | |
| 16 | +public class GrowthCountTask{ | |
| 17 | + | |
| 18 | + private static ExecutorService pool = Executors.newFixedThreadPool(6); | |
| 19 | + private BabyModelQuery babyQuery; | |
| 20 | + private List<BabyGrowthCountResult> growth; | |
| 21 | + private BabyBookbuildingService babyBookbuildingService; | |
| 22 | + private String type; | |
| 23 | + public GrowthCountTask(List<BabyGrowthCountResult> growth,BabyModelQuery babyQuery, | |
| 24 | + BabyBookbuildingService babyBookbuildingService,String type) | |
| 25 | + { | |
| 26 | + this.babyQuery=babyQuery; | |
| 27 | + this.growth = growth; | |
| 28 | + this.babyBookbuildingService = babyBookbuildingService; | |
| 29 | + this.type = type; | |
| 30 | + } | |
| 31 | + public List<BabyGrowthCountResult> getResults() { | |
| 32 | + List<BabyGrowthCountResult> results = new ArrayList<>(); | |
| 33 | + if (CollectionUtils.isNotEmpty(growth)) { | |
| 34 | + | |
| 35 | + int batchSize = 1; | |
| 36 | + int end = 0; | |
| 37 | + List<Future> futures = new ArrayList<>(); | |
| 38 | + for (int i = 0; i < growth.size(); i += batchSize) { | |
| 39 | + end = (end + batchSize); | |
| 40 | + if (end > growth.size()) { | |
| 41 | + end = growth.size(); | |
| 42 | + } | |
| 43 | + | |
| 44 | + final List<BabyGrowthCountResult> growths = growth.subList(i, end); | |
| 45 | + Callable c = new Callable() | |
| 46 | + { | |
| 47 | + @Override | |
| 48 | + public List<BabyGrowthCountResult> call() throws Exception { | |
| 49 | + | |
| 50 | + if (CollectionUtils.isNotEmpty(growths)) | |
| 51 | + { | |
| 52 | + for(BabyGrowthCountResult grouwth : growths) | |
| 53 | + { | |
| 54 | + if ("身长".equals(type)) | |
| 55 | + { | |
| 56 | + babyQuery.setHeightEvaluate(grouwth.getEvaluate()); | |
| 57 | + } | |
| 58 | + else if ("体重".equals(type)) | |
| 59 | + { | |
| 60 | + babyQuery.setWeightEvaluate(grouwth.getEvaluate()); | |
| 61 | + } | |
| 62 | + int count = babyBookbuildingService.queryBabyCount(babyQuery); | |
| 63 | + grouwth.setCount(String.valueOf(count)); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 67 | + return growths; | |
| 68 | + } | |
| 69 | + }; | |
| 70 | + | |
| 71 | + Future f = pool.submit(c); | |
| 72 | + futures.add(f); | |
| 73 | + } | |
| 74 | + for (Future f : futures) { | |
| 75 | + try { | |
| 76 | + results.addAll((List) f.get(30, TimeUnit.SECONDS)); | |
| 77 | + } catch (Exception e) { | |
| 78 | + ExceptionUtils.catchException(e, "baby growth count"); | |
| 79 | + } | |
| 80 | + } | |
| 81 | + } | |
| 82 | + | |
| 83 | + return results; | |
| 84 | + } | |
| 85 | +} |