From bceeabbae56c5c67becb01156780493425da190f Mon Sep 17 00:00:00 2001 From: landong2015 Date: Thu, 19 Jan 2017 10:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=94=E5=9B=9E=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/common/enums/CfEnums.java | 13 ++++ .../lyms/platform/common/enums/StopPregEnums.java | 12 ++++ .../platform/operate/web/facade/ViewFacade.java | 69 +++++----------------- 3 files changed, 39 insertions(+), 55 deletions(-) diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/CfEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/CfEnums.java index c6201d4..408a563 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/enums/CfEnums.java +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/CfEnums.java @@ -11,6 +11,19 @@ public enum CfEnums { this.id=id; this.name=name; } + + public static String getTitle(Integer id){ + if (id==null){ + return ""; + } + for (CfEnums cfEnums:CfEnums.values()){ + if (id.equals(cfEnums.getId())){ + return cfEnums.getName(); + } + } + return ""; + } + private String id; private String name; diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/StopPregEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/StopPregEnums.java index 2bc7363..4661976 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/enums/StopPregEnums.java +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/StopPregEnums.java @@ -20,6 +20,18 @@ public enum StopPregEnums { this.name = name; } + public static String getTitle(Integer id){ + if (id==null){ + return ""; + } + for (StopPregEnums stopPregEnums:StopPregEnums.values()){ + if (id.equals(stopPregEnums.getId())){ + return stopPregEnums.getName(); + } + } + return ""; + } + private int id; private String name; 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 51243e5..febfa7a 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 @@ -235,57 +235,17 @@ 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()); + map.put("fmWeek",patients.getFmWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(patients.getFmWeek())); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); //处理高危因素 getRisk(data.getHighrisk(),data.getOtherHighRisk(),map); -// HighScoreResult highScoreResult = null; -// if (StringUtils.isNotEmpty(data.getHighrisk())){ -// List ids = JsonUtil.toList(data.getHighrisk(), String.class); -// if (CollectionUtils.isNotEmpty(ids)){ -// highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); -// } -// } -// Integer score = 0; -// if (highScoreResult.getScore()!=null){ -// score = highScoreResult.getScore(); -// } -// -// List> list = ResolveUtils.queryHighRisk(highScoreResult); -// -// Map otherRisk = null; -// if (StringUtils.isNotEmpty(data.getOtherHighRisk()) && !"{}".equals(data.getOtherHighRisk())){ -// otherRisk = new HashMap<>(); -// ResolveUtils.queryOtherRisk(data.getOtherHighRisk(),otherRisk,basicConfigService); -// } -// -// Map otherMap = new HashMap<>(); -// -// if (otherRisk!=null){ -// if (otherRisk.get("name")!=null){ -// otherMap.put("name",otherRisk.get("name")); -// } -// if (otherRisk.get("color")!=null){ -// otherMap.put("color",otherRisk.get("color")); -// } -// if (otherRisk.get("score")!=null){ -// String s = (String)otherRisk.get("score"); -// if (FunvCommonUtil.isNumeric(s)){ -// score = score + Integer.parseInt(s); -// } -// } -// list.add(otherMap); -// } -// -// map.put("score",score); -// map.put("highRisk",list); //产检基本信息 map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckTime())); //产检孕周 - map.put("cDueWeek",data.getcDueWeek()); + map.put("cDueWeek",data.getcDueWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(Integer.parseInt(data.getcDueWeek()))); String checkDoctor = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getProdDoctor())){ @@ -304,8 +264,6 @@ public class ViewFacade { } map.put("hospital", hospital); map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); - map.put("cDueWeek", data.getcDueWeek()); - /* 初诊信息 */ //既往史 String pastHistory = ""; @@ -448,7 +406,7 @@ public class ViewFacade { } Map placetaMap = new HashMap<>(); placetaMap.put("fetalPosition",fetalPosition); - placetaMap.put("fetalPresentation",fetalPresentation); + placetaMap.put("fetalPresentation",FetalEnums.getTitle(fetalPresentation)); placetaMap.put("heartRate",UnitUtils.unitSplice(heartRate,UnitConstants.CIFEN)); placetaMap.put("join",JoinEnums.getTitle(join)); placetaList.add(placetaMap); @@ -488,6 +446,7 @@ public class ViewFacade { map.put("xqjq",UnitUtils.unitSplice(data.getXqjq(), UnitConstants.UL)); map.put("xnsd",UnitUtils.unitSplice(data.getXnsd(), UnitConstants.UL)); + map.put("syjg",FunvCommonUtil.checkYiGan(data.getSyjg())); map.put("hivkt",FunvCommonUtil.checkYiGan(data.getHivkt())); String ydfmw = ""; @@ -572,7 +531,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()); + map.put("fmWeek",patients.getFmWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(patients.getFmWeek())); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); @@ -615,7 +574,7 @@ public class ViewFacade { } map.put("hospital", hospital); map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); - map.put("cDueWeek", data.getcDueWeek()); + map.put("cDueWeek", data.getcDueWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(Integer.parseInt(data.getcDueWeek()))); /* 复诊信息 */ map.put("chiefComplaint", data.getChiefComplaint()); @@ -735,9 +694,9 @@ public class ViewFacade { map.put("id",data.getId()); map.put("username",patients.getUsername()); map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); - map.put("age",DateUtil.getAge(patients.getBirth())); + map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI)); map.put("phone",patients.getPhone()); - map.put("fmWeek",patients.getFmWeek()); + map.put("fmWeek",patients.getFmWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(patients.getFmWeek())); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); @@ -751,7 +710,7 @@ public class ViewFacade { map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); map.put("deliveryDate", data.getDueDate()); - map.put("dueWeek", data.getDueWeek()); + map.put("dueWeek", data.getDueWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(Integer.parseInt(data.getDueWeek()))); String fmHospital = ""; @@ -827,7 +786,7 @@ public class ViewFacade { } Map placetaMap = new HashMap<>(); placetaMap.put("fetalPosition",fetalPosition); - placetaMap.put("fetalPresentation",fetalPresentation); + placetaMap.put("fetalPresentation",FetalEnums.getTitle(fetalPresentation)); placetaMap.put("heartRate",UnitUtils.unitSplice(heartRate,UnitConstants.CIFEN)); placetaList.add(placetaMap); } @@ -875,7 +834,7 @@ public class ViewFacade { map.put("needleNum", UnitUtils.unitSplice(data.getNeedleNum(),UnitConstants.ZHEN)); /* 产后生理 */ - map.put("maternalInfo", data.getMaternalInfo()); + map.put("maternalInfo", data.getMaternalInfo()==null?"":CfEnums.getTitle(Integer.parseInt(data.getMaternalInfo()))); map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause()); // 产后血压 收缩压,舒张压 String ssy = ""; @@ -975,7 +934,7 @@ public class ViewFacade { for (MaternalDeliverModel.Baby temp : data.getBaby()){ Map babyMap = new HashMap<>(); babyMap.put("dueTime",temp.getDueTime()); - babyMap.put("pregnancyOut",temp.getPregnancyOut()); + babyMap.put("pregnancyOut",temp.getPregnancyOut()==null?"" : StopPregEnums.getTitle(Integer.parseInt(temp.getPregnancyOut()))); babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( Integer.parseInt(temp.getBabyGender()))); @@ -1086,7 +1045,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()); + map.put("fmWeek",patients.getFmWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(patients.getFmWeek())); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); //高危因素 @@ -1214,7 +1173,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()); + map.put("fmWeek",patients.getFmWeek()==null ? "": com.lyms.platform.common.utils.StringUtils.dueWeek(patients.getFmWeek())); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); //高危因素 -- 1.8.3.1