Commit 7846ff81aa9bca3fa7b03848c03f72e9d3829ade

Authored by wangbo
1 parent 9e53986e0e

全部产妇高危因素字段添加

Showing 2 changed files with 132 additions and 34 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java View file @ 7846ff8
... ... @@ -8,6 +8,8 @@
8 8 import com.lyms.platform.pojo.Patients;
9 9  
10 10 import java.util.Date;
  11 +import java.util.List;
  12 +import java.util.Map;
11 13  
12 14 /**
13 15 * Created by Administrator on 2016/6/23 0023.
14 16  
... ... @@ -71,7 +73,16 @@
71 73 //建档孕周
72 74 private String createdWeek;
73 75  
  76 + //风险等级
  77 + private List<Map> rLevel;
  78 + //风险因素
  79 + private String rFactor;
  80 + //筛查结果
  81 + private String screenResult;
  82 + //高危评分
  83 + private Integer hScore;
74 84  
  85 +
75 86 /*********唐山滦县导出产妇健康管理增加字段********/
76 87 private String lastMenses;
77 88 private int cjTimes;
... ... @@ -83,6 +94,38 @@
83 94 private String cyxj;
84 95 private String chfs;
85 96 private String chfc;
  97 +
  98 + public List<Map> getrLevel() {
  99 + return rLevel;
  100 + }
  101 +
  102 + public void setrLevel(List<Map> rLevel) {
  103 + this.rLevel = rLevel;
  104 + }
  105 +
  106 + public String getrFactor() {
  107 + return rFactor;
  108 + }
  109 +
  110 + public void setrFactor(String rFactor) {
  111 + this.rFactor = rFactor;
  112 + }
  113 +
  114 + public String getScreenResult() {
  115 + return screenResult;
  116 + }
  117 +
  118 + public void setScreenResult(String screenResult) {
  119 + this.screenResult = screenResult;
  120 + }
  121 +
  122 + public Integer gethScore() {
  123 + return hScore;
  124 + }
  125 +
  126 + public void sethScore(Integer hScore) {
  127 + this.hScore = hScore;
  128 + }
