Commit 2f9e90dec21b73766a39b3df4188275121f12a13

Authored by liquanyu
1 parent fc0ce5ea38

导出添加高危因素

Showing 1 changed file with 88 additions and 2 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 2f9e90d
... ... @@ -352,8 +352,15 @@
352 352 AntenatalExaminationModel[] exData = new AntenatalExaminationModel[4];
353 353 AntenatalExaminationModel antenatalExaminationModel = antExService.findOneById(id);
354 354 Patients patients = patientsService.findOnePatientById(antenatalExaminationModel.getParentId());
355   - map.put("name", patients.getUsername());
  355 + String name = patients.getUsername();
  356 + String riskName = getRisk(antenatalExaminationModel.getRiskFactor(), antenatalExaminationModel.getOtherRisk());
  357 + if (StringUtils.isNotEmpty(riskName))
  358 + {
  359 + name +="("+riskName+")";
  360 + }
356 361  
  362 + map.put("name",name);
  363 +
357 364 if (num < 4) {
358 365 exData[num - 1] = antenatalExaminationModel;
359 366 } else {//全部
... ... @@ -494,6 +501,50 @@
494 501 }
495 502  
496 503  
  504 + private String getRisk(String risk,String otherRisk)
  505 + {
  506 +
  507 + StringBuilder sb = new StringBuilder();
  508 + List maph = null;
  509 + try {
  510 + maph = JsonUtil.toList(risk, List.class);
  511 + } catch (Exception e) {
  512 + }
  513 + if (CollectionUtils.isNotEmpty(maph)) {
  514 +
  515 + for (Object str : maph) {
  516 + if (null != str && org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) {
  517 + String val = loadRpHighRisk().get(str.toString());
  518 + if (org.apache.commons.lang.StringUtils.isNotEmpty(val)) {
  519 + sb.append(val).append("、");
  520 + }
  521 + }
  522 + }
  523 +
  524 + List<Map> otherHighRisks = new ArrayList<>();
  525 + List list3 = null;
  526 + String ot = otherRisk;
  527 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(ot) && ot.startsWith("[") && otherRisk.endsWith("]")) {
  528 + list3 = JsonUtil.toList(ot, Map.class);
  529 + otherHighRisks.addAll(list3);
  530 + } else if (org.apache.commons.lang.StringUtils.isNotEmpty(ot)) {
  531 + Map otherMap = JsonUtil.jkstr2Obj(ot, Map.class);
  532 + otherHighRisks.add(otherMap);
  533 + }
  534 +
  535 + if (CollectionUtils.isNotEmpty(otherHighRisks)) {
  536 + for (Map ma : otherHighRisks) {
  537 + Object rh = ma.get("fxysu");
  538 + if (null != rh && com.lyms.platform.common.utils.StringUtils.isNotEmpty(rh.toString())) {
  539 + sb.append(rh);
  540 + }
  541 + }
  542 + }
  543 +
  544 + }
  545 + return sb.toString();
  546 + }
  547 +
497 548 /**
498 549 * 导出初诊
499 550 *
... ... @@ -536,7 +587,23 @@
536 587 /* 基本信息 */
537 588 //孕妇基本信息
538 589 map.put("parentId", data.getParentId());
539   - map.put("name", patients.getUsername());
  590 +
  591 + AntExChuQuery antExChuQuery1 = new AntExChuQuery();
  592 + antExChuQuery1.setParentId(patients.getPid());
  593 + antExChuQuery1.setYn(YnEnums.YES.getId());
  594 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery1);
  595 + String name = patients.getUsername();
  596 + if (CollectionUtils.isNotEmpty(antExChuModels))
  597 + {
  598 + AntExChuModel antExChuModel = antExChuModels.get(0);
  599 + String riskName = getRisk(antExChuModel.getHighrisk(), antExChuModel.getOtherHighRisk());
  600 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskName))
  601 + {
  602 + name +="("+riskName+")";
  603 + }
  604 + }
  605 +
  606 + map.put("name", name);
540 607 Calendar calendar = Calendar.getInstance();
541 608 calendar.setTime(data.getCheckTime());
542 609  
... ... @@ -1166,6 +1233,25 @@
1166 1233 return map;
1167 1234 }
1168 1235  
  1236 +
  1237 + private Map<String, String> loadRpHighRisk() {
  1238 + //高危因素
  1239 + java.util.Map<String, String> bgHighRisk = new HashMap<>();
  1240 + BasicConfigQuery regionsQuery = new BasicConfigQuery();
  1241 + regionsQuery.setParentId(SystemConfig.HIGH_RISK_ID);
  1242 + regionsQuery.setYn(YnEnums.YES.getId());
  1243 + List<BasicConfig> basicConfigList = basicConfigService.queryBasicConfig(regionsQuery);
  1244 + if (CollectionUtils.isNotEmpty(basicConfigList)) {
  1245 + for (BasicConfig basicConfig : basicConfigList) {
  1246 + regionsQuery.setParentId(basicConfig.getId());
  1247 + List<BasicConfig> basicConfigList1 = basicConfigService.queryBasicConfig(regionsQuery);
  1248 + for (BasicConfig basicConfig1 : basicConfigList1) {
  1249 + bgHighRisk.put(basicConfig1.getId(), basicConfig1.getName());
  1250 + }
  1251 + }
  1252 + }
  1253 + return bgHighRisk;
  1254 + }
1169 1255  
1170 1256 /**
1171 1257 * 初诊查询