Commit 047344b7f9f9c36af4926c794ba842338d9da1f1
1 parent
3dfbdfd270
Exists in
master
and in
6 other branches
出院小结和自动诊断
Showing 1 changed file with 218 additions and 212 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java
View file @
047344b
... | ... | @@ -84,260 +84,266 @@ |
84 | 84 | AntExChuQuery antExChuQuery1 = new AntExChuQuery();//初诊 |
85 | 85 | antExChuQuery1.setYn(YnEnums.YES.getId()); |
86 | 86 | |
87 | - for (Patients patients : patientses) { | |
88 | - StopWatch stopWatch = new StopWatch("QuanChanPatientWorker -" + patients.getId()); | |
89 | - QuanChanResult chanResult = new QuanChanResult(); | |
90 | - chanResult.setYi("-"); | |
91 | - chanResult.setEr("-"); | |
92 | - chanResult.setSan("-"); | |
93 | - chanResult.setSi("-"); | |
94 | - chanResult.setWu("-"); | |
95 | - chanResult.convertToResult(patients); | |
96 | - //antExQuery.setParentId(patients.getId()); | |
97 | - antExQuery.setPid(patients.getPid()); | |
98 | - antExQuery.setYn(YnEnums.YES.getId()); | |
99 | - //初诊查询 | |
100 | - antExChuQuery1.setPid(patients.getPid()); | |
101 | - //antExChuQuery1.setParentId(patients.getId()); | |
102 | - //增加查询本次产程条数 | |
103 | - antExChuQuery1.setStart(patients.getLastMenses()); | |
104 | - List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1.convertToQuery()); | |
105 | - //复诊次数 | |
106 | - List<AntenatalExaminationModel> ant = null; | |
107 | - int i = 0; | |
108 | - if (CollectionUtils.isNotEmpty(chu)) { | |
109 | - for (AntExChuModel a : chu) {//唐山滦县导出判断初诊是否是本院 | |
110 | - if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
111 | - if (a.getHospitalId().equals(hospital)) { | |
112 | - chanResult.setYi("本院"); | |
113 | - } else { | |
114 | - chanResult.setYi("外院"); | |
87 | + try { | |
88 | + for (Patients patients : patientses) { | |
89 | + StopWatch stopWatch = new StopWatch("QuanChanPatientWorker -" + patients.getId()); | |
90 | + QuanChanResult chanResult = new QuanChanResult(); | |
91 | + chanResult.setYi("-"); | |
92 | + chanResult.setEr("-"); | |
93 | + chanResult.setSan("-"); | |
94 | + chanResult.setSi("-"); | |
95 | + chanResult.setWu("-"); | |
96 | + chanResult.convertToResult(patients); | |
97 | + //antExQuery.setParentId(patients.getId()); | |
98 | + antExQuery.setPid(patients.getPid()); | |
99 | + antExQuery.setYn(YnEnums.YES.getId()); | |
100 | + //初诊查询 | |
101 | + antExChuQuery1.setPid(patients.getPid()); | |
102 | + //antExChuQuery1.setParentId(patients.getId()); | |
103 | + //增加查询本次产程条数 | |
104 | + antExChuQuery1.setStart(patients.getLastMenses()); | |
105 | + List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1.convertToQuery()); | |
106 | + //复诊次数 | |
107 | + List<AntenatalExaminationModel> ant = null; | |
108 | + int i = 0; | |
109 | + if (CollectionUtils.isNotEmpty(chu)) { | |
110 | + for (AntExChuModel a : chu) {//唐山滦县导出判断初诊是否是本院 | |
111 | + if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
112 | + if (a.getHospitalId().equals(hospital)) { | |
113 | + chanResult.setYi("本院"); | |
114 | + } else { | |
115 | + chanResult.setYi("外院"); | |
116 | + } | |
117 | + break; | |
115 | 118 | } |
116 | - break; | |
117 | 119 | } |
118 | - } | |
119 | - ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
120 | + ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
120 | 121 | |
121 | - //唐山滦县判断复诊是否是本院 | |
122 | - if (CollectionUtils.isNotEmpty(ant)) { | |
123 | - for (int k = 0; k < ant.size(); k++) { | |
124 | - if (k >= 4) { | |
125 | - break; | |
126 | - } | |
127 | - if (0 == k) { | |
128 | - if (ant.get(k).getHospitalId().equals(hospital)) { | |
129 | - chanResult.setEr("本院"); | |
130 | - } else { | |
131 | - chanResult.setEr("外院"); | |
122 | + //唐山滦县判断复诊是否是本院 | |
123 | + if (CollectionUtils.isNotEmpty(ant)) { | |
124 | + for (int k = 0; k < ant.size(); k++) { | |
125 | + if (k >= 4) { | |
126 | + break; | |
132 | 127 | } |
133 | - } else if (1 == k) { | |
134 | - if (ant.get(k).getHospitalId().equals(hospital)) { | |
135 | - chanResult.setSan("本院"); | |
136 | - } else { | |
137 | - chanResult.setSan("外院"); | |
128 | + if (0 == k) { | |
129 | + if (ant.get(k).getHospitalId().equals(hospital)) { | |
130 | + chanResult.setEr("本院"); | |
131 | + } else { | |
132 | + chanResult.setEr("外院"); | |
133 | + } | |
134 | + } else if (1 == k) { | |
135 | + if (ant.get(k).getHospitalId().equals(hospital)) { | |
136 | + chanResult.setSan("本院"); | |
137 | + } else { | |
138 | + chanResult.setSan("外院"); | |
139 | + } | |
140 | + } else if (2 == k) { | |
141 | + if (ant.get(k).getHospitalId().equals(hospital)) { | |
142 | + chanResult.setSi("本院"); | |
143 | + } else { | |
144 | + chanResult.setSi("外院"); | |
145 | + } | |
146 | + } else if (3 == k) { | |
147 | + if (ant.get(k).getHospitalId().equals(hospital)) { | |
148 | + chanResult.setWu("本院"); | |
149 | + } else { | |
150 | + chanResult.setWu("外院"); | |
151 | + } | |
138 | 152 | } |
139 | - } else if (2 == k) { | |
140 | - if (ant.get(k).getHospitalId().equals(hospital)) { | |
141 | - chanResult.setSi("本院"); | |
142 | - } else { | |
143 | - chanResult.setSi("外院"); | |
144 | - } | |
145 | - } else if (3 == k) { | |
146 | - if (ant.get(k).getHospitalId().equals(hospital)) { | |
147 | - chanResult.setWu("本院"); | |
148 | - } else { | |
149 | - chanResult.setWu("外院"); | |
150 | - } | |
151 | 153 | } |
154 | + i = ant.size(); | |
152 | 155 | } |
153 | - i = ant.size(); | |
154 | 156 | } |
155 | - } | |
156 | - //系统初诊次数 | |
157 | - int ichu = CollectionUtils.isEmpty(chu) ? 0 : chu.size(); | |
158 | - chanResult.setCjTimes(ichu + i); | |
157 | + //系统初诊次数 | |
158 | + int ichu = CollectionUtils.isEmpty(chu) ? 0 : chu.size(); | |
159 | + chanResult.setCjTimes(ichu + i); | |
159 | 160 | |
160 | - //出院小结 | |
161 | - DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery(); | |
162 | - dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId()); | |
163 | - dischargeAbstractMotherQuery.setPatientId(patients.getId()); | |
164 | - List<DischargeAbstractMotherModel> dischargeAbstractMotherModels = dischargeAbstractMotherService.query(dischargeAbstractMotherQuery); | |
165 | - if (dischargeAbstractMotherModels != null && dischargeAbstractMotherModels.size() > 0) { | |
166 | - chanResult.setCyxj("有"); | |
167 | - } else { | |
168 | - chanResult.setCyxj("无"); | |
169 | - } | |
170 | - //产后访视 | |
171 | - MatDeliverFollowQuery mfQuery = new MatDeliverFollowQuery(); | |
172 | - mfQuery.setPid(patients.getPid()); | |
173 | - List<MatdeliverFollowModel> maternalDeliverList = matDeliverFollowService.query(mfQuery); | |
174 | - if (maternalDeliverList != null && maternalDeliverList.size() > 0) { | |
175 | - chanResult.setChfs("有"); | |
176 | - } else { | |
177 | - chanResult.setChfs("无"); | |
178 | - } | |
179 | - PostReviewQuery pReviewQuery = new PostReviewQuery(); | |
180 | - pReviewQuery.setYn(YnEnums.YES.getId()); | |
181 | - pReviewQuery.setParentId(patients.getId()); | |
182 | - //产后复查记录 | |
183 | - List<PostReviewModel> reviewModels = postReviewService.findWithList(pReviewQuery); | |
184 | - if (reviewModels != null && reviewModels.size() > 0) { | |
185 | - chanResult.setChfc("有"); | |
186 | - } else { | |
187 | - chanResult.setChfc("无"); | |
188 | - } | |
161 | + //出院小结 | |
162 | + DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery(); | |
163 | + dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId()); | |
164 | + dischargeAbstractMotherQuery.setPatientId(patients.getId()); | |
165 | + List<DischargeAbstractMotherModel> dischargeAbstractMotherModels = dischargeAbstractMotherService.query(dischargeAbstractMotherQuery); | |
166 | + if (dischargeAbstractMotherModels != null && dischargeAbstractMotherModels.size() > 0) { | |
167 | + chanResult.setCyxj("有"); | |
168 | + } else { | |
169 | + chanResult.setCyxj("无"); | |
170 | + } | |
171 | + //产后访视 | |
172 | + MatDeliverFollowQuery mfQuery = new MatDeliverFollowQuery(); | |
173 | + mfQuery.setPid(patients.getPid()); | |
174 | + List<MatdeliverFollowModel> maternalDeliverList = matDeliverFollowService.query(mfQuery); | |
175 | + if (maternalDeliverList != null && maternalDeliverList.size() > 0) { | |
176 | + chanResult.setChfs("有"); | |
177 | + } else { | |
178 | + chanResult.setChfs("无"); | |
179 | + } | |
180 | + PostReviewQuery pReviewQuery = new PostReviewQuery(); | |
181 | + pReviewQuery.setYn(YnEnums.YES.getId()); | |
182 | + pReviewQuery.setParentId(patients.getId()); | |
183 | + //产后复查记录 | |
184 | + List<PostReviewModel> reviewModels = postReviewService.findWithList(pReviewQuery); | |
185 | + if (reviewModels != null && reviewModels.size() > 0) { | |
186 | + chanResult.setChfc("有"); | |
187 | + } else { | |
188 | + chanResult.setChfc("无"); | |
189 | + } | |
189 | 190 | |
190 | 191 | |
191 | - if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
192 | - if (NumberUtils.isNumber(patients.getBookbuildingDoctor())) { | |
193 | - Users users = usersService.getUsers(NumberUtils.toInt(patients.getBookbuildingDoctor())); | |
194 | - if (null != users) { | |
195 | - chanResult.setlName(users.getName()); | |
192 | + if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
193 | + if (NumberUtils.isNumber(patients.getBookbuildingDoctor())) { | |
194 | + Users users = usersService.getUsers(NumberUtils.toInt(patients.getBookbuildingDoctor())); | |
195 | + if (null != users) { | |
196 | + chanResult.setlName(users.getName()); | |
197 | + } else { | |
198 | + chanResult.setlName(patients.getBookbuildingDoctor()); | |
199 | + } | |
196 | 200 | } else { |
197 | 201 | chanResult.setlName(patients.getBookbuildingDoctor()); |
198 | 202 | } |
199 | - } else { | |
200 | - chanResult.setlName(patients.getBookbuildingDoctor()); | |
201 | 203 | } |
202 | - } | |
203 | - chanResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
204 | - //注册地址 | |
205 | - chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
206 | - chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
207 | - try { | |
208 | - if (StringUtils.isNotEmpty(patients.getSource())) { | |
209 | - Patients pat = patientsService.findOnePatientById(patients.getSource()); | |
210 | - chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(pat.getHospitalId())).getName()); | |
211 | - } else { | |
212 | - chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); | |
213 | - } | |
214 | - } catch (Exception e) { | |
215 | - chanResult.setFirstBH(""); | |
216 | - } | |
217 | - //乡镇/街道 | |
218 | - chanResult.setStreet(CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService)); | |
219 | - MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
220 | - matDeliverQuery.setPid(patients.getPid()); | |
221 | - matDeliverQuery.setCreatedStart(patients.getLastMenses()); | |
222 | - matDeliverQuery.setYn(YnEnums.YES.getId()); | |
223 | - stopWatch.start("query matdeliver"); | |
224 | - List<MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(matDeliverQuery); | |
225 | - if (CollectionUtils.isNotEmpty(maternalDeliverModels)) { | |
226 | - chanResult.setTireNumber(TaiShuEnums.getTitle(maternalDeliverModels.get(0).getTireNumber() + "")); | |
204 | + chanResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
205 | + //注册地址 | |
206 | + chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
207 | + chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
227 | 208 | try { |
228 | - chanResult.setfCh(organizationService.getOrganization(Integer.valueOf(maternalDeliverModels.get(0).getHospitalId())).getName()); | |
209 | + if (StringUtils.isNotEmpty(patients.getSource())) { | |
210 | + Patients pat = patientsService.findOnePatientById(patients.getSource()); | |
211 | + chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(pat.getHospitalId())).getName()); | |
212 | + } else { | |
213 | + chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); | |
214 | + } | |
229 | 215 | } catch (Exception e) { |
230 | - chanResult.setfCh(""); | |
216 | + chanResult.setFirstBH(""); | |
231 | 217 | } |
232 | - } | |
233 | - stopWatch.stop(); | |
234 | - //复查次数 | |
235 | - PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
236 | - postReviewQuery.setPid(patients.getPid()); | |
237 | - postReviewQuery.setYn(YnEnums.YES.getId()); | |
238 | - //增加查询本次产程条数 | |
239 | - postReviewQuery.setStart(patients.getFmDate()); | |
218 | + //乡镇/街道 | |
219 | + chanResult.setStreet(CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService)); | |
220 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
221 | + matDeliverQuery.setPid(patients.getPid()); | |
222 | + matDeliverQuery.setCreatedStart(patients.getLastMenses()); | |
223 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
224 | + stopWatch.start("query matdeliver"); | |
225 | + List<MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(matDeliverQuery); | |
226 | + if (CollectionUtils.isNotEmpty(maternalDeliverModels)) { | |
227 | + chanResult.setTireNumber(TaiShuEnums.getTitle(maternalDeliverModels.get(0).getTireNumber() + "")); | |
228 | + try { | |
229 | + chanResult.setfCh(organizationService.getOrganization(Integer.valueOf(maternalDeliverModels.get(0).getHospitalId())).getName()); | |
230 | + } catch (Exception e) { | |
231 | + chanResult.setfCh(""); | |
232 | + } | |
233 | + } | |
234 | + stopWatch.stop(); | |
235 | + //复查次数 | |
236 | + PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
237 | + postReviewQuery.setPid(patients.getPid()); | |
238 | + postReviewQuery.setYn(YnEnums.YES.getId()); | |
239 | + //增加查询本次产程条数 | |
240 | + postReviewQuery.setStart(patients.getFmDate()); | |
240 | 241 | |
241 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
242 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
243 | - patientsQuery.setPid(patients.getPid()); | |
244 | - patientsQuery.setLastMensesStart(patients.getFmDate()); | |
245 | - List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
246 | - if (CollectionUtils.isNotEmpty(patientses)) { | |
247 | - postReviewQuery.setEnd(patientses.get(0).getLastMenses()); | |
248 | - } | |
249 | - | |
250 | - stopWatch.start("query postreview list"); | |
251 | - List<PostReviewModel> withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
252 | - if (CollectionUtils.isNotEmpty(withList)) { | |
253 | - Users users = usersService.getUsers(NumberUtils.toInt(withList.get(0).getProdDoctor())); | |
254 | - if (null != users) { | |
255 | - chanResult.setCheckDoctor(users.getName()); | |
256 | - } else { | |
257 | - chanResult.setCheckDoctor(withList.get(0).getProdDoctor()); | |
242 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
243 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
244 | + patientsQuery.setPid(patients.getPid()); | |
245 | + patientsQuery.setLastMensesStart(patients.getFmDate()); | |
246 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
247 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
248 | + postReviewQuery.setEnd(patientses.get(0).getLastMenses()); | |
258 | 249 | } |
259 | - } | |
260 | - String nextCheckTime = ""; | |
261 | - if (CollectionUtils.isNotEmpty(withList)) { | |
262 | - chanResult.setcTimes(withList.size()); | |
263 | - if (null != withList.get(0).getNextCheckTime()) { | |
264 | - nextCheckTime = DateUtil.getyyyy_MM_dd(withList.get(0).getNextCheckTime()); | |
265 | - } | |
266 | - postReviewQuery.setHospitalId(hospital); | |
267 | 250 | |
268 | - withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
251 | + stopWatch.start("query postreview list"); | |
252 | + List<PostReviewModel> withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
269 | 253 | if (CollectionUtils.isNotEmpty(withList)) { |
270 | - //本院产后复查次数不为空 | |
271 | - chanResult.setcHTimes(withList.size()); | |
254 | + Users users = usersService.getUsers(NumberUtils.toInt(withList.get(0).getProdDoctor())); | |
255 | + if (null != users) { | |
256 | + chanResult.setCheckDoctor(users.getName()); | |
257 | + } else { | |
258 | + chanResult.setCheckDoctor(withList.get(0).getProdDoctor()); | |
259 | + } | |
260 | + } | |
261 | + String nextCheckTime = ""; | |
262 | + if (CollectionUtils.isNotEmpty(withList)) { | |
263 | + chanResult.setcTimes(withList.size()); | |
264 | + if (null != withList.get(0).getNextCheckTime()) { | |
265 | + nextCheckTime = DateUtil.getyyyy_MM_dd(withList.get(0).getNextCheckTime()); | |
266 | + } | |
267 | + postReviewQuery.setHospitalId(hospital); | |
268 | + | |
269 | + withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
270 | + if (CollectionUtils.isNotEmpty(withList)) { | |
271 | + //本院产后复查次数不为空 | |
272 | + chanResult.setcHTimes(withList.size()); | |
272 | 273 | // if (null != patients.getPostViewTimes()) { |
273 | 274 | // chanResult.setcHTimes(patients.getPostViewTimes()); |
274 | 275 | // } else { |
275 | 276 | // chanResult.setcHTimes(withList.size()); |
276 | 277 | // } |
278 | + } | |
277 | 279 | } |
278 | - } | |
279 | - stopWatch.stop(); | |
280 | - chanResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType())); | |
281 | - chanResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus())); | |
282 | - chanResult.setNextCheckTime(nextCheckTime); | |
283 | - //操作者 | |
280 | + stopWatch.stop(); | |
281 | + chanResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType())); | |
282 | + chanResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus())); | |
283 | + chanResult.setNextCheckTime(nextCheckTime); | |
284 | + //操作者 | |
284 | 285 | // chanResult.setOperator(); |
285 | 286 | |
286 | 287 | |
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(','); | |
288 | + //高危因素 | |
289 | + List<String> factor = patients.getRiskFactorId(); | |
290 | + if (CollectionUtils.isNotEmpty(factor)) { | |
291 | + StringBuilder sb = new StringBuilder(56); | |
292 | + for (String srt : factor) { | |
293 | + if (StringUtils.isNotEmpty(srt)) { | |
294 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(srt); | |
295 | + if (null != basicConfig && sb.indexOf(basicConfig.getName()) == -1) { | |
296 | + sb.append(basicConfig.getName()).append(','); | |
297 | + } | |
296 | 298 | } |
297 | 299 | } |
298 | - } | |
299 | - if (sb.toString().endsWith(",")) { | |
300 | - chanResult.setrFactor(sb.substring(0, sb.length() - 1)); | |
301 | - } else { | |
302 | - chanResult.setrFactor(sb.toString()); | |
303 | - } | |
300 | + if (sb.toString().endsWith(",")) { | |
301 | + chanResult.setrFactor(sb.substring(0, sb.length() - 1)); | |
302 | + } else { | |
303 | + chanResult.setrFactor(sb.toString()); | |
304 | + } | |
304 | 305 | |
305 | - if (!"-".equals(chanResult.getrFactor()) && StringUtils.isNotEmpty(patients.getoRiskFactor())) { | |
306 | - chanResult.setrFactor(chanResult.getrFactor() + "," + patients.getoRiskFactor()); | |
306 | + if (!"-".equals(chanResult.getrFactor()) && StringUtils.isNotEmpty(patients.getoRiskFactor())) { | |
307 | + chanResult.setrFactor(chanResult.getrFactor() + "," + patients.getoRiskFactor()); | |
308 | + } else if (StringUtils.isNotEmpty(patients.getoRiskFactor())) { | |
309 | + chanResult.setrFactor(patients.getoRiskFactor()); | |
310 | + } | |
307 | 311 | } else if (StringUtils.isNotEmpty(patients.getoRiskFactor())) { |
308 | 312 | chanResult.setrFactor(patients.getoRiskFactor()); |
309 | 313 | } |
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); | |
314 | + List level = new ArrayList(); | |
315 | + if (StringUtils.isNotEmpty(patients.getRiskLevelId())) { | |
316 | + try { | |
317 | + List<String> list = JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class); | |
318 | + for (String str : list) { | |
319 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str); | |
320 | + if (null != basicConfig) { | |
321 | + Map map = new HashMap(); | |
322 | + basicConfig.replenRisk(map); | |
323 | + // String name = basicConfig.getName(); | |
324 | + // if (name.indexOf("预警") > -1) { | |
325 | + // name = name.replace("预警", ""); | |
326 | + // } | |
327 | + // map.put("name", name); | |
328 | + // map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
329 | + level.add(map); | |
330 | + } | |
329 | 331 | } |
332 | + } catch (Exception e) { | |
333 | + ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); | |
330 | 334 | } |
331 | - } catch (Exception e) { | |
332 | - ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); | |
335 | + chanResult.setrLevel(HighScoreResult.filter(level)); | |
333 | 336 | } |
334 | - chanResult.setrLevel(HighScoreResult.filter(level)); | |
335 | - } | |
336 | 337 | |
337 | - chanResult.sethScore(patients.getRiskScore()); | |
338 | - data.add(chanResult); | |
339 | - logger.debug(stopWatch.toString()); | |
338 | + chanResult.sethScore(patients.getRiskScore()); | |
339 | + data.add(chanResult); | |
340 | + logger.debug(stopWatch.toString()); | |
341 | + } | |
342 | + }catch (Exception e) | |
343 | + { | |
344 | + ExceptionUtils.catchException(e, "convertToQuanCPatient get result error."); | |
340 | 345 | } |
346 | + | |
341 | 347 | return data; |
342 | 348 | } |
343 | 349 | } |