Commit 5f6c1350c732995028f8bfdef7f0ab3f2e09a48c

Authored by jiangjiazhi
1 parent 4aa5dd39f4

修改新电子病历

Showing 1 changed file with 18 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 5f6c135
... ... @@ -239,11 +239,13 @@
239 239 //修改患者风险等级
240 240 private void updatePatientRiskLevel(AntExChuModel antExChuModel, Patients patients) {
241 241 List<String> list = new ArrayList<>();
  242 + Integer score=0;
242 243 try {
243 244 if (StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"[]".equals(antExChuModel.getHighrisk())) {
244 245 List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
245 246 for (int i = 0; i < l.size(); i++) {
246 247 BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(l.get(i).toString());
  248 + score+=basicConfig.getScore();
247 249 basicConfig = basicConfigService.getOneBasicConfigById(basicConfig.getParentId());
248 250 if (null != basicConfig && !list.contains(basicConfig.getId())) {
249 251 list.add(basicConfig.getId());
250 252  
... ... @@ -259,12 +261,15 @@
259 261 if (!list.contains(m)) {
260 262 list.add(m);
261 263 }
  264 + //风险评分
  265 + Object idObj = map.get("fxpf");
  266 + if (null != idObj && !"null".equals(idObj.toString()) && !"".equals(idObj.toString())) {
  267 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString());
  268 + score +=basicConfig.getScore();
  269 + }
262 270 }
263 271 } catch (Exception e) {
264 272 }
265   - /* if (!list.isEmpty()) {
266   - patients.setRiskLevelId(JsonUtil.array2JsonString(list));
267   - }*/
268 273 patientsService.updatePatient(patients);
269 274 if (!list.isEmpty()) {
270 275 Patients patients1 = new Patients();
... ... @@ -273,6 +278,7 @@
273 278 patients1.setRiskFactorId(list2);
274 279 } catch (Exception e) {
275 280 }
  281 + patients1.setRiskScore(score);
276 282 patients1.setRiskLevelId(JsonUtil.array2JsonString(list));
277 283 patients1.setModified(new Date());
278 284 PatientsQuery patientsQuery = new PatientsQuery();
279 285  
... ... @@ -286,11 +292,13 @@
286 292 //修改患者风险等级
287 293 private void updatePatientRiskLevel(AntenatalExaminationModel antExChuModel, Patients patients) {
288 294 List<String> list = new ArrayList<>();
  295 + Integer score=0;
289 296 try {
290 297 if (StringUtils.isNotEmpty(antExChuModel.getRiskFactor()) && !"[]".equals(antExChuModel.getRiskFactor())) {
291 298 List l = JsonUtil.toList(antExChuModel.getRiskFactor(), List.class);
292 299 for (int i = 0; i < l.size(); i++) {
293 300 BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(l.get(i).toString());
  301 + score+=basicConfig.getScore();
294 302 basicConfig = basicConfigService.getOneBasicConfigById(basicConfig.getParentId());
295 303 if (null != basicConfig && !list.contains(basicConfig.getId())) {
296 304 list.add(basicConfig.getId());
... ... @@ -306,6 +314,12 @@
306 314 if (!list.contains(m)) {
307 315 list.add(m);
308 316 }
  317 + //风险评分
  318 + Object idObj = map.get("fxpf");
  319 + if (null != idObj && !"null".equals(idObj.toString()) && !"".equals(idObj.toString())) {
  320 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString());
  321 + score +=basicConfig.getScore();
  322 + }
309 323 }
310 324 } catch (Exception e) {
311 325 }
... ... @@ -317,6 +331,7 @@
317 331 patients1.setRiskFactorId(list2);
318 332 } catch (Exception e) {
319 333 }
  334 + patients1.setRiskScore(score);
320 335 patients1.setModified(new Date());
321 336 patients1.setRiskLevelId(JsonUtil.array2JsonString(list));
322 337 PatientsQuery patientsQuery = new PatientsQuery();