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 7f44634..e50a460 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 @@ -151,6 +151,49 @@ public class ViewFacade { } + private void getRisk(String highRisk,String oRisk,Map map){ + HighScoreResult highScoreResult = null; + if (StringUtils.isNotEmpty(highRisk)){ + List ids = JsonUtil.toList(highRisk, 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(oRisk) && !"{}".equals(oRisk)){ + otherRisk = new HashMap<>(); + ResolveUtils.queryOtherRisk(oRisk,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",UnitUtils.unitSplice(score,UnitConstants.FEN)); + map.put("highRisk",list); + } + public BaseObjectResponse findAntExChu(String id){ @@ -195,46 +238,48 @@ public class ViewFacade { map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); - 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); + //处理高危因素 + 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())); @@ -528,7 +573,10 @@ public class ViewFacade { map.put("fmWeek",patients.getFmWeek()); map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); map.put("mremark",patients.getMremark()); - HighScoreResult highScoreResult = null; + + getRisk(data.getRiskFactor(),data.getOtherRisk(),map); + +/* HighScoreResult highScoreResult = null; if (StringUtils.isNotEmpty(data.getRiskFactor())){ List ids = JsonUtil.toList(data.getRiskFactor(), String.class); if (CollectionUtils.isNotEmpty(ids)){ @@ -541,7 +589,7 @@ public class ViewFacade { if (StringUtils.isNotEmpty(data.getOtherRisk()) && !"{}".equals(data.getOtherRisk())){ ResolveUtils.queryOtherRisk(data.getOtherRisk(),otherRisk,basicConfigService); } - map.put("otherHighRisk",otherRisk); + map.put("otherHighRisk",otherRisk);*/ //产检基本信息 map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate())); map.put("currentDueDate",data.getCurrentDueDate()); @@ -697,7 +745,7 @@ public class ViewFacade { highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService); } - map.put("riskFactor", highScoreResult); + map.put("riskFactor", ResolveUtils.queryHighRisk(highScoreResult)); map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); map.put("deliveryDate", data.getDueDate()); @@ -1045,7 +1093,7 @@ public class ViewFacade { highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService); } - map.put("riskFactor", highScoreResult); + map.put("riskFactor", ResolveUtils.queryHighRisk(highScoreResult)); map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); /* 复查信息 */ map.put("checkTime",DateUtil.getyyyy_MM_dd(data.getCheckTime())); @@ -1172,7 +1220,7 @@ public class ViewFacade { if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService); } - map.put("riskFactor",highScoreResult); + map.put("riskFactor",ResolveUtils.queryHighRisk(highScoreResult)); map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); map.put("leaveHospitalDate", DateUtil.getyyyy_MM_dd(data.getLeaveHospitalDate())); map.put("afterMakeBabyDays", data.getAfterMakeBabyDays()==null?"":"产后"+data.getAfterMakeBabyDays()+"天");