Commit 2a3ae3c961455ff3d2e6b3570e79caef9b5e69da
1 parent
a5ea6deb0d
Exists in
master
and in
7 other branches
分娩管理修改
Showing 1 changed file with 229 additions and 222 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
2a3ae3c
... | ... | @@ -1049,258 +1049,265 @@ |
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | List<ChildbirthManagerQueryModel> childbirthManagerQueryModelList = new ArrayList<>(); |
1052 | - for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { | |
1053 | - for (Patients patients : patientsList) { | |
1054 | - if (maternalDeliverModel.getParentId().equals(patients.getId())) { | |
1055 | - // 这里分好了组,开始往结果集里面加数据 | |
1056 | - ChildbirthManagerQueryModel childbirthManagerQueryModel = new ChildbirthManagerQueryModel(); | |
1057 | - BeanUtils.copy(patients, childbirthManagerQueryModel); | |
1058 | - BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel); | |
1059 | - // name | |
1060 | - childbirthManagerQueryModel.setName(patients.getUsername()); | |
1061 | - // 各种id | |
1062 | - childbirthManagerQueryModel.setpId(maternalDeliverModel.getPid()); | |
1063 | - childbirthManagerQueryModel.setPatientId(patients.getId()); | |
1064 | - childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); | |
1065 | - // 居住地 | |
1066 | - if (childbirthManagerRequest.getInitQuery().contains("address")) { | |
1067 | - childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
1068 | - } | |
1069 | - // 电话转换 | |
1070 | - childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone())); | |
1071 | - childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone())); | |
1072 | - // 加密身份证号 | |
1073 | - childbirthManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo())); | |
1074 | - // 查询分娩方式 | |
1075 | - if (childbirthManagerRequest.getInitQuery().contains("deliveryMode")) { | |
1076 | - String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); | |
1077 | - Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson); | |
1078 | - if (MapUtils.isNotEmpty(deliveryModeMap) && StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) { | |
1079 | - for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) { | |
1080 | - if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) { | |
1081 | - childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName()); | |
1082 | - break; | |
1083 | - } | |
1084 | - } | |
1085 | - } else { | |
1086 | - childbirthManagerQueryModel.setDeliveryMode(""); | |
1052 | + for (Patients patients : patientsList) { | |
1053 | + MaternalDeliverModel maternalDeliverModel = null; | |
1054 | + for (MaternalDeliverModel each : maternalDeliverModelList) { | |
1055 | + if (each.getParentId().equals(patients.getId())) { | |
1056 | + maternalDeliverModel = each; | |
1057 | + } | |
1058 | + if (maternalDeliverModel == null) { | |
1059 | + maternalDeliverModel = new MaternalDeliverModel(); | |
1060 | + } | |
1061 | + } | |
1062 | + // 这里分好了组,开始往结果集里面加数据 | |
1063 | + ChildbirthManagerQueryModel childbirthManagerQueryModel = new ChildbirthManagerQueryModel(); | |
1064 | + BeanUtils.copy(patients, childbirthManagerQueryModel); | |
1065 | + BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel); | |
1066 | + // name | |
1067 | + childbirthManagerQueryModel.setName(patients.getUsername()); | |
1068 | + // 各种id | |
1069 | + childbirthManagerQueryModel.setpId(maternalDeliverModel.getPid()); | |
1070 | + childbirthManagerQueryModel.setPatientId(patients.getId()); | |
1071 | + childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); | |
1072 | + // 居住地 | |
1073 | + if (childbirthManagerRequest.getInitQuery().contains("address")) { | |
1074 | + childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
1075 | + } | |
1076 | + // 电话转换 | |
1077 | + childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone())); | |
1078 | + childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone())); | |
1079 | + // 加密身份证号 | |
1080 | + childbirthManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo())); | |
1081 | + // 查询分娩方式 | |
1082 | + if (childbirthManagerRequest.getInitQuery().contains("deliveryMode")) { | |
1083 | + String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); | |
1084 | + Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson); | |
1085 | + if (MapUtils.isNotEmpty(deliveryModeMap) && StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) { | |
1086 | + for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) { | |
1087 | + if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) { | |
1088 | + childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName()); | |
1089 | + break; | |
1087 | 1090 | } |
1088 | 1091 | } |
1089 | - // 产妇情况 | |
1090 | - if (childbirthManagerRequest.getInitQuery().contains("maternalInfo")) { | |
1091 | - if (StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) { | |
1092 | - for (CfEnums cfEnums : CfEnums.values()) { | |
1093 | - if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) { | |
1094 | - childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName()); | |
1095 | - break; | |
1096 | - } | |
1097 | - } | |
1092 | + } else { | |
1093 | + childbirthManagerQueryModel.setDeliveryMode(""); | |
1094 | + } | |
1095 | + } | |
1096 | + // 产妇情况 | |
1097 | + if (childbirthManagerRequest.getInitQuery().contains("maternalInfo")) { | |
1098 | + if (StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) { | |
1099 | + for (CfEnums cfEnums : CfEnums.values()) { | |
1100 | + if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) { | |
1101 | + childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName()); | |
1102 | + break; | |
1098 | 1103 | } |
1099 | 1104 | } |
1100 | - // 查询接生医生 | |
1101 | - try { | |
1102 | - if (childbirthManagerRequest.getInitQuery().contains("deliverDoctor")) { | |
1103 | - childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); | |
1104 | - } | |
1105 | - } catch (Exception e) { | |
1106 | - // 什么都不干,这么干是为了避开原始数据的问题 | |
1107 | - } | |
1108 | - childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); | |
1109 | - // 查询活产数 | |
1110 | - if (childbirthManagerRequest.getInitQuery().contains("livingNumber")) { | |
1111 | - BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
1112 | - babyModelQuery.setYn(YnEnums.YES.getId()); | |
1113 | - babyModelQuery.setParentId(patients.getId()); | |
1114 | - babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); | |
1115 | - List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); | |
1116 | - if (CollectionUtils.isNotEmpty(babyModelList)) { | |
1117 | - childbirthManagerQueryModel.setLivingNumber(babyModelList.size()); | |
1118 | - } else { | |
1119 | - childbirthManagerQueryModel.setLivingNumber(0); | |
1120 | - } | |
1105 | + } | |
1106 | + } | |
1107 | + // 查询接生医生 | |
1108 | + try { | |
1109 | + if (childbirthManagerRequest.getInitQuery().contains("deliverDoctor")) { | |
1110 | + childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); | |
1111 | + } | |
1112 | + } catch (Exception e) { | |
1113 | + // 什么都不干,这么干是为了避开原始数据的问题 | |
1114 | + } | |
1115 | + childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); | |
1116 | + // 查询活产数 | |
1117 | + if (childbirthManagerRequest.getInitQuery().contains("livingNumber")) { | |
1118 | + BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
1119 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
1120 | + babyModelQuery.setParentId(patients.getId()); | |
1121 | + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); | |
1122 | + List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); | |
1123 | + if (CollectionUtils.isNotEmpty(babyModelList)) { | |
1124 | + childbirthManagerQueryModel.setLivingNumber(babyModelList.size()); | |
1125 | + } else { | |
1126 | + childbirthManagerQueryModel.setLivingNumber(0); | |
1127 | + } | |
1121 | 1128 | |
1122 | - // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形 | |
1123 | - if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut") || childbirthManagerRequest.getInitQuery().contains("sex") || childbirthManagerRequest.getInitQuery().contains("babyWeight") || childbirthManagerRequest.getInitQuery().contains("babyHeight") || childbirthManagerRequest.getInitQuery().contains("apgarScorePf1") || childbirthManagerRequest.getInitQuery().contains("apgarScorePf5") || childbirthManagerRequest.getInitQuery().contains("apgarScorePf10") || childbirthManagerRequest.getInitQuery().contains("asphyxiaM") || childbirthManagerRequest.getInitQuery().contains("babyHealthy") || childbirthManagerRequest.getInitQuery().contains("malformation")) { | |
1124 | - if (CollectionUtils.isNotEmpty(babyModelList)) { | |
1125 | - String pregnancyOut = ""; | |
1126 | - String sex = ""; | |
1127 | - String babyWeight = ""; | |
1128 | - String babyHeight = ""; | |
1129 | - String apgarScorePf1 = ""; | |
1130 | - String apgarScorePf5 = ""; | |
1131 | - String apgarScorePf10 = ""; | |
1132 | - String asphyxiaM = ""; | |
1133 | - String babyHealthy = ""; | |
1134 | - String malformation = ""; | |
1135 | - try { | |
1136 | - for (BabyModel babyModel : babyModelList) { | |
1137 | - if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut")) { | |
1138 | - for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) { | |
1139 | - if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) { | |
1140 | - pregnancyOut += renShenJieJuEnums.getName() + ","; | |
1141 | - break; | |
1142 | - } | |
1143 | - } | |
1129 | + // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形 | |
1130 | + if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut") || childbirthManagerRequest.getInitQuery().contains("sex") || childbirthManagerRequest.getInitQuery().contains("babyWeight") || childbirthManagerRequest.getInitQuery().contains("babyHeight") || childbirthManagerRequest.getInitQuery().contains("apgarScorePf1") || childbirthManagerRequest.getInitQuery().contains("apgarScorePf5") || childbirthManagerRequest.getInitQuery().contains("apgarScorePf10") || childbirthManagerRequest.getInitQuery().contains("asphyxiaM") || childbirthManagerRequest.getInitQuery().contains("babyHealthy") || childbirthManagerRequest.getInitQuery().contains("malformation")) { | |
1131 | + if (CollectionUtils.isNotEmpty(babyModelList)) { | |
1132 | + String pregnancyOut = ""; | |
1133 | + String sex = ""; | |
1134 | + String babyWeight = ""; | |
1135 | + String babyHeight = ""; | |
1136 | + String apgarScorePf1 = ""; | |
1137 | + String apgarScorePf5 = ""; | |
1138 | + String apgarScorePf10 = ""; | |
1139 | + String asphyxiaM = ""; | |
1140 | + String babyHealthy = ""; | |
1141 | + String malformation = ""; | |
1142 | + try { | |
1143 | + for (BabyModel babyModel : babyModelList) { | |
1144 | + if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut")) { | |
1145 | + for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) { | |
1146 | + if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) { | |
1147 | + pregnancyOut += renShenJieJuEnums.getName() + ","; | |
1148 | + break; | |
1144 | 1149 | } |
1145 | - if (childbirthManagerRequest.getInitQuery().contains("sex")) { | |
1146 | - for (SexEnum sexEnum : SexEnum.values()) { | |
1147 | - if (sexEnum.getId().equals(babyModel.getSex())) { | |
1148 | - sex += sexEnum.getText() + ","; | |
1149 | - break; | |
1150 | - } | |
1151 | - } | |
1150 | + } | |
1151 | + } | |
1152 | + if (childbirthManagerRequest.getInitQuery().contains("sex")) { | |
1153 | + for (SexEnum sexEnum : SexEnum.values()) { | |
1154 | + if (sexEnum.getId().equals(babyModel.getSex())) { | |
1155 | + sex += sexEnum.getText() + ","; | |
1156 | + break; | |
1152 | 1157 | } |
1153 | - babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ","; | |
1154 | - babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ","; | |
1155 | - asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ","; | |
1156 | - babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ","; | |
1157 | - malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ","; | |
1158 | - Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore()); | |
1159 | - if (MapUtils.isNotEmpty(map)) { | |
1160 | - apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ","; | |
1161 | - apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ","; | |
1162 | - apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ","; | |
1163 | - } | |
1164 | 1158 | } |
1165 | - } catch (Exception e) { | |
1166 | - // 什么都不干,这么干是为了避开原始数据的问题 | |
1167 | 1159 | } |
1168 | - childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1)); | |
1169 | - childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1)); | |
1170 | - childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1)); | |
1171 | - childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1)); | |
1172 | - childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1)); | |
1173 | - childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1)); | |
1174 | - childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1)); | |
1175 | - childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1)); | |
1176 | - childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1)); | |
1177 | - childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1)); | |
1160 | + babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ","; | |
1161 | + babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ","; | |
1162 | + asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ","; | |
1163 | + babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ","; | |
1164 | + malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ","; | |
1165 | + Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore()); | |
1166 | + if (MapUtils.isNotEmpty(map)) { | |
1167 | + apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ","; | |
1168 | + apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ","; | |
1169 | + apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ","; | |
1170 | + } | |
1178 | 1171 | } |
1179 | - } | |
1180 | - try { | |
1181 | - if (childbirthManagerRequest.getInitQuery().contains("fmHospital")) { | |
1182 | - childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName()); | |
1183 | - } | |
1184 | 1172 | } catch (Exception e) { |
1185 | 1173 | // 什么都不干,这么干是为了避开原始数据的问题 |
1186 | 1174 | } |
1187 | - | |
1175 | + childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1)); | |
1176 | + childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1)); | |
1177 | + childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1)); | |
1178 | + childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1)); | |
1179 | + childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1)); | |
1180 | + childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1)); | |
1181 | + childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1)); | |
1182 | + childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1)); | |
1183 | + childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1)); | |
1184 | + childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1)); | |
1188 | 1185 | } |
1186 | + } | |
1187 | + try { | |
1188 | + if (childbirthManagerRequest.getInitQuery().contains("fmHospital")) { | |
1189 | + childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName()); | |
1190 | + } | |
1191 | + } catch (Exception e) { | |
1192 | + // 什么都不干,这么干是为了避开原始数据的问题 | |
1193 | + } | |
1189 | 1194 | |
1190 | - // 开始拼装自定义查询结果 | |
1191 | - // 胎方位,胎心率,胎先露 | |
1192 | - if (childbirthManagerRequest.getInitQuery().contains("fetalPosition") || childbirthManagerRequest.getInitQuery().contains("heartRate") || childbirthManagerRequest.getInitQuery().contains("fetalPresentation")) { | |
1193 | - // 这个泛型不会出错,传入的就是这个 | |
1194 | - @SuppressWarnings("unchecked") | |
1195 | - List<MatDeliverAddRequest.Placenta> placentaList = maternalDeliverModel.getPlacentas(); | |
1196 | - if (CollectionUtils.isNotEmpty(placentaList)) { | |
1197 | - String fetalPosition = ""; | |
1198 | - String heartRate = ""; | |
1199 | - String fetalPresentation = ""; | |
1200 | - for (Object obj : placentaList) { | |
1201 | - if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { | |
1202 | - MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; | |
1203 | - if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { | |
1204 | - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
1205 | - if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { | |
1206 | - fetalPosition += fetalPositionEnums.getName() + ","; | |
1207 | - break; | |
1208 | - } | |
1209 | - } | |
1195 | + } | |
1196 | + | |
1197 | + // 开始拼装自定义查询结果 | |
1198 | + // 胎方位,胎心率,胎先露 | |
1199 | + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition") || childbirthManagerRequest.getInitQuery().contains("heartRate") || childbirthManagerRequest.getInitQuery().contains("fetalPresentation")) { | |
1200 | + // 这个泛型不会出错,传入的就是这个 | |
1201 | + @SuppressWarnings("unchecked") | |
1202 | + List<MatDeliverAddRequest.Placenta> placentaList = maternalDeliverModel.getPlacentas(); | |
1203 | + if (CollectionUtils.isNotEmpty(placentaList)) { | |
1204 | + String fetalPosition = ""; | |
1205 | + String heartRate = ""; | |
1206 | + String fetalPresentation = ""; | |
1207 | + for (Object obj : placentaList) { | |
1208 | + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { | |
1209 | + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; | |
1210 | + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { | |
1211 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
1212 | + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { | |
1213 | + fetalPosition += fetalPositionEnums.getName() + ","; | |
1214 | + break; | |
1210 | 1215 | } |
1211 | - heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ","; | |
1212 | - fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ","; | |
1213 | 1216 | } |
1214 | - if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { | |
1215 | - Map<String, String> placenta = JsonUtil.getMap(obj.toString()); | |
1216 | - if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { | |
1217 | - if (MapUtils.isNotEmpty(placenta)) { | |
1218 | - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
1219 | - if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { | |
1220 | - fetalPosition += fetalPositionEnums.getName() + ","; | |
1221 | - break; | |
1222 | - } | |
1223 | - } | |
1224 | - heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ","; | |
1225 | - fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ","; | |
1217 | + } | |
1218 | + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ","; | |
1219 | + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ","; | |
1220 | + } | |
1221 | + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { | |
1222 | + Map<String, String> placenta = JsonUtil.getMap(obj.toString()); | |
1223 | + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { | |
1224 | + if (MapUtils.isNotEmpty(placenta)) { | |
1225 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
1226 | + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { | |
1227 | + fetalPosition += fetalPositionEnums.getName() + ","; | |
1228 | + break; | |
1226 | 1229 | } |
1227 | 1230 | } |
1231 | + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ","; | |
1232 | + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ","; | |
1228 | 1233 | } |
1229 | 1234 | } |
1230 | - childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1)); | |
1231 | - childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1)); | |
1232 | - childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1)); | |
1233 | 1235 | } |
1234 | 1236 | } |
1235 | - // 第一产程,第二产程,第三产程 | |
1236 | - Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess()); | |
1237 | - if (MapUtils.isNotEmpty(prodprocessMap)) { | |
1238 | - Map<String, String> prodprocessOne = prodprocessMap.get("one"); | |
1239 | - if (MapUtils.isNotEmpty(prodprocessOne)) { | |
1240 | - childbirthManagerQueryModel.setProdprocessOne("h:" + prodprocessOne.get("h") + "," + "m:" + prodprocessOne.get("m")); | |
1241 | - } | |
1242 | - Map<String, String> prodprocessTwo = prodprocessMap.get("two"); | |
1243 | - if (MapUtils.isNotEmpty(prodprocessTwo)) { | |
1244 | - childbirthManagerQueryModel.setProdprocessTwo("h:" + prodprocessTwo.get("h") + "," + "m:" + prodprocessTwo.get("m")); | |
1245 | - } | |
1246 | - Map<String, String> prodprocessThree = prodprocessMap.get("three"); | |
1247 | - if (MapUtils.isNotEmpty(prodprocessThree)) { | |
1248 | - childbirthManagerQueryModel.setProdprocessThree("h:" + prodprocessThree.get("h") + "," + "m:" + prodprocessThree.get("m")); | |
1249 | - } | |
1250 | - } | |
1251 | - // 总产程 | |
1252 | - Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess()); | |
1253 | - if (MapUtils.isNotEmpty(totalprocessMap)) { | |
1254 | - childbirthManagerQueryModel.setTotalprocess("h:" + totalprocessMap.get("h") + "," + "m:" + totalprocessMap.get("m")); | |
1255 | - } | |
1256 | - // 收缩压,舒张压 | |
1257 | - Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp()); | |
1258 | - if (MapUtils.isNotEmpty(chBpMap)) { | |
1259 | - childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy")); | |
1260 | - childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy")); | |
1261 | - } | |
1262 | - // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型 | |
1263 | - if (childbirthManagerRequest.getInitQuery().contains("tpmcType") || childbirthManagerRequest.getInitQuery().contains("tpSize") || childbirthManagerRequest.getInitQuery().contains("tpWeight") || childbirthManagerRequest.getInitQuery().contains("umbilicalCordLength") || childbirthManagerRequest.getInitQuery().contains("umbilicalCordEx") || childbirthManagerRequest.getInitQuery().contains("umbilicalCordExType")) { | |
1264 | - List<MaternalDeliverModel.ExtPlacenta> extPlacentaList = maternalDeliverModel.getExtPlacentas(); | |
1265 | - if (CollectionUtils.isNotEmpty(extPlacentaList)) { | |
1266 | - String tpmcType = ""; | |
1267 | - String tpSize = ""; | |
1268 | - String tpWeight = ""; | |
1269 | - String umbilicalCordLength = ""; | |
1270 | - String umbilicalCordEx = ""; | |
1271 | - String umbilicalCordExType = ""; | |
1272 | - try { | |
1273 | - for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) { | |
1274 | - if (childbirthManagerRequest.getInitQuery().contains("tpmcType")) { | |
1275 | - for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) { | |
1276 | - if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) { | |
1277 | - tpmcType += tpmcTypeEnums.getName() + ","; | |
1278 | - break; | |
1279 | - } | |
1280 | - } | |
1237 | + childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1)); | |
1238 | + childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1)); | |
1239 | + childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1)); | |
1240 | + } | |
1241 | + } | |
1242 | + // 第一产程,第二产程,第三产程 | |
1243 | + Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess()); | |
1244 | + if (MapUtils.isNotEmpty(prodprocessMap)) { | |
1245 | + Map<String, String> prodprocessOne = prodprocessMap.get("one"); | |
1246 | + if (MapUtils.isNotEmpty(prodprocessOne)) { | |
1247 | + childbirthManagerQueryModel.setProdprocessOne("h:" + prodprocessOne.get("h") + "," + "m:" + prodprocessOne.get("m")); | |
1248 | + } | |
1249 | + Map<String, String> prodprocessTwo = prodprocessMap.get("two"); | |
1250 | + if (MapUtils.isNotEmpty(prodprocessTwo)) { | |
1251 | + childbirthManagerQueryModel.setProdprocessTwo("h:" + prodprocessTwo.get("h") + "," + "m:" + prodprocessTwo.get("m")); | |
1252 | + } | |
1253 | + Map<String, String> prodprocessThree = prodprocessMap.get("three"); | |
1254 | + if (MapUtils.isNotEmpty(prodprocessThree)) { | |
1255 | + childbirthManagerQueryModel.setProdprocessThree("h:" + prodprocessThree.get("h") + "," + "m:" + prodprocessThree.get("m")); | |
1256 | + } | |
1257 | + } | |
1258 | + // 总产程 | |
1259 | + Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess()); | |
1260 | + if (MapUtils.isNotEmpty(totalprocessMap)) { | |
1261 | + childbirthManagerQueryModel.setTotalprocess("h:" + totalprocessMap.get("h") + "," + "m:" + totalprocessMap.get("m")); | |
1262 | + } | |
1263 | + // 收缩压,舒张压 | |
1264 | + Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp()); | |
1265 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
1266 | + childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy")); | |
1267 | + childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy")); | |
1268 | + } | |
1269 | + // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型 | |
1270 | + if (childbirthManagerRequest.getInitQuery().contains("tpmcType") || childbirthManagerRequest.getInitQuery().contains("tpSize") || childbirthManagerRequest.getInitQuery().contains("tpWeight") || childbirthManagerRequest.getInitQuery().contains("umbilicalCordLength") || childbirthManagerRequest.getInitQuery().contains("umbilicalCordEx") || childbirthManagerRequest.getInitQuery().contains("umbilicalCordExType")) { | |
1271 | + List<MaternalDeliverModel.ExtPlacenta> extPlacentaList = maternalDeliverModel.getExtPlacentas(); | |
1272 | + if (CollectionUtils.isNotEmpty(extPlacentaList)) { | |
1273 | + String tpmcType = ""; | |
1274 | + String tpSize = ""; | |
1275 | + String tpWeight = ""; | |
1276 | + String umbilicalCordLength = ""; | |
1277 | + String umbilicalCordEx = ""; | |
1278 | + String umbilicalCordExType = ""; | |
1279 | + try { | |
1280 | + for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) { | |
1281 | + if (childbirthManagerRequest.getInitQuery().contains("tpmcType")) { | |
1282 | + for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) { | |
1283 | + if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) { | |
1284 | + tpmcType += tpmcTypeEnums.getName() + ","; | |
1285 | + break; | |
1281 | 1286 | } |
1282 | - tpSize += extPlacenta.getTpSize() == null ? "" : extPlacenta.getTpSize() + ","; | |
1283 | - tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ","; | |
1284 | - umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ","; | |
1285 | - umbilicalCordEx += extPlacenta.getUmbilicalCordEx() == null ? "" : extPlacenta.getUmbilicalCordEx() + ","; | |
1286 | - umbilicalCordExType += extPlacenta.getUmbilicalCordExType() == null ? "" : extPlacenta.getUmbilicalCordExType() + ","; | |
1287 | 1287 | } |
1288 | - } catch (Exception e) { | |
1289 | - // 什么都不干,这么干是为了避开原始数据的问题 | |
1290 | 1288 | } |
1291 | - childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1)); | |
1292 | - childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1)); | |
1293 | - childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1)); | |
1294 | - childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1)); | |
1295 | - childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1)); | |
1296 | - childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1)); | |
1289 | + tpSize += extPlacenta.getTpSize() == null ? "" : extPlacenta.getTpSize() + ","; | |
1290 | + tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ","; | |
1291 | + umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ","; | |
1292 | + umbilicalCordEx += extPlacenta.getUmbilicalCordEx() == null ? "" : extPlacenta.getUmbilicalCordEx() + ","; | |
1293 | + umbilicalCordExType += extPlacenta.getUmbilicalCordExType() == null ? "" : extPlacenta.getUmbilicalCordExType() + ","; | |
1297 | 1294 | } |
1295 | + } catch (Exception e) { | |
1296 | + // 什么都不干,这么干是为了避开原始数据的问题 | |
1298 | 1297 | } |
1299 | - // 拼装自定义查询结果结束 | |
1300 | - | |
1301 | - childbirthManagerQueryModelList.add(childbirthManagerQueryModel); | |
1298 | + childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1)); | |
1299 | + childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1)); | |
1300 | + childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1)); | |
1301 | + childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1)); | |
1302 | + childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1)); | |
1303 | + childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1)); | |
1302 | 1304 | } |
1303 | 1305 | } |
1306 | + // 拼装自定义查询结果结束 | |
1307 | + | |
1308 | + childbirthManagerQueryModelList.add(childbirthManagerQueryModel); | |
1309 | + | |
1310 | + | |
1304 | 1311 | } |
1305 | 1312 | |
1306 | 1313 | childbirthManagerResult.setData(childbirthManagerQueryModelList); |