Commit 946a3c09f863fcac3bbaea73412e9007d6883293

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 3 changed files

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 946a3c0
... ... @@ -21,7 +21,6 @@
21 21 import org.apache.commons.lang.StringUtils;
22 22 import org.apache.commons.lang.math.NumberUtils;
23 23 import org.springframework.beans.factory.annotation.Autowired;
24   -import org.springframework.beans.factory.annotation.Value;
25 24 import org.springframework.data.domain.Sort;
26 25 import org.springframework.stereotype.Component;
27 26  
... ... @@ -106,6 +105,11 @@
106 105 patients.setBookbuildingDate(patients.getBookbuildingDate());
107 106 patients.setVcCardNo(null);
108 107 patients.setFileCode(null);
  108 + // 产后复查,设置自动分娩,这个字段其实是为了确定是否有对应的分娩记录,但是这种是没有分娩记录的
  109 + if(type==3){
  110 + patients.setIsAutoFm(YnEnums.YES.getId());
  111 + }
  112 + // hujiaqi添加结束
109 113 patientsService.addPatient(patients);
110 114 return patients.getId();
111 115 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java View file @ 946a3c0
... ... @@ -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 @ 946a3c0
... ... @@ -977,6 +977,7 @@
977 977 }
978 978 }
979 979  
  980 +
980 981 patientsQuery.setYn(YnEnums.YES.getId());
981 982 patientsQuery.setIsAutoFm(YnEnums.NO.getId());
982 983 patientsQuery.setType(3);
... ... @@ -1163,6 +1164,9 @@
1163 1164 pregnancyOut += renShenJieJuEnums.getName() + ",";
1164 1165 break;
1165 1166 }
  1167 + if(StringUtils.isEmpty(pregnancyOut)){
  1168 + pregnancyOut+="-,";
  1169 + }
1166 1170 }
1167 1171 }
1168 1172 if (childbirthManagerRequest.getInitQuery().contains("sex")) {
1169 1173  
1170 1174  
... ... @@ -1171,18 +1175,27 @@
1171 1175 sex += sexEnum.getText() + ",";
1172 1176 break;
1173 1177 }
  1178 + if(StringUtils.isEmpty(sex)){
  1179 + sex+="-,";
  1180 + }
1174 1181 }
1175 1182 }
1176   - babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ",";
1177   - babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ",";
1178   - asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ",";
1179   - babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ",";
1180   - malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ",";
  1183 + babyWeight += babyModel.getBabyWeight() == null ? "-," : babyModel.getBabyWeight() + ",";
  1184 + babyHeight += babyModel.getBabyHeight() == null ? "-," : babyModel.getBabyHeight() + ",";
  1185 + asphyxiaM += babyModel.getAsphyxiaM() == null ? "-," : babyModel.getAsphyxiaM() + ",";
  1186 + babyHealthy += babyModel.getBabyHealthy() == null ? "-," : babyModel.getBabyHealthy() + ",";
  1187 + if(Integer.valueOf(0).equals(babyModel.getMalformation())){
  1188 + malformation+="非畸形"+",";
  1189 + }else if(Integer.valueOf(1).equals(babyModel.getMalformation())){
  1190 + malformation+="畸形"+",";
  1191 + }else{
  1192 + malformation+="-,";
  1193 + }
1181 1194 Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore());
1182 1195 if (MapUtils.isNotEmpty(map)) {
1183   - apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ",";
1184   - apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ",";
1185   - apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ",";
  1196 + apgarScorePf1 += map.get("pf1") == null ? "-," : map.get("pf1") + ",";
  1197 + apgarScorePf5 += map.get("pf5") == null ? "-," : map.get("pf5") + ",";
  1198 + apgarScorePf10 += map.get("pf10") == null ? "-," : map.get("pf10") + ",";
1186 1199 }
1187 1200 }
1188 1201 } catch (Exception e) {
... ... @@ -1315,7 +1328,12 @@
1315 1328 }
1316 1329 }
1317 1330 heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
1318   - fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ",";
  1331 + for (FetalEnums fetalEnums : FetalEnums.values()) {
  1332 + if (fetalEnums.getId().equals(placenta.get("fetalPresentation"))) {
  1333 + fetalPresentation += fetalEnums.getName() + ",";
  1334 + break;
  1335 + }
  1336 + }
1319 1337 }
1320 1338 }
1321 1339 }
1322 1340  
... ... @@ -1353,9 +1371,18 @@
1353 1371 Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess());
1354 1372 if (MapUtils.isNotEmpty(totalprocessMap)) {
1355 1373 childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时" + totalprocessMap.get("m") + "分");
1356   - }else{
  1374 + } else {
1357 1375 childbirthManagerQueryModel.setTotalprocess("");
1358 1376 }
  1377 + // 死亡原因
  1378 + if (childbirthManagerRequest.getInitQuery().contains("deathCause")) {
  1379 + for (DeathCauseEnums deathCauseEnums : DeathCauseEnums.values()) {
  1380 + if (deathCauseEnums.getId().equals(maternalDeliverModel.getDeathCause())) {
  1381 + childbirthManagerQueryModel.setDeathCause(deathCauseEnums.getName());
  1382 + break;
  1383 + }
  1384 + }
  1385 + }
1359 1386  
1360 1387 // 收缩压,舒张压
1361 1388 Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp());
1362 1389  
1363 1390  
1364 1391  
... ... @@ -1632,27 +1659,26 @@
1632 1659 if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) {
1633 1660 //转换类型
1634 1661 MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj;
1635   - if (placenta!=null){
1636   - //胎方位
1637   - if (StringUtils.isNotEmpty(placenta.getFetalPosition())){
1638   - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
1639   - if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
1640   - fetalPosition += fetalPositionEnums.getName();
1641   - break;
1642   - }
  1662 + //胎方位
  1663 + if (StringUtils.isNotEmpty(placenta.getFetalPosition())) {
  1664 + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
  1665 + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
  1666 + fetalPosition += fetalPositionEnums.getName();
  1667 + break;
1643 1668 }
1644 1669 }
1645   - //胎先露
1646   - fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation();
1647   - //胎心率
1648   - heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString();
1649 1670 }
  1671 + //胎先露
  1672 + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation();
  1673 + //胎心率
  1674 + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString();
  1675 +
1650 1676 }
1651 1677  
1652 1678 if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) {
1653 1679 Map<String, String> placenta = JsonUtil.getMap(obj.toString());
1654 1680 if (MapUtils.isNotEmpty(placenta)) {
1655   - if (placenta.get("fetalPosition")!=null){
  1681 + if (placenta.get("fetalPosition") != null) {
1656 1682 for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
1657 1683 if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
1658 1684 fetalPosition += fetalPositionEnums.getName();