diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java index 722325b..24a5507 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java @@ -510,6 +510,60 @@ public class TestController { return "syncPatientsLastCheckEmployeeId start......"; } + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 15时56分 + * @discription 冗余分娩分娩医院,分娩年龄,分娩孕周,分娩方式 + */ + @ResponseBody + @RequestMapping(value = "/syncPatientsFmInfo1", method = RequestMethod.GET) + public String syncPatientsFmInfo1(@RequestParam(required = false) String size) { + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setYn(YnEnums.YES.getId()); + patientsQuery.setType(3); + // 查询 + List patientsList = patientsService.queryPatient(patientsQuery); + System.out.println("本次读取了【" + patientsList.size() + "】条数据"); + int batchSize = StringUtils.isEmpty(size) ? 1000 : Integer.valueOf(size); + int end = 0; + for (int i = 0; i < patientsList.size(); i += batchSize) { + end = (end + batchSize); + if (end > patientsList.size()) { + end = patientsList.size(); + } + final List tempList = patientsList.subList(i, end); + new Thread(new Runnable() { + @Override + public void run() { + if (CollectionUtils.isNotEmpty(tempList)) { + for (Patients patients : tempList) { + + try { + patients.setFmAge(DateUtil.getAge(patients.getBirth(), patients.getFmDate())); + } catch (Exception e) { + System.out.println(patients.getId() + ":这条数据的生日和分娩时间异常"); + // 跳过 + } + try { + patients.setFmWeek(DateUtil.getDays(patients.getLastMenses(), patients.getFmDate())); + } catch (Exception e) { + System.out.println(patients.getId() + ":这条数据的末日月经和分娩时间异常"); + // 跳过 + } + + + System.out.println(patients.getFmAge()); + System.out.println(patients.getFmWeek()); + + patientsService.updatePatient(patients); + } + } + } + }).start(); + } + return "syncPatientsLastCheckEmployeeId start......"; + } + @RequestMapping(value = "/initCardNo", method = RequestMethod.GET) @ResponseBody public String initCardNo() { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index bcfc76a..1b5c530 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -1041,12 +1041,6 @@ public class MatDeliverFacade { matDeliverQuery.setParentIdList(parentIdList); matDeliverQuery.setYn(YnEnums.YES.getId()); List maternalDeliverModelList = matDeliverService.query(matDeliverQuery); - if (CollectionUtils.isEmpty(maternalDeliverModelList)) { - // 没有查到,直接抛出 - childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); - childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); - return childbirthManagerResult; - } List childbirthManagerQueryModelList = new ArrayList<>(); for (Patients patients : patientsList) { @@ -1059,16 +1053,24 @@ public class MatDeliverFacade { maternalDeliverModel = new MaternalDeliverModel(); } } - // 这里分好了组,开始往结果集里面加数据 + + // 开始封装数据 ChildbirthManagerQueryModel childbirthManagerQueryModel = new ChildbirthManagerQueryModel(); + if (maternalDeliverModel != null) { + BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel); + } BeanUtils.copy(patients, childbirthManagerQueryModel); - BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel); + // 分娩孕周 + String week = (patients.getFmWeek() / 7) + ""; + int day = (patients.getFmWeek() % 7); + childbirthManagerQueryModel.setDueWeek("孕" + week + "周" + (day > 0 ? "+" + day + "天" : "")); + // 分娩日期 + childbirthManagerQueryModel.setDueDate(DateUtil.getyyyy_MM_dd(patients.getFmDate())); // name childbirthManagerQueryModel.setName(patients.getUsername()); // 各种id - childbirthManagerQueryModel.setpId(maternalDeliverModel.getPid()); + childbirthManagerQueryModel.setPid(patients.getPid()); childbirthManagerQueryModel.setPatientId(patients.getId()); - childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); // 居住地 if (childbirthManagerRequest.getInitQuery().contains("address")) { childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); @@ -1078,43 +1080,30 @@ public class MatDeliverFacade { childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone())); // 加密身份证号 childbirthManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo())); - // 查询分娩方式 - if (childbirthManagerRequest.getInitQuery().contains("deliveryMode")) { - String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); - Map deliveryModeMap = JsonUtil.getMap(deliveryModeJson); - if (MapUtils.isNotEmpty(deliveryModeMap) && StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) { - for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) { - if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) { - childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName()); - break; - } - } - } else { - childbirthManagerQueryModel.setDeliveryMode(""); - } - } - // 产妇情况 - if (childbirthManagerRequest.getInitQuery().contains("maternalInfo")) { - if (StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) { - for (CfEnums cfEnums : CfEnums.values()) { - if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) { - childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName()); - break; - } - } + // 年龄 + childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); + + // 居住类型 + if (childbirthManagerRequest.getInitQuery().contains("pliveTypeId")) { + try { + childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById("pliveTypeId").getName()); + } catch (Exception e) { + // 什么都不干 } } - // 查询接生医生 - try { - if (childbirthManagerRequest.getInitQuery().contains("deliverDoctor")) { - childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); + + // 户口类型 + if (childbirthManagerRequest.getInitQuery().contains("pcensusTypeId")) { + try { + childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById("pcensusTypeId").getName()); + } catch (Exception e) { + // 什么都不干 } - } catch (Exception e) { - // 什么都不干,这么干是为了避开原始数据的问题 } - childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); + // 查询活产数 - if (childbirthManagerRequest.getInitQuery().contains("livingNumber")) { + // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形 + 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")) { BabyModelQuery babyModelQuery = new BabyModelQuery(); babyModelQuery.setYn(YnEnums.YES.getId()); babyModelQuery.setParentId(patients.getId()); @@ -1123,67 +1112,142 @@ public class MatDeliverFacade { if (CollectionUtils.isNotEmpty(babyModelList)) { childbirthManagerQueryModel.setLivingNumber(babyModelList.size()); } else { - childbirthManagerQueryModel.setLivingNumber(0); + if (childbirthManagerQueryModel.getTireNumber() == null) { + childbirthManagerQueryModel.setLivingNumber(null); + } else { + childbirthManagerQueryModel.setLivingNumber(0); + } } - // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形 - 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")) { - if (CollectionUtils.isNotEmpty(babyModelList)) { - String pregnancyOut = ""; - String sex = ""; - String babyWeight = ""; - String babyHeight = ""; - String apgarScorePf1 = ""; - String apgarScorePf5 = ""; - String apgarScorePf10 = ""; - String asphyxiaM = ""; - String babyHealthy = ""; - String malformation = ""; - try { - for (BabyModel babyModel : babyModelList) { - if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut")) { - for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) { - if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) { - pregnancyOut += renShenJieJuEnums.getName() + ","; - break; - } + if (CollectionUtils.isNotEmpty(babyModelList)) { + String pregnancyOut = ""; + String sex = ""; + String babyWeight = ""; + String babyHeight = ""; + String apgarScorePf1 = ""; + String apgarScorePf5 = ""; + String apgarScorePf10 = ""; + String asphyxiaM = ""; + String babyHealthy = ""; + String malformation = ""; + try { + for (BabyModel babyModel : babyModelList) { + if (childbirthManagerRequest.getInitQuery().contains("pregnancyOut")) { + for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) { + if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) { + pregnancyOut += renShenJieJuEnums.getName() + ","; + break; } } - if (childbirthManagerRequest.getInitQuery().contains("sex")) { - for (SexEnum sexEnum : SexEnum.values()) { - if (sexEnum.getId().equals(babyModel.getSex())) { - sex += sexEnum.getText() + ","; - break; - } + } + if (childbirthManagerRequest.getInitQuery().contains("sex")) { + for (SexEnum sexEnum : SexEnum.values()) { + if (sexEnum.getId().equals(babyModel.getSex())) { + sex += sexEnum.getText() + ","; + break; } } - babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ","; - babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ","; - asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ","; - babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ","; - malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ","; - Map map = JsonUtil.getMap(babyModel.getApgarScore()); - if (MapUtils.isNotEmpty(map)) { - apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ","; - apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ","; - apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ","; - } } - } catch (Exception e) { - // 什么都不干,这么干是为了避开原始数据的问题 + babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ","; + babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ","; + asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ","; + babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ","; + malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ","; + Map map = JsonUtil.getMap(babyModel.getApgarScore()); + if (MapUtils.isNotEmpty(map)) { + apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ","; + apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ","; + apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ","; + } } - childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1)); - childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1)); - childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1)); - childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1)); - childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1)); - childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1)); - childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1)); - childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1)); - childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1)); - childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1)); + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 } + childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1)); + childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1)); + childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1)); + childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1)); + childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1)); + childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1)); + childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1)); + childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1)); + childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1)); + childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1)); } + } + + if (maternalDeliverModel != null) { + // 会阴情况 + if (childbirthManagerRequest.getInitQuery().contains("perinealCondition")) { + if (StringUtils.isNotEmpty(maternalDeliverModel.getPerinealCondition())) { + if ("split".equals(maternalDeliverModel.getPerinealCondition())) { + childbirthManagerQueryModel.setPerinealCondition("切开"); + } else if ("full".equals(maternalDeliverModel.getPerinealCondition())) { + childbirthManagerQueryModel.setPerinealCondition("完整"); + } else { + childbirthManagerQueryModel.setPerinealCondition("-"); + } + } + } + + // 失血原因 + if (childbirthManagerRequest.getInitQuery().contains("loseBloodCause")) { + String loseBloodCauseJson = maternalDeliverModel.getLoseBloodCause(); + Map loseBloodCauseMap = JsonUtil.getMap(loseBloodCauseJson); + if (MapUtils.isNotEmpty(loseBloodCauseMap) && StringUtils.isNotEmpty(loseBloodCauseMap.get("select"))) { + for (SXCauseEnums sxCauseEnums : SXCauseEnums.values()) { + if (sxCauseEnums.getId().equals(loseBloodCauseMap.get("select"))) { + childbirthManagerQueryModel.setLoseBloodCause(sxCauseEnums.getName()); + break; + } + } + if (SXCauseEnums.O5.getName().equals(childbirthManagerQueryModel.getLoseBloodCause()) && StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) { + childbirthManagerQueryModel.setLoseBloodCause(loseBloodCauseMap.get("other")); + } + } else { + childbirthManagerQueryModel.setDeliveryMode(""); + } + } + + // 查询分娩方式 + childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); + if (childbirthManagerRequest.getInitQuery().contains("deliveryMode")) { + String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); + Map deliveryModeMap = JsonUtil.getMap(deliveryModeJson); + if (MapUtils.isNotEmpty(deliveryModeMap) && StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) { + for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) { + if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) { + childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName()); + break; + } + } + } else { + childbirthManagerQueryModel.setDeliveryMode(""); + } + } + + // 产妇情况 + if (childbirthManagerRequest.getInitQuery().contains("maternalInfo")) { + if (StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) { + for (CfEnums cfEnums : CfEnums.values()) { + if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) { + childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName()); + break; + } + } + } + } + + // 查询接生医生 + try { + if (childbirthManagerRequest.getInitQuery().contains("deliverDoctor")) { + childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); + } + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 + } + + // 查分娩医院 try { if (childbirthManagerRequest.getInitQuery().contains("fmHospital")) { childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName()); @@ -1192,123 +1256,148 @@ public class MatDeliverFacade { // 什么都不干,这么干是为了避开原始数据的问题 } - } - - // 开始拼装自定义查询结果 - // 胎方位,胎心率,胎先露 - if (childbirthManagerRequest.getInitQuery().contains("fetalPosition") || childbirthManagerRequest.getInitQuery().contains("heartRate") || childbirthManagerRequest.getInitQuery().contains("fetalPresentation")) { - // 这个泛型不会出错,传入的就是这个 - @SuppressWarnings("unchecked") - List placentaList = maternalDeliverModel.getPlacentas(); - if (CollectionUtils.isNotEmpty(placentaList)) { - String fetalPosition = ""; - String heartRate = ""; - String fetalPresentation = ""; - for (Object obj : placentaList) { - if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { - MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; - if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { - if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { - fetalPosition += fetalPositionEnums.getName() + ","; - break; - } - } - } - heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ","; - fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ","; - } - if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { - Map placenta = JsonUtil.getMap(obj.toString()); - if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { - if (MapUtils.isNotEmpty(placenta)) { + // 胎方位,胎心率,胎先露 + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition") || childbirthManagerRequest.getInitQuery().contains("heartRate") || childbirthManagerRequest.getInitQuery().contains("fetalPresentation")) { + // 这个泛型不会出错,传入的就是这个 + @SuppressWarnings("unchecked") + List placentaList = maternalDeliverModel.getPlacentas(); + if (CollectionUtils.isNotEmpty(placentaList)) { + String fetalPosition = ""; + String heartRate = ""; + String fetalPresentation = ""; + for (Object obj : placentaList) { + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { - if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { fetalPosition += fetalPositionEnums.getName() + ","; break; } } - heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ","; - fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ","; + } + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ","; + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ","; + } + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { + Map placenta = JsonUtil.getMap(obj.toString()); + if (childbirthManagerRequest.getInitQuery().contains("fetalPosition")) { + if (MapUtils.isNotEmpty(placenta)) { + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { + fetalPosition += fetalPositionEnums.getName() + ","; + break; + } + } + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ","; + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation") + ","; + } } } } + childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1)); + childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1)); + childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1)); } - childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1)); - childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1)); - childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1)); } - } - // 第一产程,第二产程,第三产程 - Map> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess()); - if (MapUtils.isNotEmpty(prodprocessMap)) { - Map prodprocessOne = prodprocessMap.get("one"); - if (MapUtils.isNotEmpty(prodprocessOne)) { - childbirthManagerQueryModel.setProdprocessOne("h:" + prodprocessOne.get("h") + "," + "m:" + prodprocessOne.get("m")); + + // 第一产程,第二产程,第三产程 + Map> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess()); + if (MapUtils.isNotEmpty(prodprocessMap)) { + Map prodprocessOne = prodprocessMap.get("one"); + if (MapUtils.isNotEmpty(prodprocessOne)) { + childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分"); + } + Map prodprocessTwo = prodprocessMap.get("two"); + if (MapUtils.isNotEmpty(prodprocessTwo)) { + childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分"); + } + Map prodprocessThree = prodprocessMap.get("three"); + if (MapUtils.isNotEmpty(prodprocessThree)) { + childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分"); + } } - Map prodprocessTwo = prodprocessMap.get("two"); - if (MapUtils.isNotEmpty(prodprocessTwo)) { - childbirthManagerQueryModel.setProdprocessTwo("h:" + prodprocessTwo.get("h") + "," + "m:" + prodprocessTwo.get("m")); + + // 总产程 + Map totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess()); + if (MapUtils.isNotEmpty(totalprocessMap)) { + childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"); } - Map prodprocessThree = prodprocessMap.get("three"); - if (MapUtils.isNotEmpty(prodprocessThree)) { - childbirthManagerQueryModel.setProdprocessThree("h:" + prodprocessThree.get("h") + "," + "m:" + prodprocessThree.get("m")); + + // 收缩压,舒张压 + Map chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp()); + if (MapUtils.isNotEmpty(chBpMap)) { + childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy")); + childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy")); + } - } - // 总产程 - Map totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess()); - if (MapUtils.isNotEmpty(totalprocessMap)) { - childbirthManagerQueryModel.setTotalprocess("h:" + totalprocessMap.get("h") + "," + "m:" + totalprocessMap.get("m")); - } - // 收缩压,舒张压 - Map chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp()); - if (MapUtils.isNotEmpty(chBpMap)) { - childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy")); - childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy")); - } - // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型 - 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")) { - List extPlacentaList = maternalDeliverModel.getExtPlacentas(); - if (CollectionUtils.isNotEmpty(extPlacentaList)) { - String tpmcType = ""; - String tpSize = ""; - String tpWeight = ""; - String umbilicalCordLength = ""; - String umbilicalCordEx = ""; - String umbilicalCordExType = ""; - try { - for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) { - if (childbirthManagerRequest.getInitQuery().contains("tpmcType")) { - for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) { - if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) { - tpmcType += tpmcTypeEnums.getName() + ","; - break; + // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型 + 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")) { + List extPlacentaList = maternalDeliverModel.getExtPlacentas(); + if (CollectionUtils.isNotEmpty(extPlacentaList)) { + String tpmcType = ""; + String tpSize = ""; + String tpWeight = ""; + String umbilicalCordLength = ""; + String umbilicalCordEx = ""; + String umbilicalCordExType = ""; + try { + for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) { + if (childbirthManagerRequest.getInitQuery().contains("tpmcType")) { + for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) { + if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) { + tpmcType += tpmcTypeEnums.getName() + ","; + break; + } + } + } + if (childbirthManagerRequest.getInitQuery().contains("umbilicalCordExType")) { + String umbilicalCordExTypeTemp = ""; + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()) { + if (qiDaiEnums.getId().equals(extPlacenta.getUmbilicalCordExType())) { + umbilicalCordExTypeTemp = qiDaiEnums.getName() + ","; + break; + } + } + if (StringUtils.isEmpty(umbilicalCordExTypeTemp)) { + umbilicalCordExTypeTemp = "-,"; + } + umbilicalCordExType += umbilicalCordExTypeTemp; + } + if (childbirthManagerRequest.getInitQuery().contains("umbilicalCordEx")) { + if ("yes".equals(extPlacenta.getUmbilicalCordEx())) { + umbilicalCordEx += "是" + ","; + } else if ("no".equals(extPlacenta.getUmbilicalCordEx())) { + umbilicalCordEx += "否" + ","; + } else { + umbilicalCordEx += "-" + ","; + } + } + if (childbirthManagerRequest.getInitQuery().contains("tpSize")) { + if (MapUtils.isNotEmpty(extPlacenta.getTpSize())) { + tpSize += "长:" + extPlacenta.getTpSize().get("c") + "宽:" + extPlacenta.getTpSize().get("k") + "高:" + extPlacenta.getTpSize().get("g") + ","; } } + tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ","; + umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ","; } - tpSize += extPlacenta.getTpSize() == null ? "" : extPlacenta.getTpSize() + ","; - tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ","; - umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ","; - umbilicalCordEx += extPlacenta.getUmbilicalCordEx() == null ? "" : extPlacenta.getUmbilicalCordEx() + ","; - umbilicalCordExType += extPlacenta.getUmbilicalCordExType() == null ? "" : extPlacenta.getUmbilicalCordExType() + ","; + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 } - } catch (Exception e) { - // 什么都不干,这么干是为了避开原始数据的问题 + childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1)); + childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1)); + childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1)); + childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1)); + childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1)); + childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1)); } - childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1)); - childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1)); - childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1)); - childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1)); - childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1)); - childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1)); } } - // 拼装自定义查询结果结束 childbirthManagerQueryModelList.add(childbirthManagerQueryModel); - - } + // 拼装自定义查询结果结束 + childbirthManagerResult.setData(childbirthManagerQueryModelList); childbirthManagerResult.setPageInfo(patientsQuery.getPageInfo()); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java index 37e26ff..4c0aa8a 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java @@ -417,7 +417,7 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { initQueryMap.put("fmHospital", "分娩机构"); initQueryMap.put("maternalDeliverId", ""); initQueryMap.put("patientId", ""); - initQueryMap.put("pId", ""); + initQueryMap.put("pid", ""); Map normalQueryMap = new LinkedHashMap<>(); normalQueryMap.put("dueDate", "分娩日期"); normalQueryMap.put("name", "姓名"); @@ -432,7 +432,7 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { normalQueryMap.put("phone", "联系方式"); normalQueryMap.put("maternalDeliverId", ""); normalQueryMap.put("patientId", ""); - normalQueryMap.put("pId", ""); + normalQueryMap.put("pid", ""); Map areaQueryMap = new LinkedHashMap<>(); areaQueryMap.put("dueDate", "分娩日期"); areaQueryMap.put("name", "姓名"); @@ -447,7 +447,7 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { areaQueryMap.put("fmHospital", "分娩机构"); areaQueryMap.put("maternalDeliverId", ""); areaQueryMap.put("patientId", ""); - areaQueryMap.put("pId", ""); + areaQueryMap.put("pid", ""); this.initQueryMap = initQueryMap; this.normalQueryMap = normalQueryMap; this.areaQueryMap = areaQueryMap; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java index 6c865cd..629cb3f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java @@ -12,7 +12,7 @@ public class ChildbirthManagerQueryModel { private String patientId; - private String pId; + private String pid; /** * @auther HuJiaqi @@ -416,12 +416,12 @@ public class ChildbirthManagerQueryModel { this.patientId = patientId; } - public String getpId() { - return pId; + public String getPid() { + return pid; } - public void setpId(String pId) { - this.pId = pId; + public void setPid(String pid) { + this.pid = pid; } public String getDueDate() {