Commit 9deff975350414f3fe245c3286403b36a8c7ea37

Authored by hujiaqi
1 parent b147361f01

自定义查询-跑数据

Showing 4 changed files with 338 additions and 195 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 9deff97
... ... @@ -510,6 +510,60 @@
510 510 return "syncPatientsLastCheckEmployeeId start......";
511 511 }
512 512  
  513 + /**
  514 + * @auther HuJiaqi
  515 + * @createTime 2016年12月21日 15时56分
  516 + * @discription 冗余分娩分娩医院,分娩年龄,分娩孕周,分娩方式
  517 + */
  518 + @ResponseBody
  519 + @RequestMapping(value = "/syncPatientsFmInfo1", method = RequestMethod.GET)
  520 + public String syncPatientsFmInfo1(@RequestParam(required = false) String size) {
  521 + PatientsQuery patientsQuery = new PatientsQuery();
  522 + patientsQuery.setYn(YnEnums.YES.getId());
  523 + patientsQuery.setType(3);
  524 + // 查询
  525 + List<Patients> patientsList = patientsService.queryPatient(patientsQuery);
  526 + System.out.println("本次读取了【" + patientsList.size() + "】条数据");
  527 + int batchSize = StringUtils.isEmpty(size) ? 1000 : Integer.valueOf(size);
  528 + int end = 0;
  529 + for (int i = 0; i < patientsList.size(); i += batchSize) {
  530 + end = (end + batchSize);
  531 + if (end > patientsList.size()) {
  532 + end = patientsList.size();
  533 + }
  534 + final List<Patients> tempList = patientsList.subList(i, end);
  535 + new Thread(new Runnable() {
  536 + @Override
  537 + public void run() {
  538 + if (CollectionUtils.isNotEmpty(tempList)) {
  539 + for (Patients patients : tempList) {
  540 +
  541 + try {
  542 + patients.setFmAge(DateUtil.getAge(patients.getBirth(), patients.getFmDate()));
  543 + } catch (Exception e) {
  544 + System.out.println(patients.getId() + ":这条数据的生日和分娩时间异常");
  545 + // 跳过
  546 + }
  547 + try {
  548 + patients.setFmWeek(DateUtil.getDays(patients.getLastMenses(), patients.getFmDate()));
  549 + } catch (Exception e) {
  550 + System.out.println(patients.getId() + ":这条数据的末日月经和分娩时间异常");
  551 + // 跳过
  552 + }
  553 +
  554 +
  555 + System.out.println(patients.getFmAge());
  556 + System.out.println(patients.getFmWeek());
  557 +
  558 + patientsService.updatePatient(patients);
  559 + }
  560 + }
  561 + }
  562 + }).start();
  563 + }
  564 + return "syncPatientsLastCheckEmployeeId start......";
  565 + }
  566 +
513 567 @RequestMapping(value = "/initCardNo", method = RequestMethod.GET)
514 568 @ResponseBody
515 569 public String initCardNo() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 9deff97
... ... @@ -1041,12 +1041,6 @@
1041 1041 matDeliverQuery.setParentIdList(parentIdList);
1042 1042 matDeliverQuery.setYn(YnEnums.YES.getId());
1043 1043 List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery);
1044   - if (CollectionUtils.isEmpty(maternalDeliverModelList)) {
1045   - // 没有查到,直接抛出
1046   - childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS);
1047   - childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
1048   - return childbirthManagerResult;
1049   - }
1050 1044  
1051 1045 List<ChildbirthManagerQueryModel> childbirthManagerQueryModelList = new ArrayList<>();
1052 1046 for (Patients patients : patientsList) {
1053 1047  
1054 1048  
1055 1049  
1056 1050  
... ... @@ -1059,16 +1053,24 @@
1059 1053 maternalDeliverModel = new MaternalDeliverModel();
1060 1054 }
1061 1055 }
1062   - // 这里分好了组,开始往结果集里面加数据
  1056 +
  1057 + // 开始封装数据
