Commit 9c7814dd661f88c060974592940061bff468f2b1
1 parent
b6203a5919
Exists in
master
and in
6 other branches
其他高危
Showing 3 changed files with 79 additions and 43 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommonService.java
View file @
9c7814d
| ... | ... | @@ -54,7 +54,6 @@ |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | - | |
| 58 | 57 | /** |
| 59 | 58 | * 高危id转成列表 |
| 60 | 59 | * |
| ... | ... | @@ -86,8 +85,6 @@ |
| 86 | 85 | } |
| 87 | 86 | |
| 88 | 87 | |
| 89 | - | |
| 90 | - | |
| 91 | 88 | /** |
| 92 | 89 | * 高危id转成列表 |
| 93 | 90 | * |
| 94 | 91 | |
| 95 | 92 | |
| 96 | 93 | |
| ... | ... | @@ -137,16 +134,16 @@ |
| 137 | 134 | * @param riskList |
| 138 | 135 | * @return |
| 139 | 136 | */ |
| 140 | - public Map calculateRiskScore(List riskList ){ | |
| 137 | + public Map calculateRiskScore(List riskList) { | |
| 141 | 138 | Map result = new HashMap(); |
| 142 | - int score=0; | |
| 143 | - List<String> levelList = new ArrayList<>() ; | |
| 139 | + int score = 0; | |
| 140 | + List<String> levelList = new ArrayList<>(); | |
| 144 | 141 | for (int i = 0; i < riskList.size(); i++) { |
| 145 | - Object obj =riskList.get(i); | |
| 146 | - if(null!=obj){ | |
| 142 | + Object obj = riskList.get(i); | |
| 143 | + if (null != obj) { | |
| 147 | 144 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(obj.toString()); |
| 148 | - if(null!=basicConfig){ | |
| 149 | - if(null!=basicConfig.getCode()){ | |
| 145 | + if (null != basicConfig) { | |
| 146 | + if (null != basicConfig.getCode()) { | |
| 150 | 147 | score += Integer.valueOf(basicConfig.getCode()); |
| 151 | 148 | } |
| 152 | 149 | basicConfig = basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); |
| ... | ... | @@ -156,8 +153,37 @@ |
| 156 | 153 | } |
| 157 | 154 | } |
| 158 | 155 | } |
| 159 | - result.put("score",score); | |
| 160 | - result.put("levelList",levelList); | |
| 156 | + result.put("score", score); | |
| 157 | + result.put("levelList", levelList); | |
| 158 | + return result; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public Map resolveOtherRisk(String risk) { | |
| 162 | + Map result = new HashMap(); | |
| 163 | + if (StringUtils.isNotEmpty(risk) && !"{}".equals(risk)) { | |
| 164 | + Map map = JsonUtil.str2Obj(risk, Map.class); | |
| 165 | + Object obj = map.get("fxysu"); | |
| 166 | + if (null != obj && !"null".equals(obj.toString()) && !"".equals(obj.toString())) { | |
| 167 | + result.put("name", map.get("fxysu")); | |
| 168 | + Object idObj1 = map.get("fyyse"); | |
| 169 | + if (null != idObj1 && !"null".equals(idObj1.toString()) && !"".equals(idObj1.toString())) { | |
| 170 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj1.toString()); | |
| 171 | + if (null != basicConfig) { | |
| 172 | + String name = basicConfig.getName(); | |
| 173 | + if (name.indexOf("预警") > -1) { | |
| 174 | + name = name.replace("预警", ""); | |
| 175 | + } | |
| 176 | + result.put("level", name); | |
| 177 | + } | |
| 178 | + } | |
| 179 | + //风险评分 | |
| 180 | + Object idObj = map.get("fxpf"); | |
| 181 | + if (null != idObj && !"null".equals(idObj.toString()) && !"".equals(idObj.toString())) { | |
| 182 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); | |
| 183 | + result.put("score",NumberUtils.toInt(basicConfig.getName(), 0)); | |
| 184 | + } | |
| 185 | + } | |
| 186 | + } | |
| 161 | 187 | return result; |
| 162 | 188 | } |
| 163 | 189 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
View file @
9c7814d
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/AntExRecordWorker.java
View file @
9c7814d
| ... | ... | @@ -126,49 +126,56 @@ |
| 126 | 126 | //本院低次 |
| 127 | 127 | int dichi = recordService.count(antExRecordQuery1); |
| 128 | 128 | antExRecordQuery1.setHospitalId(null); |
| 129 | - String fxys = ""; | |
| 130 | - if (StringUtils.isNotEmpty(e.getfId())) { | |
| 131 | - String risk = null; | |
| 132 | - if (e.getType() == 2) { | |
| 133 | - AntExChuModel model = antenatalExaminationService.findOne(e.getfId()); | |
| 134 | - if (null != model) { | |
| 135 | - risk = model.getOtherHighRisk(); | |
| 136 | - } | |
| 137 | - } else if (e.getType() == 1) { | |
| 138 | - AntenatalExaminationModel model = antenatalExaminationService.findOneById(e.getfId()); | |
| 139 | - if (null != model) { | |
| 140 | - risk = model.getOtherRisk(); | |
| 141 | - } | |
| 142 | - } | |
| 143 | 129 | |
| 144 | - try { | |
| 145 | - Map map = JsonUtil.str2Obj(risk, Map.class); | |
| 146 | - Object obj = map.get("fxysu"); | |
| 147 | - if (null != obj) { | |
| 148 | - fxys = obj.toString(); | |
| 149 | - } | |
| 150 | - } catch (Exception e1) { | |
| 151 | - } | |
| 130 | + antExManagerResult.settTimes(recordService.count(antExRecordQuery1)); | |
| 131 | + antExManagerResult.setChTimes(dichi); | |
| 132 | + handleRisk(e,antExManagerResult); | |
| 133 | + | |
| 134 | + data.add(antExManagerResult); | |
| 135 | + } catch (Exception e1) { | |
| 136 | + ExceptionUtils.catchException(e1, "antex worker error."); | |
| 137 | + } | |
| 138 | + } | |
| 139 | + return data; | |
| 140 | + } | |
| 141 | + | |
| 142 | + private void handleRisk(AntExRecordModel e , AntExManagerResult antExManagerResult){ | |
| 143 | + if (StringUtils.isNotEmpty(e.getfId())) { | |
| 144 | + String risk = null; | |
| 145 | + if (e.getType() == 2) { | |
| 146 | + AntExChuModel model = antenatalExaminationService.findOne(e.getfId()); | |
| 147 | + if (null != model) { | |
| 148 | + risk = model.getOtherHighRisk(); | |
| 152 | 149 | } |
| 150 | + } else if (e.getType() == 1) { | |
| 151 | + AntenatalExaminationModel model = antenatalExaminationService.findOneById(e.getfId()); | |
| 152 | + if (null != model) { | |
| 153 | + risk = model.getOtherRisk(); | |
| 154 | + } | |
| 155 | + } | |
| 156 | + Map result = commonService.resolveOtherRisk(risk); | |
| 157 | + if(!result.isEmpty()){ | |
| 158 | + //高危因素名字 | |
| 159 | + String name =result.get("name").toString(); | |
| 160 | + String level =result.get("level").toString(); | |
| 161 | + String score =result.get("score").toString(); | |
| 153 | 162 | |
| 163 | + if(org.apache.commons.lang.StringUtils.isNotEmpty(level) &&!"null".equals(level)){ | |
| 164 | + e.gethLevel().add(level); | |
| 165 | + } | |
| 154 | 166 | |
| 155 | - antExManagerResult.settTimes(recordService.count(antExRecordQuery1)); | |
| 156 | - antExManagerResult.setChTimes(dichi); | |
| 157 | 167 | //高危因素 |
| 158 | 168 | antExManagerResult.setrLevel(commonService.findRiskLevel(e.gethLevel())); |
| 159 | 169 | String ri= commonService.resloveFactor(e.gethRisk()); |
| 160 | 170 | if(ri.isEmpty()){ |
| 161 | - ri=fxys; | |
| 162 | - }else if(StringUtils.isNotEmpty(fxys)){ | |
| 163 | - ri+=","+fxys; | |
| 171 | + ri=name; | |
| 172 | + }else if(StringUtils.isNotEmpty(name)){ | |
| 173 | + ri+=","+name; | |
| 164 | 174 | } |
| 165 | 175 | antExManagerResult.setRiskFactor(ri); |
| 166 | - data.add(antExManagerResult); | |
| 167 | - } catch (Exception e1) { | |
| 168 | - ExceptionUtils.catchException(e1, "antex worker error."); | |
| 176 | + antExManagerResult.setRiskScore((e.gethScore()+NumberUtils.toInt(score,0))+""); | |
| 169 | 177 | } |
| 170 | 178 | } |
| 171 | - return data; | |
| 172 | 179 | } |
| 173 | 180 | } |