Commit 40fb3b0c6078fb2398596874be16257e1a7bcfbe
1 parent
0bf92856cb
Exists in
master
and in
6 other branches
修改初诊高危因素
Showing 2 changed files with 59 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
40fb3b0
| ... | ... | @@ -195,7 +195,6 @@ |
| 195 | 195 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
| 196 | 196 | map.put("mremark",patients.getMremark()); |
| 197 | 197 | |
| 198 | - //TODO 高危需要处理,高危因素名称+颜色+高危评分 | |
| 199 | 198 | HighScoreResult highScoreResult = null; |
| 200 | 199 | if (StringUtils.isNotEmpty(data.getHighrisk())){ |
| 201 | 200 | List<String> ids = JsonUtil.toList(data.getHighrisk(), String.class); |
| 202 | 201 | |
| 203 | 202 | |
| 204 | 203 | |
| 205 | 204 | |
| ... | ... | @@ -203,14 +202,40 @@ |
| 203 | 202 | highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); |
| 204 | 203 | } |
| 205 | 204 | } |
| 206 | - map.put("highRisk",highScoreResult); | |
| 205 | + Integer score = 0; | |
| 206 | + if (highScoreResult.getScore()!=null){ | |
| 207 | + score = highScoreResult.getScore(); | |
| 208 | + } | |
| 207 | 209 | |
| 208 | - Map<String,Object> otherRisk = new HashMap<>(); | |
| 210 | + List<Map<String, Object>> list = ResolveUtils.queryHighRisk(highScoreResult); | |
| 211 | + | |
| 212 | + Map<String,Object> otherRisk = null; | |
| 209 | 213 | if (StringUtils.isNotEmpty(data.getOtherHighRisk()) && !"{}".equals(data.getOtherHighRisk())){ |
| 214 | + otherRisk = new HashMap<>(); | |
| 210 | 215 | ResolveUtils.queryOtherRisk(data.getOtherHighRisk(),otherRisk,basicConfigService); |
| 211 | 216 | } |
| 212 | - map.put("otherHighRisk",otherRisk); | |
| 213 | 217 | |
| 218 | + Map<String,Object> otherMap = new HashMap<>(); | |
| 219 | + | |
| 220 | + if (otherRisk!=null){ | |
| 221 | + if (otherRisk.get("name")!=null){ | |
| 222 | + otherMap.put("name",otherRisk.get("name")); | |
| 223 | + } | |
| 224 | + if (otherRisk.get("color")!=null){ | |
| 225 | + otherMap.put("color",otherRisk.get("color")); | |
| 226 | + } | |
| 227 | + if (otherRisk.get("score")!=null){ | |
| 228 | + String s = (String)otherRisk.get("score"); | |
| 229 | + if (FunvCommonUtil.isNumeric(s)){ | |
| 230 | + score = score + Integer.parseInt(s); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + list.add(otherMap); | |
| 234 | + } | |
| 235 | + | |
| 236 | + map.put("score",score); | |
| 237 | + map.put("highRisk",list); | |
| 238 | + | |
| 214 | 239 | //产检基本信息 |
| 215 | 240 | map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckTime())); |
| 216 | 241 | //TODO 产检孕周 |
| ... | ... | @@ -503,7 +528,6 @@ |
| 503 | 528 | map.put("fmWeek",patients.getFmWeek()); |
| 504 | 529 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
| 505 | 530 | map.put("mremark",patients.getMremark()); |
| 506 | - //TODO 高危需要处理,高危因素名称+颜色+高危评分 | |
| 507 | 531 | HighScoreResult highScoreResult = null; |
| 508 | 532 | if (StringUtils.isNotEmpty(data.getRiskFactor())){ |
| 509 | 533 | List<String> ids = JsonUtil.toList(data.getRiskFactor(), String.class); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
View file @
40fb3b0
| ... | ... | @@ -245,6 +245,36 @@ |
| 245 | 245 | return map; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | + public static List<Map<String,Object>> queryHighRisk(HighScoreResult result){ | |
| 249 | + | |
| 250 | + if (result==null){ | |
| 251 | + return null; | |
| 252 | + } | |
| 253 | + | |
| 254 | + List<Map<String,Object>> mapList = new ArrayList<>(); | |
| 255 | + | |
| 256 | + if (CollectionUtils.isNotEmpty(result.getHighRisk())){ | |
| 257 | + List<Map> list = (List<Map>)result.getHighRisk(); | |
| 258 | + if (CollectionUtils.isNotEmpty(list)){ | |
| 259 | + for (Map m : list){ | |
| 260 | + | |
| 261 | + Map<String,Object> map = new HashMap<>(); | |
| 262 | + | |
| 263 | + if (m.get("name")!=null){ | |
| 264 | + map.put("name",m.get("name")); | |
| 265 | + } | |
| 266 | + if (m.get("color")!=null){ | |
| 267 | + map.put("color",m.get("color")); | |
| 268 | + } | |
| 269 | + | |
| 270 | + mapList.add(map); | |
| 271 | + } | |
| 272 | + } | |
| 273 | + } | |
| 274 | + return mapList; | |
| 275 | + } | |
| 276 | + | |
| 277 | + | |
| 248 | 278 | |
| 249 | 279 | |
| 250 | 280 | public static void main(String[] str) { |