1063 1058 ChildbirthManagerQueryModel childbirthManagerQueryModel = new ChildbirthManagerQueryModel();
  1059 + if (maternalDeliverModel != null) {
  1060 + BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel);
  1061 + }
1064 1062 BeanUtils.copy(patients, childbirthManagerQueryModel);
1065   - BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel);
  1063 + // 分娩孕周
  1064 + String week = (patients.getFmWeek() / 7) + "";
  1065 + int day = (patients.getFmWeek() % 7);
  1066 + childbirthManagerQueryModel.setDueWeek("孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""));
  1067 + // 分娩日期
  1068 + childbirthManagerQueryModel.setDueDate(DateUtil.getyyyy_MM_dd(patients.getFmDate()));
1066 1069 // name
1067 1070 childbirthManagerQueryModel.setName(patients.getUsername());
1068 1071 // 各种id
1069   - childbirthManagerQueryModel.setpId(maternalDeliverModel.getPid());
  1072 + childbirthManagerQueryModel.setPid(patients.getPid());
1070 1073 childbirthManagerQueryModel.setPatientId(patients.getId());
1071   - childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId());
1072 1074 // 居住地
1073 1075 if (childbirthManagerRequest.getInitQuery().contains("address")) {
1074 1076 childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
1075 1077  
1076 1078  
1077 1079  
... ... @@ -1078,43 +1080,30 @@
1078 1080 childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone()));
1079 1081 // 加密身份证号
1080 1082 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;
1090   - }
1091   - }
1092   - } else {
1093   - childbirthManagerQueryModel.setDeliveryMode("");
  1083 + // 年龄
  1084 + childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth()));
  1085 +
  1086 + // 居住类型
  1087 + if (childbirthManagerRequest.getInitQuery().contains("pliveTypeId")) {
  1088 + try {
  1089 + childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById("pliveTypeId").getName());
  1090 + } catch (Exception e) {
  1091 + // 什么都不干
1094 1092 }
1095 1093 }
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;
1103   - }
1104   - }
  1094 +
  1095 + // 户口类型
  1096 + if (childbirthManagerRequest.getInitQuery().contains("pcensusTypeId")) {
  1097 + try {
  1098 + childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById("pcensusTypeId").getName());
  1099 + } catch (Exception e) {
  1100 + // 什么都不干
1105 1101 }
1106 1102 }
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()));
  1103 +
