From 7846ff81aa9bca3fa7b03848c03f72e9d3829ade Mon Sep 17 00:00:00 2001 From: wangbo <184677810@qq.com> Date: Thu, 16 May 2019 11:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=83=A8=E4=BA=A7=E5=A6=87=E9=AB=98?= =?UTF-8?q?=E5=8D=B1=E5=9B=A0=E7=B4=A0=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/web/result/QuanChanResult.java | 43 +++++++ .../operate/web/worker/QuanChanPatientWorker.java | 123 +++++++++++++++------ 2 files changed, 132 insertions(+), 34 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java index 092d9e6..74e2a9b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java @@ -8,6 +8,8 @@ import com.lyms.platform.common.utils.StringUtils; import com.lyms.platform.pojo.Patients; import java.util.Date; +import java.util.List; +import java.util.Map; /** * Created by Administrator on 2016/6/23 0023. @@ -71,6 +73,15 @@ public class QuanChanResult implements IBasicResultConvert rLevel; + //风险因素 + private String rFactor; + //筛查结果 + private String screenResult; + //高危评分 + private Integer hScore; + /*********唐山滦县导出产妇健康管理增加字段********/ private String lastMenses; @@ -84,6 +95,38 @@ public class QuanChanResult implements IBasicResultConvert getrLevel() { + return rLevel; + } + + public void setrLevel(List rLevel) { + this.rLevel = rLevel; + } + + public String getrFactor() { + return rFactor; + } + + public void setrFactor(String rFactor) { + this.rFactor = rFactor; + } + + public String getScreenResult() { + return screenResult; + } + + public void setScreenResult(String screenResult) { + this.screenResult = screenResult; + } + + public Integer gethScore() { + return hScore; + } + + public void sethScore(Integer hScore) { + this.hScore = hScore; + } + public String getCreatedWeek() { return createdWeek; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java index d509ed4..f9d73ee 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java @@ -6,7 +6,10 @@ import com.lyms.platform.common.enums.ServiceTypeEnums; import com.lyms.platform.common.enums.TaiShuEnums; import com.lyms.platform.common.enums.YnEnums; import com.lyms.platform.common.utils.DateUtil; +import com.lyms.platform.common.utils.ExceptionUtils; +import com.lyms.platform.common.utils.JsonUtil; import com.lyms.platform.operate.web.facade.PatientFacade; +import com.lyms.platform.operate.web.result.HighScoreResult; import com.lyms.platform.operate.web.result.QuanChanResult; import com.lyms.platform.operate.web.utils.CommonsHelper; import com.lyms.platform.permission.model.Users; @@ -23,7 +26,9 @@ import org.springframework.data.domain.Sort; import org.springframework.util.StopWatch; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.Callable; /** @@ -56,7 +61,7 @@ public class QuanChanPatientWorker implements Callable> { PostReviewService postReviewService, MatDeliverService matDeliverService, PatientsService patientsService, OrganizationService organizationService, BasicConfigService basicConfigService, - AntenatalExaminationService antExService,DischargeAbstractMotherService dischargeAbstractMotherService, + AntenatalExaminationService antExService, DischargeAbstractMotherService dischargeAbstractMotherService, MatDeliverFollowService matDeliverFollowService) { this.patientses = patientses; this.matDeliverService = matDeliverService; @@ -100,12 +105,12 @@ public class QuanChanPatientWorker implements Callable> { //复诊次数 List ant = null; int i = 0; - if(CollectionUtils.isNotEmpty(chu)){ - for(AntExChuModel a : chu){//唐山滦县导出判断初诊是否是本院 - if(StringUtils.isNotEmpty(a.getHospitalId())){ - if(a.getHospitalId().equals(hospital)){ + if (CollectionUtils.isNotEmpty(chu)) { + for (AntExChuModel a : chu) {//唐山滦县导出判断初诊是否是本院 + if (StringUtils.isNotEmpty(a.getHospitalId())) { + if (a.getHospitalId().equals(hospital)) { chanResult.setYi("本院"); - }else{ + } else { chanResult.setYi("外院"); } break; @@ -114,33 +119,33 @@ public class QuanChanPatientWorker implements Callable> { ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery()); //唐山滦县判断复诊是否是本院 - if(CollectionUtils.isNotEmpty(ant)){ - for(int k = 0;k < ant.size();k++){ - if(k>=4){ + if (CollectionUtils.isNotEmpty(ant)) { + for (int k = 0; k < ant.size(); k++) { + if (k >= 4) { break; } - if(0==k){ - if(ant.get(k).getHospitalId().equals(hospital)){ + if (0 == k) { + if (ant.get(k).getHospitalId().equals(hospital)) { chanResult.setEr("本院"); - }else{ + } else { chanResult.setEr("外院"); } - }else if(1==k){ - if(ant.get(k).getHospitalId().equals(hospital)){ + } else if (1 == k) { + if (ant.get(k).getHospitalId().equals(hospital)) { chanResult.setSan("本院"); - }else{ + } else { chanResult.setSan("外院"); } - }else if(2==k){ - if(ant.get(k).getHospitalId().equals(hospital)){ + } else if (2 == k) { + if (ant.get(k).getHospitalId().equals(hospital)) { chanResult.setSi("本院"); - }else{ + } else { chanResult.setSi("外院"); } - }else if(3==k){ - if(ant.get(k).getHospitalId().equals(hospital)){ + } else if (3 == k) { + if (ant.get(k).getHospitalId().equals(hospital)) { chanResult.setWu("本院"); - }else{ + } else { chanResult.setWu("外院"); } } @@ -150,25 +155,25 @@ public class QuanChanPatientWorker implements Callable> { } //系统初诊次数 int ichu = CollectionUtils.isEmpty(chu) ? 0 : chu.size(); - chanResult.setCjTimes(ichu+i); + chanResult.setCjTimes(ichu + i); //出院小结 DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery(); dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId()); dischargeAbstractMotherQuery.setPatientId(patients.getId()); List dischargeAbstractMotherModels = dischargeAbstractMotherService.query(dischargeAbstractMotherQuery); - if(dischargeAbstractMotherModels != null && dischargeAbstractMotherModels.size() > 0){ + if (dischargeAbstractMotherModels != null && dischargeAbstractMotherModels.size() > 0) { chanResult.setCyxj("有"); - }else{ + } else { chanResult.setCyxj("无"); } //产后访视 MatDeliverFollowQuery mfQuery = new MatDeliverFollowQuery(); mfQuery.setPid(patients.getPid()); List maternalDeliverList = matDeliverFollowService.query(mfQuery); - if(maternalDeliverList != null && maternalDeliverList.size() > 0){ + if (maternalDeliverList != null && maternalDeliverList.size() > 0) { chanResult.setChfs("有"); - }else{ + } else { chanResult.setChfs("无"); } PostReviewQuery pReviewQuery = new PostReviewQuery(); @@ -176,9 +181,9 @@ public class QuanChanPatientWorker implements Callable> { pReviewQuery.setParentId(patients.getId()); //产后复查记录 List reviewModels = postReviewService.findWithList(pReviewQuery); - if(reviewModels != null && reviewModels.size() > 0){ + if (reviewModels != null && reviewModels.size() > 0) { chanResult.setChfc("有"); - }else{ + } else { chanResult.setChfc("无"); } @@ -200,20 +205,17 @@ public class QuanChanPatientWorker implements Callable> { chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); try { - if (StringUtils.isNotEmpty(patients.getSource())) - { + if (StringUtils.isNotEmpty(patients.getSource())) { Patients pat = patientsService.findOnePatientById(patients.getSource()); chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(pat.getHospitalId())).getName()); - } - else - { + } else { chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); } } catch (Exception e) { chanResult.setFirstBH(""); } //乡镇/街道 - chanResult.setStreet(CommonsHelper.getName1(patients.getStreetRegisterId(),basicConfigService)); + chanResult.setStreet(CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService)); MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); matDeliverQuery.setPid(patients.getPid()); matDeliverQuery.setCreatedStart(patients.getLastMenses()); @@ -280,6 +282,59 @@ public class QuanChanPatientWorker implements Callable> { chanResult.setNextCheckTime(nextCheckTime); //操作者 // chanResult.setOperator(); + + + //高危因素 + List factor = patients.getRiskFactorId(); + if (CollectionUtils.isNotEmpty(factor)) { + StringBuilder sb = new StringBuilder(56); + for (String srt : factor) { + if (StringUtils.isNotEmpty(srt)) { + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(srt); + if (null != basicConfig && sb.indexOf(basicConfig.getName()) == -1) { + sb.append(basicConfig.getName()).append(','); + } + } + } + if (sb.toString().endsWith(",")) { + chanResult.setrFactor(sb.substring(0, sb.length() - 1)); + } else { + chanResult.setrFactor(sb.toString()); + } + + if (!"-".equals(chanResult.getrFactor()) && StringUtils.isNotEmpty(patients.getoRiskFactor())) { + chanResult.setrFactor(chanResult.getrFactor() + "," + patients.getoRiskFactor()); + } else if (StringUtils.isNotEmpty(patients.getoRiskFactor())) { + chanResult.setrFactor(patients.getoRiskFactor()); + } + } else if (StringUtils.isNotEmpty(patients.getoRiskFactor())) { + chanResult.setrFactor(patients.getoRiskFactor()); + } + List level = new ArrayList(); + if (StringUtils.isNotEmpty(patients.getRiskLevelId())) { + try { + List list = JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class); + for (String str : list) { + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str); + if (null != basicConfig) { + Map map = new HashMap(); + basicConfig.replenRisk(map); + // String name = basicConfig.getName(); + // if (name.indexOf("预警") > -1) { + // name = name.replace("预警", ""); + // } + // map.put("name", name); + // map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); + level.add(map); + } + } + } catch (Exception e) { + ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); + } + chanResult.setrLevel(HighScoreResult.filter(level)); + } + + chanResult.sethScore(patients.getRiskScore()); data.add(chanResult); logger.debug(stopWatch.toString()); } -- 1.8.3.1