86 129  
87 130 public String getCreatedWeek() {
88 131 return createdWeek;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java View file @ 7846ff8
... ... @@ -6,7 +6,10 @@
6 6 import com.lyms.platform.common.enums.TaiShuEnums;
7 7 import com.lyms.platform.common.enums.YnEnums;
8 8 import com.lyms.platform.common.utils.DateUtil;
  9 +import com.lyms.platform.common.utils.ExceptionUtils;
  10 +import com.lyms.platform.common.utils.JsonUtil;
9 11 import com.lyms.platform.operate.web.facade.PatientFacade;
  12 +import com.lyms.platform.operate.web.result.HighScoreResult;
10 13 import com.lyms.platform.operate.web.result.QuanChanResult;
11 14 import com.lyms.platform.operate.web.utils.CommonsHelper;
12 15 import com.lyms.platform.permission.model.Users;
13 16  
... ... @@ -23,7 +26,9 @@
23 26 import org.springframework.util.StopWatch;
24 27  
25 28 import java.util.ArrayList;
  29 +import java.util.HashMap;
26 30 import java.util.List;
  31 +import java.util.Map;
27 32 import java.util.concurrent.Callable;
28 33  
29 34 /**
... ... @@ -56,7 +61,7 @@
56 61 PostReviewService postReviewService,
57 62 MatDeliverService matDeliverService, PatientsService patientsService,
58 63 OrganizationService organizationService, BasicConfigService basicConfigService,
59   - AntenatalExaminationService antExService,DischargeAbstractMotherService dischargeAbstractMotherService,
  64 + AntenatalExaminationService antExService, DischargeAbstractMotherService dischargeAbstractMotherService,
60 65 MatDeliverFollowService matDeliverFollowService) {
61 66 this.patientses = patientses;
62 67 this.matDeliverService = matDeliverService;
63 68  
... ... @@ -100,12 +105,12 @@
100 105 //复诊次数
101 106 List<AntenatalExaminationModel> ant = null;
102 107 int i = 0;
103   - if(CollectionUtils.isNotEmpty(chu)){
104   - for(AntExChuModel a : chu){//唐山滦县导出判断初诊是否是本院
105   - if(StringUtils.isNotEmpty(a.getHospitalId())){
106   - if(a.getHospitalId().equals(hospital)){
  108 + if (CollectionUtils.isNotEmpty(chu)) {
  109 + for (AntExChuModel a : chu) {//唐山滦县导出判断初诊是否是本院
  110 + if (StringUtils.isNotEmpty(a.getHospitalId())) {
  111 + if (a.getHospitalId().equals(hospital)) {
107 112 chanResult.setYi("本院");
108   - }else{
  113 + } else {
109 114 chanResult.setYi("外院");
110 115 }
111 116 break;
112 117  
113 118  
114 119  
115 120  
116 121  
117 122  
118 123  
119 124  
... ... @@ -114,33 +119,33 @@
114 119 ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery());
115 120  
116 121 //唐山滦县判断复诊是否是本院
117   - if(CollectionUtils.isNotEmpty(ant)){
118   - for(int k = 0;k < ant.size();k++){
119   - if(k>=4){
  122 + if (CollectionUtils.isNotEmpty(ant)) {
  123 + for (int k = 0; k < ant.size(); k++) {
  124 + if (k >= 4) {
120 125 break;
121 126 }
122   - if(0==k){
123   - if(ant.get(k).getHospitalId().equals(hospital)){
  127 + if (0 == k) {
  128 + if (ant.get(k).getHospitalId().equals(hospital)) {
124 129 chanResult.setEr("本院");
125   - }else{
  130 + } else {
126 131 chanResult.setEr("外院");
127 132 }
128   - }else if(1==k){
129   - if(ant.get(k).getHospitalId().equals(hospital)){
  133 + } else if (1 == k) {
  134 + if (ant.get(k).getHospitalId().equals(hospital)) {
130 135 chanResult.setSan("本院");
131   - }else{
  136 + } else {
132 137 chanResult.setSan("外院");
133 138 }
134   - }else if(2==k){
135   - if(ant.get(k).getHospitalId().equals(hospital)){
  139 + } else if (2 == k) {
  140 + if (ant.get(k).getHospitalId().equals(hospital)) {
136 141 chanResult.setSi("本院");
137   - }else{
  142 + } else {
138 143 chanResult.setSi("外院");
139 144 }
140   - }else if(3==k){
141   - if(ant.get(k).getHospitalId().equals(hospital)){
  145 + } else if (3 == k) {
  146 + if (ant.get(k).getHospitalId().equals(hospital)) {
142 147 chanResult.setWu("本院");
143   - }else{
  148 + } else {
144 149 chanResult.setWu("外院");
145 150 }
146 151 }
147 152  
148 153  
149 154  
150 155  
... ... @@ -150,25 +155,25 @@
150 155 }
151 156 //系统初诊次数
152 157 int ichu = CollectionUtils.isEmpty(chu) ? 0 : chu.size();
153   - chanResult.setCjTimes(ichu+i);
  158 + chanResult.setCjTimes(ichu + i);
154 159  
155 160 //出院小结
156 161 DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery();
157 162 dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId());
158 163 dischargeAbstractMotherQuery.setPatientId(patients.getId());
159 164 List<DischargeAbstractMotherModel> dischargeAbstractMotherModels = dischargeAbstractMotherService.query(dischargeAbstractMotherQuery);
160   - if(dischargeAbstractMotherModels != null && dischargeAbstractMotherModels.size() > 0){
  165 + if (dischargeAbstractMotherModels != null && dischargeAbstractMotherModels.size() > 0) {
161 166 chanResult.setCyxj("有");
162   - }else{
  167 + } else {
163 168 chanResult.setCyxj("无");
164 169 }
165 170 //产后访视
166 171 MatDeliverFollowQuery mfQuery = new MatDeliverFollowQuery();
167 172 mfQuery.setPid(patients.getPid());
168 173 List<MatdeliverFollowModel> maternalDeliverList = matDeliverFollowService.query(mfQuery);
169   - if(maternalDeliverList != null && maternalDeliverList.size() > 0){
  174 + if (maternalDeliverList != null && maternalDeliverList.size() > 0) {
170 175 chanResult.setChfs("有");
171   - }else{
  176 + } else {
172 177 chanResult.setChfs("无");
173 178 }
174 179 PostReviewQuery pReviewQuery = new PostReviewQuery();
175 180  
... ... @@ -176,9 +181,9 @@
176 181 pReviewQuery.setParentId(patients.getId());
177 182 //产后复查记录
178 183 List<PostReviewModel> reviewModels = postReviewService.findWithList(pReviewQuery);
179   - if(reviewModels != null && reviewModels.size() > 0){
  184 + if (reviewModels != null && reviewModels.size() > 0) {
180 185 chanResult.setChfc("有");
181   - }else{
  186 + } else {
182 187 chanResult.setChfc("无");
183 188 }
184 189  
185 190  
186 191  
... ... @@ -200,20 +205,17 @@
200 205 chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
201 206 chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
202 207 try {
203   - if (StringUtils.isNotEmpty(patients.getSource()))
204   - {
  208 + if (StringUtils.isNotEmpty(patients.getSource())) {
205 209 Patients pat = patientsService.findOnePatientById(patients.getSource());
206 210 chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(pat.getHospitalId())).getName());
207   - }
208   - else
209   - {
  211 + } else {
210 212 chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName());
211 213 }
212 214 } catch (Exception e) {
213 215 chanResult.setFirstBH("");
214 216 }
215 217 //乡镇/街道
216   - chanResult.setStreet(CommonsHelper.getName1(patients.getStreetRegisterId(),basicConfigService));
  218 + chanResult.setStreet(CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService));
217 219 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
218 220 matDeliverQuery.setPid(patients.getPid());
219 221 matDeliverQuery.setCreatedStart(patients.getLastMenses());
... ... @@ -280,6 +282,59 @@
280 282 chanResult.setNextCheckTime(nextCheckTime);
281 283 //操作者
282 284 // chanResult.setOperator();
  285 +
  286 +
  287 + //高危因素
  288 + List<String> factor = patients.getRiskFactorId();
  289 + if (CollectionUtils.isNotEmpty(factor)) {
  290 + StringBuilder sb = new StringBuilder(56);
  291 + for (String srt : factor) {
  292 + if (StringUtils.isNotEmpty(srt)) {
  293 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(srt);
  294 + if (null != basicConfig && sb.indexOf(basicConfig.getName()) == -1) {
  295 + sb.append(basicConfig.getName()).append(',');
  296 + }
  297 + }
  298 + }
  299 + if (sb.toString().endsWith(",")) {
  300 + chanResult.setrFactor(sb.substring(0, sb.length() - 1));
  301 + } else {
  302 + chanResult.setrFactor(sb.toString());
  303 + }
  304 +
  305 + if (!"-".equals(chanResult.getrFactor()) && StringUtils.isNotEmpty(patients.getoRiskFactor())) {
  306 + chanResult.setrFactor(chanResult.getrFactor() + "," + patients.getoRiskFactor());
  307 + } else if (StringUtils.isNotEmpty(patients.getoRiskFactor())) {
  308 + chanResult.setrFactor(patients.getoRiskFactor());
  309 + }
  310 + } else if (StringUtils.isNotEmpty(patients.getoRiskFactor())) {
  311 + chanResult.setrFactor(patients.getoRiskFactor());
  312 + }
  313 + List level = new ArrayList();
  314 + if (StringUtils.isNotEmpty(patients.getRiskLevelId())) {
  315 + try {
  316 + List<String> list = JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class);
  317 + for (String str : list) {
  318 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str);
  319 + if (null != basicConfig) {
  320 + Map map = new HashMap();
  321 + basicConfig.replenRisk(map);
  322 + // String name = basicConfig.getName();
  323 + // if (name.indexOf("预警") > -1) {
  324 + // name = name.replace("预警", "");
  325 + // }
  326 + // map.put("name", name);
  327 + // map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
  328 + level.add(map);
  329 + }
  330 + }
  331 + } catch (Exception e) {
  332 + ExceptionUtils.catchException(e, "patients.getRiskLevelId error.");
  333 + }
  334 + chanResult.setrLevel(HighScoreResult.filter(level));
  335 + }
  336 +
  337 + chanResult.sethScore(patients.getRiskScore());
283 338 data.add(chanResult);
284 339 logger.debug(stopWatch.toString());
285 340 }