1116 1104 // 查询活产数
1117   - if (childbirthManagerRequest.getInitQuery().contains("livingNumber")) {
  1105 + // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形
  1106 + if (childbirthManagerRequest.getInitQuery().contains("livingNumber") || 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")) {
1118 1107 BabyModelQuery babyModelQuery = new BabyModelQuery();
1119 1108 babyModelQuery.setYn(YnEnums.YES.getId());
1120 1109 babyModelQuery.setParentId(patients.getId());
1121 1110  
1122 1111  
1123 1112  
1124 1113  
1125 1114  
1126 1115  
1127 1116  
1128 1117  
... ... @@ -1123,68 +1112,143 @@
1123 1112 if (CollectionUtils.isNotEmpty(babyModelList)) {
1124 1113 childbirthManagerQueryModel.setLivingNumber(babyModelList.size());
1125 1114 } else {
1126   - childbirthManagerQueryModel.setLivingNumber(0);
  1115 + if (childbirthManagerQueryModel.getTireNumber() == null) {
  1116 + childbirthManagerQueryModel.setLivingNumber(null);
  1117 + } else {
  1118 + childbirthManagerQueryModel.setLivingNumber(0);
  1119 + }
1127 1120 }
1128 1121  
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;
1149   - }
  1122 + if (CollectionUtils.isNotEmpty(babyModelList)) {
  1123 + String pregnancyOut = "";
  1124 + String sex = "";
  1125 + String babyWeight = "";
  1126 + String babyHeight = "";
  1127 + String apgarScorePf1 = "";
  1128 + String apgarScorePf5 = "";
  1129 + String apgarScorePf10 = "";
  1130 + String asphyxiaM = "";
  1131 + String babyHealthy = "";
  1132 + String malformation = "";
  1133 + try {
  1134 + for (BabyModel babyModel : babyModelList) {
  1135 + if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut")) {
  1136 + for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) {
  1137 + if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) {
  1138 + pregnancyOut += renShenJieJuEnums.getName() + ",";
  1139 + break;
1150 1140 }
1151 1141 }
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;
1157   - }
  1142 + }
  1143 + if (childbirthManagerRequest.getInitQuery().contains("sex")) {
  1144 + for (SexEnum sexEnum : SexEnum.values()) {
  1145 + if (sexEnum.getId().equals(babyModel.getSex())) {
  1146 + sex += sexEnum.getText() + ",";
  1147 + break;
1158 1148 }
1159 1149 }
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   - }
1171 1150 }
1172   - } catch (Exception e) {
1173   - // 什么都不干,这么干是为了避开原始数据的问题
  1151 + babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ",";
  1152 + babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ",";
  1153 + asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ",";
  1154 + babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ",";
  1155 + malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ",";
  1156 + Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore());
  1157 + if (MapUtils.isNotEmpty(map)) {
  1158 + apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ",";
  1159 + apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ",";
  1160 + apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ",";
  1161 + }
1174 1162 }
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));
  1163 + } catch (Exception e) {
  1164 + // 什么都不干,这么干是为了避开原始数据的问题
1185 1165 }
  1166 + childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1));
  1167 + childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1));
  1168 + childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1));
  1169 + childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1));
  1170 + childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1));
  1171 + childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1));
  1172 + childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1));
  1173 + childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1));
  1174 + childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1));
  1175 + childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1));
1186 1176 }
  1177 + }
  1178 +
  1179 + if (maternalDeliverModel != null) {
  1180 + // 会阴情况
  1181 + if (childbirthManagerRequest.getInitQuery().contains("perinealCondition")) {
  1182 + if (StringUtils.isNotEmpty(maternalDeliverModel.getPerinealCondition())) {
  1183 + if ("split".equals(maternalDeliverModel.getPerinealCondition())) {
  1184 + childbirthManagerQueryModel.setPerinealCondition("切开");
  1185 + } else if ("full".equals(maternalDeliverModel.getPerinealCondition())) {
  1186 + childbirthManagerQueryModel.setPerinealCondition("完整");
  1187 + } else {
  1188 + childbirthManagerQueryModel.setPerinealCondition("-");
  1189 + }
  1190 + }
  1191 + }
  1192 +
  1193 + // 失血原因
  1194 + if (childbirthManagerRequest.getInitQuery().contains("loseBloodCause")) {
  1195 + String loseBloodCauseJson = maternalDeliverModel.getLoseBloodCause();
  1196 + Map<String, String> loseBloodCauseMap = JsonUtil.getMap(loseBloodCauseJson);
  1197 + if (MapUtils.isNotEmpty(loseBloodCauseMap) && StringUtils.isNotEmpty(loseBloodCauseMap.get("select"))) {
  1198 + for (SXCauseEnums sxCauseEnums : SXCauseEnums.values()) {
  1199 + if (sxCauseEnums.getId().equals(loseBloodCauseMap.get("select"))) {
  1200 + childbirthManagerQueryModel.setLoseBloodCause(sxCauseEnums.getName());
  1201 + break;
  1202 + }
  1203 + }
  1204 + if (SXCauseEnums.O5.getName().equals(childbirthManagerQueryModel.getLoseBloodCause()) && StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) {
  1205 + childbirthManagerQueryModel.setLoseBloodCause(loseBloodCauseMap.get("other"));
  1206 + }
  1207 + } else {
  1208 + childbirthManagerQueryModel.setDeliveryMode("");
  1209 + }
  1210 + }
  1211 +
  1212 + // 查询分娩方式
  1213 + childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId());
  1214 + if (childbirthManagerRequest.getInitQuery().contains("deliveryMode")) {
  1215 + String deliveryModeJson = maternalDeliverModel.getDeliveryMode();
  1216 + Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson);
  1217 + if (MapUtils.isNotEmpty(deliveryModeMap) && StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) {
  1218 + for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) {
  1219 + if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) {
  1220 + childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName());
  1221 + break;
  1222 + }
  1223 + }
  1224 + } else {
  1225 + childbirthManagerQueryModel.setDeliveryMode("");
  1226 + }
  1227 + }
  1228 +
  1229 + // 产妇情况
  1230 + if (childbirthManagerRequest.getInitQuery().contains("maternalInfo")) {
  1231 + if (StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) {
  1232 + for (CfEnums cfEnums : CfEnums.values()) {
  1233 + if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) {
  1234 + childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName());
  1235 + break;
  1236 + }
  1237 + }
  1238 + }
  1239 + }
  1240 +
  1241 + // 查询接生医生
