Commit e28e65a6f621e573f9db3277fcc4f55cf3212fb0

Authored by hujiaqi
1 parent 069d776abb

添加一些字段

Showing 2 changed files with 154 additions and 34 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java View file @ e28e65a
... ... @@ -20,9 +20,7 @@
20 20 import org.springframework.beans.factory.annotation.Autowired;
21 21 import org.springframework.stereotype.Component;
22 22  
23   -import java.util.ArrayList;
24   -import java.util.HashMap;
25   -import java.util.List;
  23 +import java.util.*;
26 24  
27 25 /**
28 26 * @auther HuJiaqi
... ... @@ -73,6 +71,30 @@
73 71 }
74 72 }
75 73  
  74 + // 排序,这里数据量并不大,所以可以在这里排序,排序规则为按照count倒序
  75 + Collections.sort(babyStatisticsManagerBuildDoctorGroupQueryModelList, new Comparator<BabyStatisticsManagerBuildDoctorGroupQueryModel>() {
  76 + @Override
  77 + public int compare(BabyStatisticsManagerBuildDoctorGroupQueryModel o1, BabyStatisticsManagerBuildDoctorGroupQueryModel o2) {
  78 + int i1;
  79 + int i2;
  80 + try {
  81 + i1 = Integer.valueOf(o1.getCount());
  82 + } catch (Exception e) {
  83 + i1 = 0;
  84 + }
  85 + try {
  86 + i2 = Integer.valueOf(o2.getCount());
  87 + } catch (Exception e) {
  88 + i2 = 0;
  89 + }
  90 + if (i1 > i2) {
  91 + return -1;
  92 + } else {
  93 + return 1;
  94 + }
  95 + }
  96 + });
  97 +
76 98 babyStatisticsManagerBuildDoctorGroupResult.setData(babyStatisticsManagerBuildDoctorGroupQueryModelList);
77 99 babyStatisticsManagerBuildDoctorGroupResult.setErrorcode(ErrorCodeConstants.SUCCESS);
78 100 babyStatisticsManagerBuildDoctorGroupResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
79 101  
80 102  
... ... @@ -161,20 +183,44 @@
161 183  
162 184 if (CollectionUtils.isNotEmpty(temp)) {
163 185 for (HashMap hashMap : temp) {
164   - BabyStatisticsManagerCheckDoctorGroupQueryModel babyStatisticsManagerBuildDoctorGroupQueryModel = new BabyStatisticsManagerCheckDoctorGroupQueryModel();
  186 + BabyStatisticsManagerCheckDoctorGroupQueryModel babyStatisticsManagerCheckDoctorGroupQueryModel = new BabyStatisticsManagerCheckDoctorGroupQueryModel();
165 187 String checkDoctorName;
166 188 try {
167 189 checkDoctorName = usersService.getUsers(Integer.valueOf(hashMap.get("_id").toString())).getName();
168 190 } catch (Exception e) {
169 191 checkDoctorName = "-";
170 192 }
171   - babyStatisticsManagerBuildDoctorGroupQueryModel.setCheckDoctorName(checkDoctorName);
172   - babyStatisticsManagerBuildDoctorGroupQueryModel.setCheckDoctorId(hashMap.get("_id") == null ? null : hashMap.get("_id").toString());
173   - babyStatisticsManagerBuildDoctorGroupQueryModel.setCount(hashMap.get("count").toString());
174   - babyStatisticsManagerCheckDoctorGroupQueryModelList.add(babyStatisticsManagerBuildDoctorGroupQueryModel);
  193 + babyStatisticsManagerCheckDoctorGroupQueryModel.setCheckDoctorName(checkDoctorName);
  194 + babyStatisticsManagerCheckDoctorGroupQueryModel.setCheckDoctorId(hashMap.get("_id") == null ? null : hashMap.get("_id").toString());
  195 + babyStatisticsManagerCheckDoctorGroupQueryModel.setCount(hashMap.get("count").toString());
  196 + babyStatisticsManagerCheckDoctorGroupQueryModelList.add(babyStatisticsManagerCheckDoctorGroupQueryModel);
175 197 }
176 198 }
177 199  
  200 + // 排序,这里数据量并不大,所以可以在这里排序,排序规则为按照count倒序
  201 + Collections.sort(babyStatisticsManagerCheckDoctorGroupQueryModelList, new Comparator<BabyStatisticsManagerCheckDoctorGroupQueryModel>() {
  202 + @Override
  203 + public int compare(BabyStatisticsManagerCheckDoctorGroupQueryModel o1, BabyStatisticsManagerCheckDoctorGroupQueryModel o2) {
  204 + int i1;
  205 + int i2;
  206 + try {
  207 + i1 = Integer.valueOf(o1.getCount());
  208 + } catch (Exception e) {
  209 + i1 = 0;
  210 + }
  211 + try {
  212 + i2 = Integer.valueOf(o2.getCount());
  213 + } catch (Exception e) {
  214 + i2 = 0;
  215 + }
  216 + if (i1 > i2) {
  217 + return -1;
  218 + } else {
  219 + return 1;
  220 + }
  221 + }
  222 + });
  223 +
178 224 babyStatisticsManagerBuildDoctorGroupResult.setData(babyStatisticsManagerCheckDoctorGroupQueryModelList);
179 225 babyStatisticsManagerBuildDoctorGroupResult.setErrorcode(ErrorCodeConstants.SUCCESS);
180 226 babyStatisticsManagerBuildDoctorGroupResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
181 227  
182 228  
... ... @@ -274,18 +320,66 @@
274 320 }
275 321  
276 322 List<HashMap> temp = babyCheckService.babyStatisticsManagerWeekAgeGroup(babyCheckModelQuery);
277   - List<BabyStatisticsManagerWeekAgeGroupQueryModel> babyStatisticsManagerCheckDoctorGroupQueryModelList = new ArrayList<>();
  323 + List<BabyStatisticsManagerWeekAgeGroupQueryModel> babyStatisticsManagerWeekAgeGroupQueryModelList = new ArrayList<>();
278 324  
279 325 if (CollectionUtils.isNotEmpty(temp)) {
280 326 for (HashMap hashMap : temp) {
281 327 BabyStatisticsManagerWeekAgeGroupQueryModel babyStatisticsManagerWeekAgeGroupQueryModel = new BabyStatisticsManagerWeekAgeGroupQueryModel();
282 328 babyStatisticsManagerWeekAgeGroupQueryModel.setWeekAge(hashMap.get("_id") == null ? null : hashMap.get("_id").toString());
283 329 babyStatisticsManagerWeekAgeGroupQueryModel.setCount(hashMap.get("count").toString());
284   - babyStatisticsManagerCheckDoctorGroupQueryModelList.add(babyStatisticsManagerWeekAgeGroupQueryModel);
  330 + babyStatisticsManagerWeekAgeGroupQueryModelList.add(babyStatisticsManagerWeekAgeGroupQueryModel);
285 331 }
286 332 }
287 333  
288   - babyStatisticsManagerWeekAgeGroupResult.setData(babyStatisticsManagerCheckDoctorGroupQueryModelList);
  334 + // 排序,这里数据量并不大,所以可以在这里排序,排序规则为按照weekAge正序
  335 + Collections.sort(babyStatisticsManagerWeekAgeGroupQueryModelList, new Comparator<BabyStatisticsManagerWeekAgeGroupQueryModel>() {
  336 + @Override
  337 + public int compare(BabyStatisticsManagerWeekAgeGroupQueryModel o1, BabyStatisticsManagerWeekAgeGroupQueryModel o2) {
  338 + int i1;
  339 + int i2;
  340 + try {
  341 + i1 = Integer.valueOf(o1.getWeekAge());
  342 + } catch (Exception e) {
  343 + i1 = 0;
  344 + }
  345 + try {
  346 + i2 = Integer.valueOf(o2.getWeekAge());
  347 + } catch (Exception e) {
  348 + i2 = 0;
  349 + }
  350 + if (i1 > i2) {
  351 + return 1;
  352 + } else {
  353 + return -1;
  354 + }
  355 + }
  356 + });
  357 + for (BabyStatisticsManagerWeekAgeGroupQueryModel babyStatisticsManagerWeekAgeGroupQueryModel : babyStatisticsManagerWeekAgeGroupQueryModelList) {
  358 + System.out.println(babyStatisticsManagerWeekAgeGroupQueryModel.getWeekAge());
  359 + }
  360 + List<BabyStatisticsManagerWeekAgeGroupQueryModel> babyStatisticsManagerWeekAgeGroupQueryModelListResult = new ArrayList<>();
  361 + // 从0开始,没有也填充
  362 + int index = 0;
  363 + for(Integer i = 0;i<37;i++) {
  364 + try {
  365 + while (!i.toString().equals(babyStatisticsManagerWeekAgeGroupQueryModelList.get(index).getWeekAge()) && i < Integer.valueOf(babyStatisticsManagerWeekAgeGroupQueryModelList.get(index).getWeekAge())) {
  366 + index++;
  367 + }
  368 + } catch (Exception e) {
  369 + index++;
  370 + }
  371 + if (babyStatisticsManagerWeekAgeGroupQueryModelList.get(index) == null) {
  372 + BabyStatisticsManagerWeekAgeGroupQueryModel babyStatisticsManagerWeekAgeGroupQueryModel = new BabyStatisticsManagerWeekAgeGroupQueryModel();
  373 + babyStatisticsManagerWeekAgeGroupQueryModel.setCount("0");
  374 + babyStatisticsManagerWeekAgeGroupQueryModel.setWeekAge(i.toString());
  375 + babyStatisticsManagerWeekAgeGroupQueryModelListResult.add(babyStatisticsManagerWeekAgeGroupQueryModel);
  376 + } else {
  377 + babyStatisticsManagerWeekAgeGroupQueryModelListResult.add(babyStatisticsManagerWeekAgeGroupQueryModelList.get(index));
  378 + index++;
  379 + }
  380 + }
  381 +
  382 + babyStatisticsManagerWeekAgeGroupResult.setData(babyStatisticsManagerWeekAgeGroupQueryModelListResult);
289 383 babyStatisticsManagerWeekAgeGroupResult.setErrorcode(ErrorCodeConstants.SUCCESS);
290 384 babyStatisticsManagerWeekAgeGroupResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
291 385 return babyStatisticsManagerWeekAgeGroupResult;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ e28e65a
... ... @@ -991,6 +991,7 @@
991 991 }
992 992 }
993 993  
  994 +
994 995 patientsQuery.setYn(YnEnums.YES.getId());
995 996 patientsQuery.setIsAutoFm(YnEnums.NO.getId());
996 997 patientsQuery.setType(3);
... ... @@ -1177,6 +1178,9 @@
1177 1178 pregnancyOut += renShenJieJuEnums.getName() + ",";
1178 1179 break;
1179 1180 }
  1181 + if(StringUtils.isEmpty(pregnancyOut)){
  1182 + pregnancyOut+="-,";
  1183 + }
1180 1184 }
1181 1185 }
1182 1186 if (childbirthManagerRequest.getInitQuery().contains("sex")) {
1183 1187  
1184 1188  
... ... @@ -1185,18 +1189,27 @@
1185 1189 sex += sexEnum.getText() + ",";
1186 1190 break;
1187 1191 }
  1192 + if(StringUtils.isEmpty(sex)){
  1193 + sex+="-,";
  1194 + }
1188 1195 }
1189 1196 }
1190   - babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ",";
1191   - babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ",";
1192   - asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ",";
1193   - babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ",";
1194   - malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ",";
  1197 + babyWeight += babyModel.getBabyWeight() == null ? "-," : babyModel.getBabyWeight() + ",";
  1198 + babyHeight += babyModel.getBabyHeight() == null ? "-," : babyModel.getBabyHeight() + ",";
  1199 + asphyxiaM += babyModel.getAsphyxiaM() == null ? "-," : babyModel.getAsphyxiaM() + ",";
  1200 + babyHealthy += babyModel.getBabyHealthy() == null ? "-," : babyModel.getBabyHealthy() + ",";
  1201 + if(Integer.valueOf(0).equals(babyModel.getMalformation())){
  1202 + malformation+="非畸形"+",";
  1203 + }else if(Integer.valueOf(1).equals(babyModel.getMalformation())){
  1204 + malformation+="畸形"+",";
  1205 + }else{
  1206 + malformation+="-,";
  1207 + }
1195 1208 Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore());
1196 1209 if (MapUtils.isNotEmpty(map)) {
1197   - apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ",";
1198   - apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ",";
1199   - apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ",";
  1210 + apgarScorePf1 += map.get("pf1") == null ? "-," : map.get("pf1") + ",";
  1211 + apgarScorePf5 += map.get("pf5") == null ? "-," : map.get("pf5") + ",";
  1212 + apgarScorePf10 += map.get("pf10") == null ? "-," : map.get("pf10") + ",";
1200 1213 }
1201 1214 }
1202 1215 } catch (Exception e) {
... ... @@ -1329,7 +1342,12 @@
1329 1342 }
1330 1343 }
1331 1344 heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
1332   - fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ",";
  1345 + for (FetalEnums fetalEnums : FetalEnums.values()) {
  1346 + if (fetalEnums.getId().equals(placenta.get("fetalPresentation"))) {
  1347 + fetalPresentation += fetalEnums.getName() + ",";
  1348 + break;
  1349 + }
  1350 + }
1333 1351 }
1334 1352 }
1335 1353 }
1336 1354  
... ... @@ -1367,9 +1385,18 @@
1367 1385 Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess());
1368 1386 if (MapUtils.isNotEmpty(totalprocessMap)) {
1369 1387 childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时" + totalprocessMap.get("m") + "分");
1370   - }else{
  1388 + } else {
1371 1389 childbirthManagerQueryModel.setTotalprocess("");
1372 1390 }
  1391 + // 死亡原因
  1392 + if (childbirthManagerRequest.getInitQuery().contains("deathCause")) {
  1393 + for (DeathCauseEnums deathCauseEnums : DeathCauseEnums.values()) {
  1394 + if (deathCauseEnums.getId().equals(maternalDeliverModel.getDeathCause())) {
  1395 + childbirthManagerQueryModel.setDeathCause(deathCauseEnums.getName());
  1396 + break;
  1397 + }
  1398 + }
  1399 + }
1373 1400  
1374 1401 // 收缩压,舒张压
1375 1402 Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp());
1376 1403  
1377 1404  
1378 1405  
... ... @@ -1634,27 +1661,26 @@
1634 1661 if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) {
1635 1662 //转换类型
1636 1663 MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj;
1637   - if (placenta!=null){
1638   - //胎方位
1639   - if (StringUtils.isNotEmpty(placenta.getFetalPosition())){
1640   - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
1641   - if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
1642   - fetalPosition += fetalPositionEnums.getName();
1643   - break;
1644   - }
  1664 + //胎方位
  1665 + if (StringUtils.isNotEmpty(placenta.getFetalPosition())) {
  1666 + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
  1667 + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
  1668 + fetalPosition += fetalPositionEnums.getName();
  1669 + break;
1645 1670 }
1646 1671 }
1647   - //胎先露
1648   - fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation();
1649   - //胎心率
1650   - heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString();
1651 1672 }
  1673 + //胎先露
  1674 + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation();
  1675 + //胎心率
  1676 + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString();
  1677 +
1652 1678 }
1653 1679  
1654 1680 if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) {
1655 1681 Map<String, String> placenta = JsonUtil.getMap(obj.toString());
1656 1682 if (MapUtils.isNotEmpty(placenta)) {
1657   - if (placenta.get("fetalPosition")!=null){
  1683 + if (placenta.get("fetalPosition") != null) {
1658 1684 for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
1659 1685 if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
1660 1686 fetalPosition += fetalPositionEnums.getName();