diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/DeathCauseEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/DeathCauseEnums.java index 773788b..75ef043 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/enums/DeathCauseEnums.java +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/DeathCauseEnums.java @@ -1,5 +1,7 @@ package com.lyms.platform.common.enums; +import org.apache.commons.lang.StringUtils; + /** * 死亡原因 *

@@ -16,6 +18,18 @@ public enum DeathCauseEnums { private String id; private String name; + public static String getName(String id){ + if (StringUtils.isNotEmpty(id)){ + for (DeathCauseEnums deathCauseEnums : DeathCauseEnums.values()){ + if (deathCauseEnums.getId().equals(id)){ + return deathCauseEnums.getName(); + } + } + } + return ""; + } + + public String getId() { return id; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java index 0ba7c94..d2dfbb6 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java @@ -260,7 +260,7 @@ public class ViewFacade { map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI)); map.put("phone",patients.getPhone()); //基本信息孕周 - map.put("fmWeek", ResolveUtils.getPregnancyWeek(patients.getLastMenses(),new Date())); + map.put("fmWeek", patients.getPhone()); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); @@ -589,7 +589,7 @@ public class ViewFacade { map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()), UnitConstants.SUI)); map.put("phone",patients.getPhone()); - map.put("fmWeek", ResolveUtils.getPregnancyWeek(patients.getLastMenses(), new Date())); + map.put("fmWeek", patients.getPhone()); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); @@ -703,6 +703,20 @@ public class ViewFacade { } + public static String checkWeek(Patients patients){ + + if (patients.getDueStatus()!=null && patients.getDueStatus()==1){ + return "终止妊娠"; + }else if (patients.getType()!=null && patients.getType() == 3){ + return "已分娩"; + }else if (patients.getLastMenses()!=null){ + return ResolveUtils.getPregnancyWeek(patients.getLastMenses(), new Date()); + } + return ""; + } + + + /** * 分娩查询 * @param id @@ -746,7 +760,7 @@ public class ViewFacade { map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI)); map.put("phone",patients.getPhone()); - map.put("fmWeek",patients.getFmWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(patients.getFmWeek())); + map.put("fmWeek",checkWeek(patients)); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); @@ -757,7 +771,7 @@ public class ViewFacade { } map.put("riskFactor", ResolveUtils.queryHighRisk(highScoreResult)); - map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); + map.put("riskScore", patients.getRiskScore() == 0 ? "" : UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); map.put("deliveryDate", data.getDueDate()); map.put("dueWeek", data.getDueWeek()); @@ -816,6 +830,9 @@ public class ViewFacade { fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation(); //胎心率 heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString(); + //转换为整数 + Integer a = (int)Double.parseDouble(heartRate); + heartRate = String.valueOf(a); } @@ -831,6 +848,9 @@ public class ViewFacade { } } heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate"); + Integer a = (int)Double.parseDouble(heartRate); + heartRate = String.valueOf(a); + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation"); } } @@ -872,7 +892,11 @@ public class ViewFacade { } } map.put("deliveryMode", deliveryMode);//分娩方式 - map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause()); + if (deliveryMode.contains("顺产")){ + map.put("operationCause", ""); + }else { + map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause()); + } findProcess(data.getProdprocess(), map);//1,2,3产程 findTotalProcess(data.getTotalprocess(),map);//总产程 @@ -885,7 +909,7 @@ public class ViewFacade { /* 产后生理 */ map.put("maternalInfo", data.getMaternalInfo()==null?"":CfEnums.getTitle(data.getMaternalInfo())); - map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause()); + map.put("deathCause", com.lyms.platform.common.utils.StringUtils.isEmpty(data.getDeathCause()) ? "--" : DeathCauseEnums.getName(data.getDeathCause())); // 产后血压 收缩压,舒张压 String ssy = ""; String szy = ""; @@ -925,7 +949,7 @@ public class ViewFacade { loseBloodCause = sxCauseEnums.getName(); } } - if (SXCauseEnums.O5.getName().equals(data.getLoseBloodCause()) && StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) { + if (SXCauseEnums.O5.getName().equals(loseBloodCause) && StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) { loseBloodCause = loseBloodCauseMap.get("other"); } } @@ -943,10 +967,20 @@ public class ViewFacade { if (CollectionUtils.isNotEmpty(data.getExtPlacentas())){ for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){ Map extMap = new HashMap<>(); - extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType())); + String tpmcType = ""; + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(temp.getTpmcType())){ + for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()){ + if (temp.getTpmcType().equals(tpmcTypeEnums.getId())){ + tpmcType = tpmcTypeEnums.getName(); + break; + } + } + } + extMap.put("tpmcType", tpmcType); + extMap.put("mcType", FunvCommonUtil.checkMianChuFS(temp.getMcType())); String tpSize = ""; - tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + UnitConstants.CM; + tpSize += temp.getTpSize().get("c") + UnitConstants.CM + "*" + temp.getTpSize().get("k") + UnitConstants.CM + "*" + temp.getTpSize().get("g") + UnitConstants.CM; extMap.put("tpSize",tpSize); extMap.put("tpWeight",UnitUtils.unitSplice(temp.getTpWeight(),UnitConstants.G)); extMap.put("umbilicalCordLength",UnitUtils.unitSplice(temp.getUmbilicalCordLength(),UnitConstants.CM)); @@ -984,7 +1018,7 @@ public class ViewFacade { for (MaternalDeliverModel.Baby temp : data.getBaby()){ Map babyMap = new HashMap<>(); babyMap.put("dueTime",temp.getDueTime()); - babyMap.put("pregnancyOut",temp.getPregnancyOut()==null?"" : StopPregEnums.getTitle(Integer.parseInt(temp.getPregnancyOut()))); + babyMap.put("pregnancyOut",temp.getPregnancyOut()==null? "" : RenShenJieJuEnums.getTitle(temp.getPregnancyOut())); babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( Integer.parseInt(temp.getBabyGender()))); @@ -996,11 +1030,16 @@ public class ViewFacade { String apgarScorePf10 = ""; Map m = JsonUtil.getMap(temp.getApgarScore()); if (MapUtils.isNotEmpty(map)) { - apgarScorePf1 += m.get("pf1") == null ? "" : (m.get("pf1") + "*"); - apgarScorePf5 += m.get("pf5") == null ? "" : (m.get("pf5") + "*"); + apgarScorePf1 += m.get("pf1") == null ? "" : m.get("pf1"); + apgarScorePf5 += m.get("pf5") == null ? "" : m.get("pf5"); apgarScorePf10 += m.get("pf10") == null ? "" : m.get("pf10"); } - babyMap.put("apgarScore", UnitUtils.unitSplice(apgarScorePf1 + apgarScorePf5 + apgarScorePf10,UnitConstants.FEN)); + String apgarScore = ""; + + if (StringUtils.isNotEmpty(apgarScorePf1) && StringUtils.isNotEmpty(apgarScorePf5) && StringUtils.isNotEmpty(apgarScorePf10)){ + apgarScore = apgarScorePf1 + UnitConstants.FEN + " - " + apgarScorePf5 + UnitConstants.FEN + " - " + apgarScorePf10 + UnitConstants.FEN; + } + babyMap.put("apgarScore", apgarScore); babyMap.put("asphyxiaM",UnitUtils.unitSplice(temp.getAsphyxiaM(),UnitConstants.FZ)); babyMap.put("contactStartM",UnitUtils.unitSplice(temp.getContactStartM(),UnitConstants.FZ)); babyMap.put("contactM",UnitUtils.unitSplice(temp.getContactM(),UnitConstants.FZ)); @@ -1025,7 +1064,7 @@ public class ViewFacade { Map totalprocessMap = JsonUtil.getMap(totalProcess); if (MapUtils.isNotEmpty(totalprocessMap)) { - p = totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"; + p = totalprocessMap.get("h") + "时" + totalprocessMap.get("m") + "分"; } map.put("totalProcess",p); return map; @@ -1046,11 +1085,11 @@ public class ViewFacade { } Map prodprocessTwo = prodprocessMap.get("two"); if (MapUtils.isNotEmpty(prodprocessTwo)) { - two = prodprocessOne.get("h") + "时" + prodprocessTwo.get("m") + "分"; + two = prodprocessTwo.get("h") + "时" + prodprocessTwo.get("m") + "分"; } Map prodprocessThree = prodprocessMap.get("three"); if (MapUtils.isNotEmpty(prodprocessThree)) { - three = prodprocessOne.get("h") + "时" + prodprocessThree.get("m") + "分"; + three = prodprocessThree.get("h") + "时" + prodprocessThree.get("m") + "分"; } } map.put("one",one); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java index 73d9683..2cd3472 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java @@ -359,15 +359,20 @@ public class FunvCommonUtil { } } + /** + * 处理会阴撕裂等级 + * @param s + * @return + */ public static String checkSiLieLevel(Integer s) { if (s==null){ return ""; } - if (s == 1){ + if (s.equals(1)){ return ONE; - }else if (s == 2){ + }else if (s.equals(2)){ return TWO; - }else if (s == 3){ + }else if (s.equals(3)){ return THREE; }else { return "";