1187 1242 try {
  1243 + if (childbirthManagerRequest.getInitQuery().contains("deliverDoctor")) {
  1244 + childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName());
  1245 + }
  1246 + } catch (Exception e) {
  1247 + // 什么都不干,这么干是为了避开原始数据的问题
  1248 + }
  1249 +
  1250 + // 查分娩医院
  1251 + try {
1188 1252 if (childbirthManagerRequest.getInitQuery().contains("fmHospital")) {
1189 1253 childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName());
1190 1254 }
1191 1255  
1192 1256  
1193 1257  
1194 1258  
1195 1259  
1196 1260  
1197 1261  
1198 1262  
1199 1263  
1200 1264  
1201 1265  
1202 1266  
1203 1267  
1204 1268  
1205 1269  
1206 1270  
1207 1271  
... ... @@ -1192,123 +1256,148 @@
1192 1256 // 什么都不干,这么干是为了避开原始数据的问题
1193 1257 }
1194 1258  
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;
1215   - }
1216   - }
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)) {
  1259 + // 胎方位,胎心率,胎先露
  1260 + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition") || childbirthManagerRequest.getInitQuery().contains("heartRate") || childbirthManagerRequest.getInitQuery().contains("fetalPresentation")) {
  1261 + // 这个泛型不会出错,传入的就是这个
  1262 + @SuppressWarnings("unchecked")
  1263 + List<MatDeliverAddRequest.Placenta> placentaList = maternalDeliverModel.getPlacentas();
  1264 + if (CollectionUtils.isNotEmpty(placentaList)) {
  1265 + String fetalPosition = "";
  1266 + String heartRate = "";
  1267 + String fetalPresentation = "";
  1268 + for (Object obj : placentaList) {
  1269 + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) {
  1270 + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj;
  1271 + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) {
1225 1272 for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
1226   - if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
  1273 + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
1227 1274 fetalPosition += fetalPositionEnums.getName() + ",";
1228 1275 break;
1229 1276 }
1230 1277 }
1231   - heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
1232   - fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ",";
1233 1278 }
  1279 + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ",";
  1280 + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ",";
1234 1281 }
  1282 + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) {
  1283 + Map<String, String> placenta = JsonUtil.getMap(obj.toString());
  1284 + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) {
  1285 + if (MapUtils.isNotEmpty(placenta)) {
  1286 + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
  1287 + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
  1288 + fetalPosition += fetalPositionEnums.getName() + ",";
  1289 + break;
  1290 + }
  1291 + }
  1292 + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
  1293 + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ",";
  1294 + }
  1295 + }
  1296 + }
1235 1297 }
  1298 + childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1));
  1299 + childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1));
  1300 + childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1));
1236 1301 }
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 1302 }
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"));
  1303 +
  1304 + // 第一产程,第二产程,第三产程
  1305 + Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess());
  1306 + if (MapUtils.isNotEmpty(prodprocessMap)) {
  1307 + Map<String, String> prodprocessOne = prodprocessMap.get("one");
  1308 + if (MapUtils.isNotEmpty(prodprocessOne)) {
  1309 + childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分");
  1310 + }
  1311 + Map<String, String> prodprocessTwo = prodprocessMap.get("two");
  1312 + if (MapUtils.isNotEmpty(prodprocessTwo)) {
  1313 + childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分");
  1314 + }
  1315 + Map<String, String> prodprocessThree = prodprocessMap.get("three");
  1316 + if (MapUtils.isNotEmpty(prodprocessThree)) {
  1317 + childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分");
  1318 + }
1248 1319 }
1249   - Map<String, String> prodprocessTwo = prodprocessMap.get("two");
1250   - if (MapUtils.isNotEmpty(prodprocessTwo)) {
1251   - childbirthManagerQueryModel.setProdprocessTwo("h:" + prodprocessTwo.get("h") + "," + "m:" + prodprocessTwo.get("m"));
  1320 +
  1321 + // 总产程
  1322 + Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess());
  1323 + if (MapUtils.isNotEmpty(totalprocessMap)) {
  1324 + childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分");
1252 1325 }
1253   - Map<String, String> prodprocessThree = prodprocessMap.get("three");
1254   - if (MapUtils.isNotEmpty(prodprocessThree)) {
1255   - childbirthManagerQueryModel.setProdprocessThree("h:" + prodprocessThree.get("h") + "," + "m:" + prodprocessThree.get("m"));
  1326 +
  1327 + // 收缩压,舒张压
  1328 + Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp());
  1329 + if (MapUtils.isNotEmpty(chBpMap)) {
  1330 + childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy"));
  1331 + childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy"));
  1332 +
1256 1333 }
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;
  1334 + // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型
  1335 + 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")) {
  1336 + List<MaternalDeliverModel.ExtPlacenta> extPlacentaList = maternalDeliverModel.getExtPlacentas();
  1337 + if (CollectionUtils.isNotEmpty(extPlacentaList)) {
  1338 + String tpmcType = "";
  1339 + String tpSize = "";
  1340 + String tpWeight = "";
  1341 + String umbilicalCordLength = "";
  1342 + String umbilicalCordEx = "";
  1343 + String umbilicalCordExType = "";
  1344 + try {
  1345 + for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) {
  1346 + if (childbirthManagerRequest.getInitQuery().contains("tpmcType")) {
  1347 + for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) {
  1348 + if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) {
  1349 + tpmcType += tpmcTypeEnums.getName() + ",";
  1350 + break;
  1351 + }
1286 1352 }
1287 1353 }
  1354 + if (childbirthManagerRequest.getInitQuery().contains("umbilicalCordExType")) {
  1355 + String umbilicalCordExTypeTemp = "";
  1356 + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()) {
  1357 + if (qiDaiEnums.getId().equals(extPlacenta.getUmbilicalCordExType())) {
  1358 + umbilicalCordExTypeTemp = qiDaiEnums.getName() + ",";
  1359 + break;
  1360 + }
  1361 + }
  1362 + if (StringUtils.isEmpty(umbilicalCordExTypeTemp)) {
  1363 + umbilicalCordExTypeTemp = "-,";
  1364 + }
  1365 + umbilicalCordExType += umbilicalCordExTypeTemp;
  1366 + }
  1367 + if (childbirthManagerRequest.getInitQuery().contains("umbilicalCordEx")) {
  1368 + if ("yes".equals(extPlacenta.getUmbilicalCordEx())) {
  1369 + umbilicalCordEx += "是" + ",";
  1370 + } else if ("no".equals(extPlacenta.getUmbilicalCordEx())) {
  1371 + umbilicalCordEx += "否" + ",";
  1372 + } else {
  1373 + umbilicalCordEx += "-" + ",";
  1374 + }
  1375 + }
  1376 + if (childbirthManagerRequest.getInitQuery().contains("tpSize")) {
  1377 + if (MapUtils.isNotEmpty(extPlacenta.getTpSize())) {
  1378 + tpSize += "长:" + extPlacenta.getTpSize().get("c") + "宽:" + extPlacenta.getTpSize().get("k") + "高:" + extPlacenta.getTpSize().get("g") + ",";
  1379 + }
  1380 + }
  1381 + tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ",";
  1382 + umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ",";
1288 1383 }
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() + ",";
  1384 + } catch (Exception e) {
  1385 + // 什么都不干,这么干是为了避开原始数据的问题
1294 1386 }
1295   - } catch (Exception e) {
1296   - // 什么都不干,这么干是为了避开原始数据的问题
  1387 + childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1));
  1388 + childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1));
  1389 + childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1));
  1390 + childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1));
  1391 + childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1));
  1392 + childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1));
1297 1393 }
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));
1304 1394 }
1305 1395 }
1306   - // 拼装自定义查询结果结束
1307 1396  
1308 1397 childbirthManagerQueryModelList.add(childbirthManagerQueryModel);
1309   -
1310   -
1311 1398 }
  1399 + // 拼装自定义查询结果结束
  1400 +
1312 1401  
1313 1402 childbirthManagerResult.setData(childbirthManagerQueryModelList);
1314 1403 childbirthManagerResult.setPageInfo(patientsQuery.getPageInfo());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java View file @ 9deff97
... ... @@ -417,7 +417,7 @@
417 417 initQueryMap.put("fmHospital", "分娩机构");
418 418 initQueryMap.put("maternalDeliverId", "");
419 419 initQueryMap.put("patientId", "");
420   - initQueryMap.put("pId", "");
  420 + initQueryMap.put("pid", "");
421 421 Map<String, String> normalQueryMap = new LinkedHashMap<>();
422 422 normalQueryMap.put("dueDate", "分娩日期");
423 423 normalQueryMap.put("name", "姓名");
... ... @@ -432,7 +432,7 @@
432 432 normalQueryMap.put("phone", "联系方式");
433 433 normalQueryMap.put("maternalDeliverId", "");
434 434 normalQueryMap.put("patientId", "");
435   - normalQueryMap.put("pId", "");
  435 + normalQueryMap.put("pid", "");
436 436 Map<String, String> areaQueryMap = new LinkedHashMap<>();
437 437 areaQueryMap.put("dueDate", "分娩日期");
438 438 areaQueryMap.put("name", "姓名");
... ... @@ -447,7 +447,7 @@
447 447 areaQueryMap.put("fmHospital", "分娩机构");
448 448 areaQueryMap.put("maternalDeliverId", "");
449 449 areaQueryMap.put("patientId", "");
450   - areaQueryMap.put("pId", "");
  450 + areaQueryMap.put("pid", "");
451 451 this.initQueryMap = initQueryMap;
452 452 this.normalQueryMap = normalQueryMap;
453 453 this.areaQueryMap = areaQueryMap;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java View file @ 9deff97
... ... @@ -12,7 +12,7 @@
12 12  
13 13 private String patientId;
14 14  
15   - private String pId;
  15 + private String pid;
16 16  
17 17 /**
18 18 * @auther HuJiaqi
19 19  
... ... @@ -416,12 +416,12 @@
416 416 this.patientId = patientId;
417 417 }
418 418  
419   - public String getpId() {
420   - return pId;
  419 + public String getPid() {
  420 + return pid;
421 421 }
422 422  
423   - public void setpId(String pId) {
424   - this.pId = pId;
  423 + public void setPid(String pid) {
  424 + this.pid = pid;
425 425 }
426 426  
427 427 public String getDueDate() {