Commit 085dbc759b8e26b3a4c75371670698c2e8dfc53a

Authored by yangfei
1 parent 2749771d18
Exists in master and in 1 other branch dev

儿童显示历史检查报告

Showing 2 changed files with 323 additions and 439 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java View file @ 085dbc7
... ... @@ -16,8 +16,6 @@
16 16 import com.lyms.platform.permission.model.LisReportModel;
17 17 import com.lyms.platform.permission.service.LisService;
18 18 import org.apache.commons.collections.CollectionUtils;
19   -import org.slf4j.Logger;
20   -import org.slf4j.LoggerFactory;
21 19 import org.springframework.beans.factory.annotation.Autowired;
22 20 import org.springframework.beans.factory.annotation.Qualifier;
23 21 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
... ... @@ -124,6 +122,7 @@
124 122 * @param sortType 排序类型(1,根据日期分类;2,根据检查项目分类)
125 123 * @param phone 手机号码
126 124 * @param cardNo 身份证号码
  125 + * @param perType 2-儿童
127 126 * @return
128 127 */
129 128 @RequestMapping(method = RequestMethod.GET, value = "/getLisAndRisData")
130 129  
... ... @@ -133,9 +132,10 @@
133 132 @RequestParam("sortType") Integer sortType,
134 133 @RequestParam(required = false) String phone,
135 134 @RequestParam(required = false) String cardNo,
  135 + @RequestParam(defaultValue = "1") Integer perType,//默认孕妇
136 136 HttpServletRequest request) {
137 137 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
138   - return lisFacade.getLisAndRisData(vcCardNo, phone,cardNo, sortType, loginState.getId());
  138 + return lisFacade.getLisAndRisData(vcCardNo, phone,cardNo, sortType,perType, loginState.getId());
139 139 }
140 140  
141 141  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java View file @ 085dbc7
Diff suppressed. Click to show
1 1 package com.lyms.platform.operate.web.facade;
2 2  
3 3 import com.lyms.hospitalapi.Cdfy.CdfyHisService;
4   -import com.lyms.hospitalapi.Nczxyy.NczxyyLisService;
5 4 import com.lyms.hospitalapi.dzfy.DzfyHisService;
6   -import com.lyms.hospitalapi.zcfy.ZcfyHisService;
7 5 import com.lyms.hospitalapi.pojo.CheckByDate;
8 6 import com.lyms.hospitalapi.pojo.CheckItemResponse;
9 7 import com.lyms.hospitalapi.pojo.CheckResponse;
10 8 import com.lyms.hospitalapi.pojo.CheckType;
11 9 import com.lyms.hospitalapi.qhdfy.QhdfyHisService;
12 10 import com.lyms.hospitalapi.wxrmyy.WxHisService;
13   -import com.lyms.platform.biz.service.*;
  11 +import com.lyms.hospitalapi.zcfy.ZcfyHisService;
  12 +import com.lyms.platform.biz.service.PatientsService;
14 13 import com.lyms.platform.common.constants.ErrorCodeConstants;
15   -import com.lyms.platform.common.enums.*;
  14 +import com.lyms.platform.common.enums.YnEnums;
16 15 import com.lyms.platform.common.result.BaseObjectResponse;
17 16 import com.lyms.platform.common.result.BaseResponse;
18   -import com.lyms.platform.common.utils.*;
19   -import com.lyms.platform.operate.web.request.*;
20   -import com.lyms.platform.operate.web.result.*;
  17 +import com.lyms.platform.common.utils.DateUtil;
  18 +import com.lyms.platform.common.utils.ExceptionUtils;
  19 +import com.lyms.platform.common.utils.JsonUtil;
  20 +import com.lyms.platform.common.utils.PropertiesUtils;
21 21 import com.lyms.platform.operate.web.utils.LisHandleTask;
22 22 import com.lyms.platform.permission.model.*;
23   -import com.lyms.platform.permission.model.LisReportQuery;
24 23 import com.lyms.platform.permission.service.LisService;
25 24 import com.lyms.platform.permission.service.OrganizationService;
26   -import com.lyms.platform.permission.service.UsersService;
27   -import com.lyms.platform.pojo.*;
28   -import com.lyms.platform.query.*;
  25 +import com.lyms.platform.pojo.Patients;
  26 +import com.lyms.platform.query.PatientsQuery;
29 27 import org.apache.commons.collections.CollectionUtils;
30 28 import org.apache.commons.lang.StringUtils;
31   -import org.apache.commons.lang.math.NumberUtils;
32 29 import org.springframework.beans.factory.annotation.Autowired;
33 30 import org.springframework.beans.factory.annotation.Qualifier;
34   -import org.springframework.data.domain.Sort;
35 31 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
36 32 import org.springframework.stereotype.Component;
37 33  
38   -import javax.servlet.http.HttpServletRequest;
39 34 import java.util.*;
40   -import java.util.concurrent.*;
  35 +import java.util.concurrent.Callable;
  36 +import java.util.concurrent.Future;
41 37  
42 38 /**
43 39 *
44 40  
45 41  
46 42  
47 43  
48 44  
... ... @@ -82,22 +78,24 @@
82 78  
83 79 /**
84 80 * 获取lis和ris检验报告
  81 + *
85 82 * @param vcCardNo 就诊卡号
86 83 * @param sortType 排序类型(1,根据日期分类;2,根据检查项目分类)
  84 + * @param perType 2-儿童,其他是孕妇
87 85 * @return
88 86 */
89   - public BaseResponse getLisAndRisData(String vcCardNo,String phone,String cardNo,Integer sortType,Integer userId) {
  87 + public BaseResponse getLisAndRisData(String vcCardNo, String phone, String cardNo, Integer sortType, int perType, Integer userId) {
90 88  
91   - List<CheckByDate> checkByDate=new ArrayList<CheckByDate>();
  89 + List<CheckByDate> checkByDate = new ArrayList<CheckByDate>();
92 90 //根据用户id获取医院ID
93 91 String hospitalId = autoMatchFacade.getHospitalId(userId);
94 92  
95   - List<CheckResponse> result = queryLisCheckList(vcCardNo,phone,hospitalId,cardNo);
  93 + List<CheckResponse> result = queryLisCheckList(vcCardNo, phone, hospitalId, cardNo, perType);
96 94  
97 95 //排序检查大项
98 96 sortLis(result);
99 97  
100   - if(1 == sortType){
  98 + if (1 == sortType) {
101 99 List<String> keyList = new ArrayList<>();
102 100 for (CheckResponse check : result) {
103 101 //明细项排序
104 102  
... ... @@ -109,16 +107,16 @@
109 107 }
110 108 }
111 109  
112   - for(String time : keyList){
113   - List<CheckType> CheckType=new ArrayList<CheckType>();
114   - List<CheckResponse> result2=new ArrayList<>();//存放所有检验报告(type=1)
  110 + for (String time : keyList) {
  111 + List<CheckType> CheckType = new ArrayList<CheckType>();
  112 + List<CheckResponse> result2 = new ArrayList<>();//存放所有检验报告(type=1)
115 113  
116 114 CheckType jianyan = new CheckType();
117 115 jianyan.setType("检验报告");
118 116  
119   - for(CheckResponse chre : result){
120   - if(time.equals(DateUtil.getyyyy_MM_dd(chre.getApplyDate()))){
121   - if(chre.getType() == 1){
  117 + for (CheckResponse chre : result) {
  118 + if (time.equals(DateUtil.getyyyy_MM_dd(chre.getApplyDate()))) {
  119 + if (chre.getType() == 1) {
122 120 result2.add(chre);
123 121 }
124 122 }
125 123  
... ... @@ -127,12 +125,12 @@
127 125 jianyan.setTypeName(result2);
128 126 CheckType.add(jianyan);
129 127  
130   - CheckByDate CheckByDate1=new CheckByDate();
  128 + CheckByDate CheckByDate1 = new CheckByDate();
131 129 CheckByDate1.setTime(time);
132 130 CheckByDate1.setTypes(CheckType);
133 131 checkByDate.add(CheckByDate1);
134 132 }
135   - }else{
  133 + } else {
136 134 CheckByDate checkByItem = new CheckByDate();
137 135 checkByItem.setTime("检验报告");
138 136 checkByDate.add(checkByItem);
139 137  
140 138  
... ... @@ -146,14 +144,11 @@
146 144 CheckType CheckType1 = new CheckType();
147 145 result2.add(check);
148 146  
149   - if(result2.size() > 0){
  147 + if (result2.size() > 0) {
150 148 //秦皇岛显示检验报告类别名称
151   - if ("216".equals(hospitalId))
152   - {
  149 + if ("216".equals(hospitalId)) {
153 150 CheckType1.setType(check.getLisTypeName() + " " + DateUtil.getyyyy_MM_dd(check.getApplyDate()));
154   - }
155   - else
156   - {
  151 + } else {
157 152 CheckType1.setType(check.getTitle());
158 153 }
159 154 CheckType1.setTypeName(result2);
160 155  
161 156  
162 157  
... ... @@ -166,19 +161,17 @@
166 161 }
167 162  
168 163 // 排序
169   - private void sortLis(List<CheckResponse> result)
170   - {
171   - if (CollectionUtils.isNotEmpty(result))
172   - {
  164 + private void sortLis(List<CheckResponse> result) {
  165 + if (CollectionUtils.isNotEmpty(result)) {
173 166 Collections.sort(result, new Comparator() {
174 167 public int compare(Object a, Object b) {
175   - if (((CheckResponse)a).getApplyDate() == null) {
  168 + if (((CheckResponse) a).getApplyDate() == null) {
176 169 return -1;
177 170 }
178   - if (((CheckResponse)b).getApplyDate() == null) {
  171 + if (((CheckResponse) b).getApplyDate() == null) {
179 172 return -1;
180 173 }
181   - if (((CheckResponse)a).getApplyDate().before(((CheckResponse)b).getApplyDate())) {
  174 + if (((CheckResponse) a).getApplyDate().before(((CheckResponse) b).getApplyDate())) {
182 175 return 1;
183 176 }
184 177 return -1;
185 178  
... ... @@ -189,13 +182,12 @@
189 182  
190 183 /**
191 184 * 排序检查详情
  185 + *
192 186 * @param check
193 187 */
194   - private void sortLisItems(CheckResponse check)
195   - {
196   - List<CheckItemResponse> items = check.getItemList();
197   - if (CollectionUtils.isNotEmpty(items))
198   - {
  188 + private void sortLisItems(CheckResponse check) {
  189 + List<CheckItemResponse> items = check.getItemList();
  190 + if (CollectionUtils.isNotEmpty(items)) {
199 191 Collections.sort(items, new Comparator() {
200 192 public int compare(Object a, Object b) {
201 193 String orderA = ((CheckItemResponse) a).getPrintOrder();
... ... @@ -208,8 +200,7 @@
208 200 return -1;
209 201 }
210 202 if (com.lyms.platform.common.utils.StringUtils.isNum(orderA) &&
211   - com.lyms.platform.common.utils.StringUtils.isNum(orderB))
212   - {
  203 + com.lyms.platform.common.utils.StringUtils.isNum(orderB)) {
213 204 int sortNum1 = Integer.parseInt(orderA);
214 205 int sortNum2 = Integer.parseInt(orderB);
215 206 return sortNum1 - sortNum2;
216 207  
217 208  
218 209  
219 210  
220 211  
221 212  
222 213  
223 214  
224 215  
225 216  
226 217  
227 218  
228 219  
229 220  
230 221  
231 222  
232 223  
233 224  
234 225  
235 226  
236 227  
237 228  
... ... @@ -229,138 +220,136 @@
229 220 * 2、再根据pid查询到这个孕妇在区域所有的建档记录
230 221 * 3、分别取每个建档中的医院id和就诊卡号在lis记录表中查询数据
231 222 * 4、封装lis数据
232   - * @param vcCardNo 就诊卡号
233   - * @param phone 手机号码
  223 + *
  224 + * @param vcCardNo 就诊卡号
  225 + * @param phone 手机号码
234 226 * @param hospitalId 用户ID
235   - * @param cardNo 身份证号码
  227 + * @param cardNo 身份证号码
  228 + * @param perType 2-儿童
236 229 * @return
237 230 */
238   - public List<CheckResponse> queryLisCheckList(String vcCardNo,String phone,String hospitalId,String cardNo) {
  231 + public List<CheckResponse> queryLisCheckList(String vcCardNo, String phone, String hospitalId, String cardNo, int perType) {
239 232  
240 233 //保存这个人在所有医院的lis记录
241 234 List<CheckResponse> result = new ArrayList<>();
242 235  
243 236 //缓存查询到的医院
244   - Map<String,String> hIdNames = new HashMap<>();
  237 + Map<String, String> hIdNames = new HashMap<>();
245 238  
246   -
247   -
  239 + List<LisReportModel> lises = Collections.EMPTY_LIST;
  240 + String hospitalName = "";
248 241 OrganizationQuery organizationQuery = new OrganizationQuery();
249 242 organizationQuery.setYn(YnEnums.YES.getId());
250 243  
251   - PatientsQuery patientsQuery=new PatientsQuery();
252   - String[] strs = new String[]{phone, vcCardNo,cardNo};
253   - patientsQuery.setPv(strs);
254   - patientsQuery.setHospitalId(hospitalId);
255   - patientsQuery.setYn(YnEnums.YES.getId());
256   - //通过医院id和就诊卡号或者手机号码查询到孕妇信息
257   - List<Patients> list= patientsService.queryPatient(patientsQuery);
258   - if(CollectionUtils.isNotEmpty(list)){
  244 + LisReportQuery model = new LisReportQuery();
259 245  
260   - Patients patients = list.get(0);
261   - patientsQuery.setPid(patients.getPid());
262   - patientsQuery.setVcCardNo(null);
263   - patientsQuery.setHospitalId(null);
264   - patientsQuery.setPv(null);
265 246  
266   - //通过上面就诊号查询到的人的所有建档记录 包括其他医院的建档记录
267   - list= patientsService.queryPatient(patientsQuery);
268   - if(CollectionUtils.isNotEmpty(list)){
269   - for(Patients pat : list)
270   - {
271   - if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId()))
272   - {
  247 + if (perType == 2) {//儿童
  248 + model.setHospitalId(hospitalId);
  249 + //通过就诊卡号和医院id查询到医院下面的lis记录
  250 + lises = queryLisData(vcCardNo, "", "",perType, model);
  251 + } else {
  252 + PatientsQuery patientsQuery = new PatientsQuery();
  253 + String[] strs = new String[]{phone, vcCardNo, cardNo};
  254 + patientsQuery.setPv(strs);
  255 + patientsQuery.setHospitalId(hospitalId);
  256 + patientsQuery.setYn(YnEnums.YES.getId());
  257 + //通过医院id和就诊卡号或者手机号码查询到孕妇信息
  258 + List<Patients> list = patientsService.queryPatient(patientsQuery);
  259 + if (CollectionUtils.isNotEmpty(list)) {
  260 + Patients patients = list.get(0);
  261 + patientsQuery.setPid(patients.getPid());
  262 + patientsQuery.setVcCardNo(null);
  263 + patientsQuery.setHospitalId(null);
  264 + patientsQuery.setPv(null);
273 265  
274   - if (StringUtils.isEmpty(pat.getVcCardNo()) && StringUtils.isEmpty(pat.getPhone()) && StringUtils.isEmpty(pat.getCardNo()))
275   - {
276   - continue;
277   - }
  266 + //通过上面就诊号查询到的人的所有建档记录 包括其他医院的建档记录
  267 + list = patientsService.queryPatient(patientsQuery);
  268 + if (CollectionUtils.isNotEmpty(list)) {
  269 + for (Patients pat : list) {
  270 + if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId())) {
278 271  
279   - //获取医院的名称
280   - String hospitalName = hIdNames.get(pat.getHospitalId());
281   - if (!StringUtils.isNotEmpty(hospitalName))
282   - {
283   - organizationQuery.setId(Integer.parseInt(pat.getHospitalId()));
284   - List<Organization> hospitals = organizationService.queryOrganization(organizationQuery);
285   - if (CollectionUtils.isNotEmpty(hospitals))
286   - {
287   - hospitalName = hospitals.get(0).getName();
288   - hIdNames.put(hospitals.get(0).getId()+"",hospitalName);
  272 + if (StringUtils.isEmpty(pat.getVcCardNo()) && StringUtils.isEmpty(pat.getPhone()) && StringUtils.isEmpty(pat.getCardNo())) {
  273 + continue;
289 274 }
290   - }
291   - LisReportQuery model = new LisReportQuery();
292   - model.setHospitalId(pat.getHospitalId());
293   - //通过就诊卡号和医院id查询到医院下面的lis记录
294   - List<LisReportModel> lises = queryLisData(pat.getVcCardNo(), pat.getPhone(),pat.getCardNo(), model);
295   - if (CollectionUtils.isNotEmpty(lises))
296   - {
297   - for (LisReportModel lis : lises)
298   - {
299   - CheckResponse check = new CheckResponse();
300 275  
301   - check.setLisTypeName(lis.getType());
302   - check.setModified(lis.getModified());
303   - check.setType(1); /* 1:检验报告,2:影像报告 */
304   - check.setName(lis.getName());
305   - check.setTitle(lis.getTitle());
306   - check.setHospitalName(hospitalName);
307   - if (lis.getAge() != null) {
308   - check.setAge(lis.getAge().toString());
  276 + //获取医院的名称
  277 + hospitalName = hIdNames.get(pat.getHospitalId());
  278 + if (!StringUtils.isNotEmpty(hospitalName)) {
  279 + organizationQuery.setId(Integer.parseInt(pat.getHospitalId()));
  280 + List<Organization> hospitals = organizationService.queryOrganization(organizationQuery);
  281 + if (CollectionUtils.isNotEmpty(hospitals)) {
  282 + hospitalName = hospitals.get(0).getName();
  283 + hIdNames.put(hospitals.get(0).getId() + "", hospitalName);
309 284 }
  285 + }
  286 + model.setHospitalId(pat.getHospitalId());
  287 + //通过就诊卡号和医院id查询到医院下面的lis记录
  288 + lises = queryLisData(pat.getVcCardNo(), pat.getPhone(), pat.getCardNo(),perType, model);
  289 + }
  290 + }
  291 + }
  292 + }
  293 + }
  294 + if (CollectionUtils.isNotEmpty(lises)) {
  295 + for (LisReportModel lis : lises) {
  296 + CheckResponse check = new CheckResponse();
310 297  
311   - //聊城显示修改
312   - check.setApplyDate(lis.getPublishTime() != null ? lis.getPublishTime() :
313   - lis.getCheckTime());
314   - check.setApplyDateStr(lis.getPublishTime() != null ? DateUtil.getyyyy_MM_dd(lis.getPublishTime()) :
315   - DateUtil.getyyyy_MM_dd(lis.getCheckTime()));
316   - check.setCheckDept(lis.getApplyDept());
317   - check.setDoctor(lis.getApplyDoctor());
318   - check.setSex(lis.getSex());
  298 + check.setLisTypeName(lis.getType());
  299 + check.setModified(lis.getModified());
  300 + check.setType(1); /* 1:检验报告,2:影像报告 */
  301 + check.setName(lis.getName());
  302 + check.setTitle(lis.getTitle());
  303 + check.setHospitalName(hospitalName);
  304 + if (lis.getAge() != null) {
  305 + check.setAge(lis.getAge().toString());
  306 + }
319 307  
  308 + //聊城显示修改
  309 + check.setApplyDate(lis.getPublishTime() != null ? lis.getPublishTime() :
  310 + lis.getCheckTime());
  311 + check.setApplyDateStr(lis.getPublishTime() != null ? DateUtil.getyyyy_MM_dd(lis.getPublishTime()) :
  312 + DateUtil.getyyyy_MM_dd(lis.getCheckTime()));
  313 + check.setCheckDept(lis.getApplyDept());
  314 + check.setDoctor(lis.getApplyDoctor());
  315 + check.setSex(lis.getSex());
320 316  
321   - List<CheckItemResponse> itemList = new ArrayList<>();
322 317  
323   - LisReportItemModel query = new LisReportItemModel();
324   - query.setLisId(lis.getLisId());
325   - query.setHospitalId(lis.getHospitalId());
326   - //查询lis每项详情
327   - List<LisReportItemModel> items = null;
328   - if (StringUtils.isNotEmpty(lis.getItemJson()))
329   - {
330   - items = JsonUtil.toList(lis.getItemJson(),LisReportItemModel.class);
331   - }
  318 + List<CheckItemResponse> itemList = new ArrayList<>();
332 319  
333   - //排序
334   - sortLisReportItems(items);
  320 + LisReportItemModel query = new LisReportItemModel();
  321 + query.setLisId(lis.getLisId());
  322 + query.setHospitalId(lis.getHospitalId());
  323 + //查询lis每项详情
  324 + List<LisReportItemModel> items = null;
  325 + if (StringUtils.isNotEmpty(lis.getItemJson())) {
  326 + items = JsonUtil.toList(lis.getItemJson(), LisReportItemModel.class);
  327 + }
335 328  
336   - if (CollectionUtils.isNotEmpty(items))
337   - {
338   - for (LisReportItemModel checkItem : items)
339   - {
340   - CheckItemResponse item = new CheckItemResponse();
341   - item.setName(checkItem.getName());
342   - item.setCode(checkItem.getCode());
343   - item.setRefer(checkItem.getRef());
344   - if (StringUtils.isNotBlank(checkItem.getNumberResult())) {
345   - item.setResult(checkItem.getNumberResult());
346   - } else if (StringUtils.isNotBlank(checkItem.getCharResult())) {
347   - item.setResult(checkItem.getCharResult());
348   - } else {
349   - item.setResult(checkItem.getResult());
350   - }
351   - item.setUnit(checkItem.getUnit());
352   - item.setSpecial(checkItem.getResultFlag());
353   - item.setPrintOrder(checkItem.getPrintOrder());
354   - itemList.add(item);
355   - }
356   - check.setItemList(itemList);
357   - }
358   - result.add(check);
359   - }
  329 + //排序
  330 + sortLisReportItems(items);
360 331  
  332 + if (CollectionUtils.isNotEmpty(items)) {
  333 + for (LisReportItemModel checkItem : items) {
  334 + CheckItemResponse item = new CheckItemResponse();
  335 + item.setName(checkItem.getName());
  336 + item.setCode(checkItem.getCode());
  337 + item.setRefer(checkItem.getRef());
  338 + if (StringUtils.isNotBlank(checkItem.getNumberResult())) {
  339 + item.setResult(checkItem.getNumberResult());
  340 + } else if (StringUtils.isNotBlank(checkItem.getCharResult())) {
  341 + item.setResult(checkItem.getCharResult());
  342 + } else {
  343 + item.setResult(checkItem.getResult());
361 344 }
  345 + item.setUnit(checkItem.getUnit());
  346 + item.setSpecial(checkItem.getResultFlag());
  347 + item.setPrintOrder(checkItem.getPrintOrder());
  348 + itemList.add(item);
362 349 }
  350 + check.setItemList(itemList);
363 351 }
  352 + result.add(check);
364 353 }
365 354 }
366 355 return result;
367 356  
368 357  
369 358  
370 359  
371 360  
372 361  
373 362  
374 363  
375 364  
376 365  
377 366  
378 367  
379 368  
380 369  
381 370  
382 371  
... ... @@ -368,87 +357,68 @@
368 357  
369 358 /**
370 359 * 历史检验检查的查看页面
  360 + *
371 361 * @param vcCardNo
372 362 * @param phone
373 363 * @param model
374 364 * @return
375 365 */
376   - private List<LisReportModel> queryLisData(String vcCardNo, String phone,String cardNo,LisReportQuery model) {
  366 + private List<LisReportModel> queryLisData(String vcCardNo, String phone, String cardNo,int perType, LisReportQuery model) {
377 367  
378   -
379 368 List<LisReportModel> reportModelList = new ArrayList<>();
380 369 //通过就诊卡号和医院id查询到医院下面的lis记录
381   - if (StringUtils.isNotEmpty(vcCardNo))
382   - {
  370 + if (StringUtils.isNotEmpty(vcCardNo)) {
383 371 //德州
384   - if ("6".equals(HIS_VERSION))
385   - {
  372 + if ("6".equals(HIS_VERSION)) {
386 373 model.setVcCardNos(dzfyHisService.getDzVcCardNos(vcCardNo));
387 374 }
388 375 //承德查询lis
389   - else if ("2100001291".equals(model.getHospitalId()))
390   - {
  376 + else if ("2100001291".equals(model.getHospitalId())) {
391 377 //model.setVcCardNo(vcCardNo);
392 378 model.setVcCardNo(cdfyHisService.getIdByVcCardNo(vcCardNo));
393 379 }
394 380 //威县人民医院lis
395   - else if ("20".equals(HIS_VERSION))
396   - {
  381 + else if ("20".equals(HIS_VERSION)) {
397 382 model.setVcCardNo(wxrmyyHisService.findId(vcCardNo));
398 383 }
399 384 //诸城
400   - else if ("21".equals(HIS_VERSION))
401   - {
  385 + else if ("21".equals(HIS_VERSION)) {
402 386 //model.setVcCardNo(getZcVcardNo(vcCardNo));
403 387 model.setVcCardNos(zcfyHisService.getZcVcCardNos(vcCardNo));
404 388 }
405 389 //威海市妇幼 因为威海市妇幼有些孕妇没有就诊卡直接用身份证,lis把身份证号码存在就诊卡号字段的
406   - else if ("22".equals(HIS_VERSION))
407   - {
  390 + else if ("22".equals(HIS_VERSION)&&perType==1) {
408 391 model.setVcCardNo(cardNo);
409   - }
410   - else
411   - {
  392 + } else {
412 393 model.setVcCardNo(vcCardNo);
413 394 }
414 395  
415 396 List<LisReportModel> lises = lisService.queryLisDataByModel(model);
416   - if (CollectionUtils.isNotEmpty(lises))
417   - {
  397 + if (CollectionUtils.isNotEmpty(lises)) {
418 398 reportModelList.addAll(lises);
419 399 }
420 400 }
421   - if (StringUtils.isNotEmpty(phone))
422   - {
  401 + if (StringUtils.isNotEmpty(phone)) {
423 402 model.setVcCardNo(null);
424 403 model.setPhone(phone);
425 404 List<LisReportModel> lises = lisService.queryLisDataByModel(model);
426   - if (CollectionUtils.isNotEmpty(lises))
427   - {
  405 + if (CollectionUtils.isNotEmpty(lises)) {
428 406 List<LisReportModel> noExists = new ArrayList<>();
429   - for(LisReportModel lis : lises)
430   - {
  407 + for (LisReportModel lis : lises) {
431 408 boolean isExist = false;
432   - if (CollectionUtils.isNotEmpty(reportModelList))
433   - {
434   - for(LisReportModel reportModel : reportModelList)
435   - {
436   - if (lis != null && reportModel != null)
437   - {
438   - if (StringUtils.isNotEmpty(lis.getLisId()) && lis.getLisId().equals(reportModel.getLisId()) && lis.getTitle().equals(reportModel.getTitle()))
439   - {
  409 + if (CollectionUtils.isNotEmpty(reportModelList)) {
  410 + for (LisReportModel reportModel : reportModelList) {
  411 + if (lis != null && reportModel != null) {
  412 + if (StringUtils.isNotEmpty(lis.getLisId()) && lis.getLisId().equals(reportModel.getLisId()) && lis.getTitle().equals(reportModel.getTitle())) {
440 413 isExist = true;
441 414 break;
442 415 }
443 416 }
444 417 }
445   - if (!isExist)
446   - {
  418 + if (!isExist) {
447 419 noExists.add(lis);
448 420 }
449   - }
450   - else
451   - {
  421 + } else {
452 422 noExists.add(lis);
453 423 }
454 424  
455 425  
... ... @@ -462,13 +432,13 @@
462 432  
463 433 /**
464 434 * 诸城就诊卡号处理
  435 + *
465 436 * @param vcCardNo
466 437 * @return
467 438 */
468 439 private String getZcVcardNo(String vcCardNo) {
469   - if (StringUtils.isNotEmpty(vcCardNo) && vcCardNo.length() > 7)
470   - {
471   - String no = "0000"+vcCardNo.substring(0,8);
  440 + if (StringUtils.isNotEmpty(vcCardNo) && vcCardNo.length() > 7) {
  441 + String no = "0000" + vcCardNo.substring(0, 8);
472 442 System.out.println(no);
473 443 return no;
474 444 }
475 445  
476 446  
477 447  
478 448  
... ... @@ -478,28 +448,25 @@
478 448  
479 449 /**
480 450 * lis辅助检查的查询
  451 + *
481 452 * @param vcCardNo
482 453 * @param phone
483 454 * @param model
484 455 * @return
485 456 */
486   - private List<LisReportModel> queryCheckLis(String vcCardNo, String phone,LisReportQuery model) {
  457 + private List<LisReportModel> queryCheckLis(String vcCardNo, String phone, LisReportQuery model) {
487 458  
488 459  
489 460 List<LisReportModel> reportModelList = new ArrayList<>();
490 461 //通过就诊卡号和医院id查询到医院下面的lis记录
491   - if (StringUtils.isNotEmpty(vcCardNo))
492   - {
  462 + if (StringUtils.isNotEmpty(vcCardNo)) {
493 463 model.setVcCardNo(vcCardNo);
494 464 List<LisReportModel> lises = lisService.queryLisDataByModel(model);
495   - if (CollectionUtils.isNotEmpty(lises))
496   - {
  465 + if (CollectionUtils.isNotEmpty(lises)) {
497 466 reportModelList.addAll(lises);
498 467 }
499 468  
500   - }
501   - else if (StringUtils.isNotEmpty(phone))
502   - {
  469 + } else if (StringUtils.isNotEmpty(phone)) {
503 470 model.setVcCardNo(null);
504 471 model.setPhone(phone);
505 472 List<LisReportModel> lises = lisService.queryLisDataByModel(model);
506 473  
507 474  
508 475  
509 476  
510 477  
511 478  
512 479  
513 480  
514 481  
515 482  
516 483  
517 484  
518 485  
... ... @@ -511,68 +478,57 @@
511 478 }
512 479  
513 480  
514   -
515 481 /**
516   - * 返回小程序查询个人的lis报告
517   - * 该接口由app服务器端调用
  482 + * 返回小程序查询个人的lis报告
  483 + * 该接口由app服务器端调用
  484 + *
518 485 * @param patientIds 院内系统孕妇建档id
519 486 * @return
520 487 */
521   - public List<LisReportModel> getAppLisList(String patientIds,Integer status,Integer page,Integer limit) {
  488 + public List<LisReportModel> getAppLisList(String patientIds, Integer status, Integer page, Integer limit) {
522 489  
523 490 List<String> ids = new ArrayList<>();
524   - if (StringUtils.isNotEmpty(patientIds))
525   - {
  491 + if (StringUtils.isNotEmpty(patientIds)) {
526 492 CollectionUtils.addAll(ids, patientIds.split(","));
527 493 }
528 494  
529   - PatientsQuery patientsQuery=new PatientsQuery();
  495 + PatientsQuery patientsQuery = new PatientsQuery();
530 496 patientsQuery.setIds(ids);
531 497 patientsQuery.setYn(YnEnums.YES.getId());
532   - List<Patients> list= patientsService.queryPatient(patientsQuery);
  498 + List<Patients> list = patientsService.queryPatient(patientsQuery);
533 499 List<LisReportModel> lises = null;
534   - if (CollectionUtils.isNotEmpty(list))
535   - {
  500 + if (CollectionUtils.isNotEmpty(list)) {
536 501 List<String> vcCardNos = new ArrayList<>();
537 502 List<String> hosptalIds = new ArrayList<>();
538 503 List<String> phones = new ArrayList<>();
539 504  
540   - for(Patients pat : list)
541   - {
542   - if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId()))
543   - {
544   - if (StringUtils.isNotEmpty(pat.getVcCardNo()))
545   - {
  505 + for (Patients pat : list) {
  506 + if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId())) {
  507 + if (StringUtils.isNotEmpty(pat.getVcCardNo())) {
546 508 //德州市妇幼保健院 解决德州妇幼孕妇换卡的问题
547   - if ("6".equals(HIS_VERSION) && "1000000114".equals(pat.getHospitalId()))
548   - {
  509 + if ("6".equals(HIS_VERSION) && "1000000114".equals(pat.getHospitalId())) {
549 510 vcCardNos.addAll(dzfyHisService.getDzVcCardNos(pat.getVcCardNo()));
550 511 }
551 512 //承德查询lis
552   - else if ("2100001291".equals(pat.getHospitalId()))
553   - {
  513 + else if ("2100001291".equals(pat.getHospitalId())) {
554 514 // vcCardNos.add(pat.getVcCardNo());
555 515 vcCardNos.add(cdfyHisService.getIdByVcCardNo(pat.getVcCardNo()));
556 516 }
557 517 //威海市妇幼 因为威海市妇幼有些孕妇没有就诊卡直接用身份证,lis把身份证号码存在就诊卡号字段的
558   - else if ("22".equals(HIS_VERSION))
559   - {
  518 + else if ("22".equals(HIS_VERSION)) {
560 519 vcCardNos.add(pat.getCardNo());
561   - }
562   - else
563   - {
  520 + } else {
564 521 vcCardNos.add(pat.getVcCardNo());
565 522 }
566 523  
567 524 }
568   - if (StringUtils.isNotEmpty(pat.getPhone()))
569   - {
  525 + if (StringUtils.isNotEmpty(pat.getPhone())) {
570 526 phones.add(pat.getPhone());
571 527 }
572 528 hosptalIds.add(pat.getHospitalId());
573 529 }
574 530 }
575   - LisReportQuery query = new LisReportQuery();
  531 + LisReportQuery query = new LisReportQuery();
576 532 query.setPage(page);
577 533 query.setLimit(limit);
578 534 query.setNeed("true");
579 535  
580 536  
581 537  
... ... @@ -583,20 +539,17 @@
583 539 query.setStatus(status);
584 540 query.setHospitalIds(hosptalIds);
585 541  
586   - Map<String,String> hospitalNames = getHospitalNames(hosptalIds);
  542 + Map<String, String> hospitalNames = getHospitalNames(hosptalIds);
587 543 lises = lisService.queryLisDataByQuery(query);
588 544 System.out.println("patientIds==" + patientIds + "; lies size = " + lises.size());
589 545  
590   - if (CollectionUtils.isNotEmpty(lises))
591   - {
592   - for(LisReportModel lisReportModel : lises)
593   - {
  546 + if (CollectionUtils.isNotEmpty(lises)) {
  547 + for (LisReportModel lisReportModel : lises) {
594 548 lisReportModel.setHospitalName(hospitalNames.get(lisReportModel.getHospitalId()));
595 549 String json = lisReportModel.getItemJson();
596   - if (StringUtils.isNotEmpty(json))
597   - {
  550 + if (StringUtils.isNotEmpty(json)) {
598 551 List<LisReportItemModel> items = JsonUtil.toList(json, LisReportItemModel.class);
599   - lisReportModel.setItems(items.size() > 3 ? items.subList(0, 4) : items.subList(0,items.size()));
  552 + lisReportModel.setItems(items.size() > 3 ? items.subList(0, 4) : items.subList(0, items.size()));
600 553 lisReportModel.setItemJson(null);
601 554 }
602 555 }
603 556  
604 557  
... ... @@ -607,24 +560,21 @@
607 560  
608 561 /**
609 562 * 更新状态为已推送
  563 + *
610 564 * @param ids
611 565 * @return
612 566 */
613 567 public BaseResponse updateAppLisStatus(String ids) {
614 568 try {
615   - if (StringUtils.isNotEmpty(ids))
616   - {
617   - String[] arrs = ids.split(",");
618   - if (arrs != null && arrs.length > 0)
619   - {
  569 + if (StringUtils.isNotEmpty(ids)) {
  570 + String[] arrs = ids.split(",");
  571 + if (arrs != null && arrs.length > 0) {
620 572 List<String> list = new ArrayList<>();
621 573 CollectionUtils.addAll(list, arrs);
622 574 lisService.updateAppLisStatus(list);
623 575 }
624 576 }
625   - }
626   - catch (Exception e)
627   - {
  577 + } catch (Exception e) {
628 578 return new BaseResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
629 579 }
630 580 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
631 581  
632 582  
633 583  
634 584  
635 585  
... ... @@ -632,29 +582,25 @@
632 582  
633 583 /**
634 584 * 通过id查询到lis检查报告详情
  585 + *
635 586 * @param id
636 587 * @return
637 588 */
638   - public List<LisReportModel> getAppLisById(Integer id) {
  589 + public List<LisReportModel> getAppLisById(Integer id) {
639 590  
640   - LisReportQuery query = new LisReportQuery();
  591 + LisReportQuery query = new LisReportQuery();
641 592 query.setId(id);
642 593  
643 594 List<LisReportModel> lises = lisService.queryLisDataByQuery(query);
644   - if (CollectionUtils.isNotEmpty(lises))
645   - {
646   - for(LisReportModel lisReportModel : lises)
647   - {
  595 + if (CollectionUtils.isNotEmpty(lises)) {
  596 + for (LisReportModel lisReportModel : lises) {
648 597 Organization organization = null;
649   - if (StringUtils.isNotEmpty(lisReportModel.getHospitalId()))
650   - {
  598 + if (StringUtils.isNotEmpty(lisReportModel.getHospitalId())) {
651 599 organization = organizationService.getOrganization(Integer.parseInt(lisReportModel.getHospitalId()));
652 600 }
653 601 String json = lisReportModel.getItemJson();
654   - if (StringUtils.isNotEmpty(json))
655   - {
656   - if (organization != null)
657   - {
  602 + if (StringUtils.isNotEmpty(json)) {
  603 + if (organization != null) {
658 604 lisReportModel.setHospitalName(organization.getName());
659 605 }
660 606 List<LisReportItemModel> items = JsonUtil.toList(json, LisReportItemModel.class);
661 607  
... ... @@ -670,12 +616,11 @@
670 616  
671 617 /**
672 618 * 排序
  619 + *
673 620 * @param items
674 621 */
675   - private void sortLisReportItems(List<LisReportItemModel> items)
676   - {
677   - if (CollectionUtils.isNotEmpty(items))
678   - {
  622 + private void sortLisReportItems(List<LisReportItemModel> items) {
  623 + if (CollectionUtils.isNotEmpty(items)) {
679 624 Collections.sort(items, new Comparator() {
680 625 public int compare(Object a, Object b) {
681 626 String orderA = ((LisReportItemModel) a).getPrintOrder();
... ... @@ -688,8 +633,7 @@
688 633 return -1;
689 634 }
690 635 if (com.lyms.platform.common.utils.StringUtils.isNum(orderA) &&
691   - com.lyms.platform.common.utils.StringUtils.isNum(orderB))
692   - {
  636 + com.lyms.platform.common.utils.StringUtils.isNum(orderB)) {
693 637 int sortNum1 = Integer.parseInt(orderA);
694 638 int sortNum2 = Integer.parseInt(orderB);
695 639 return sortNum1 - sortNum2;
696 640  
697 641  
... ... @@ -705,17 +649,15 @@
705 649  
706 650 /**
707 651 * 查询医院名称
  652 + *
708 653 * @param hospitalIds
709 654 * @return
710 655 */
711   - private Map<String,String> getHospitalNames(List<String> hospitalIds)
712   - {
713   - Map<String,String> hospitalNames = new HashMap<>();
  656 + private Map<String, String> getHospitalNames(List<String> hospitalIds) {
  657 + Map<String, String> hospitalNames = new HashMap<>();
714 658 List<Integer> ids = new ArrayList<>();
715   - if (CollectionUtils.isNotEmpty(hospitalIds))
716   - {
717   - for(String hId : hospitalIds)
718   - {
  659 + if (CollectionUtils.isNotEmpty(hospitalIds)) {
  660 + for (String hId : hospitalIds) {
719 661 ids.add(Integer.parseInt(hId));
720 662 }
721 663 }
722 664  
723 665  
... ... @@ -724,18 +666,17 @@
724 666 query.setIdList(ids);
725 667  
726 668 List<Organization> organizations = organizationService.queryHospitals(query);
727   - if (CollectionUtils.isNotEmpty(organizations))
728   - {
729   - for (Organization organization : organizations){
730   - hospitalNames.put(organization.getId()+"",organization.getName());
  669 + if (CollectionUtils.isNotEmpty(organizations)) {
  670 + for (Organization organization : organizations) {
  671 + hospitalNames.put(organization.getId() + "", organization.getName());
731 672 }
732 673 }
733 674 return hospitalNames;
734 675 }
735 676  
736   - public Map<String,Object> getNoSendLis(Integer page, Integer limit) {
  677 + public Map<String, Object> getNoSendLis(Integer page, Integer limit) {
737 678  
738   - LisReportQuery query = new LisReportQuery();
  679 + LisReportQuery query = new LisReportQuery();
739 680 query.setPublishTime(DateUtil.getyyyy_MM_dd(new Date()));
740 681 query.setPage(page);
741 682 query.setLimit(limit);
742 683  
743 684  
... ... @@ -743,21 +684,19 @@
743 684 query.setSort(" APPLY_TIME DESC ");
744 685 query.setStatus(0); //未推送状态
745 686  
746   - Map<String,Object> result = new HashMap<>();
747   - List<Map<String,String>> lists = new ArrayList<>();
  687 + Map<String, Object> result = new HashMap<>();
  688 + List<Map<String, String>> lists = new ArrayList<>();
748 689  
749   - List<LisReportModel> lises = lisService.queryLisDataByStatus(query);
750   - if (CollectionUtils.isNotEmpty(lises))
751   - {
  690 + List<LisReportModel> lises = lisService.queryLisDataByStatus(query);
  691 + if (CollectionUtils.isNotEmpty(lises)) {
752 692 Map<String, String> map = new HashMap<>();
753 693 OrganizationQuery organizationQuery = new OrganizationQuery();
754 694 organizationQuery.setYn(YnEnums.YES.getId());
755 695 List<Organization> organizations = organizationService.queryOrganization(organizationQuery);
756 696 if (organizations != null) {
757   - for(Organization organization : organizations)
758   - {
759   - map.put(organization.getId() + "", organization.getName());
760   - }
  697 + for (Organization organization : organizations) {
  698 + map.put(organization.getId() + "", organization.getName());
  699 + }
761 700 }
762 701 organizations.clear();
763 702  
764 703  
765 704  
... ... @@ -771,17 +710,15 @@
771 710 end = lises.size();
772 711 }
773 712 final List<LisReportModel> models = lises.subList(i, end);
774   - Callable c = new LisHandleTask(patientsService,models,map,dzfyHisService,cdfyHisService);
  713 + Callable c = new LisHandleTask(patientsService, models, map, dzfyHisService, cdfyHisService);
775 714 Future f = commonThreadPool.submit(c);
776 715 futures.add(f);
777 716 }
778 717  
779   - if (CollectionUtils.isNotEmpty(futures))
780   - {
781   - for (Future f : futures)
782   - {
  718 + if (CollectionUtils.isNotEmpty(futures)) {
  719 + for (Future f : futures) {
783 720 try {
784   - lists.addAll((List<Map<String,String>>) f.get());
  721 + lists.addAll((List<Map<String, String>>) f.get());
785 722 } catch (Exception e) {
786 723 ExceptionUtils.catchException(e, "getNoSendLis list error.");
787 724 }
788 725  
789 726  
790 727  
791 728  
792 729  
793 730  
... ... @@ -790,32 +727,30 @@
790 727 }
791 728  
792 729 result.put("list", lists);
793   - result.put("hasNext",CollectionUtils.isNotEmpty(lises) && lises.size() >= limit ? "true" : "false");
  730 + result.put("hasNext", CollectionUtils.isNotEmpty(lises) && lises.size() >= limit ? "true" : "false");
794 731  
795 732 return result;
796 733 }
797 734  
798   - public BaseResponse getBabyLisAssistCheckInfo(String vcCardNo, String phone, String checkTime,Integer userId) {
  735 + public BaseResponse getBabyLisAssistCheckInfo(String vcCardNo, String phone, String checkTime, Integer userId) {
799 736  
800 737 //根据用户id获取医院ID
801 738 String hospitalId = autoMatchFacade.getHospitalId(userId);
802   - LisReportQuery query = new LisReportQuery();
  739 + LisReportQuery query = new LisReportQuery();
803 740 List<String> titles = new ArrayList<>();
804   - Map<String,Map<String,String>> map = new HashMap<>();
  741 + Map<String, Map<String, String>> map = new HashMap<>();
805 742  
806   - boolean isQuery = false;
  743 + boolean isQuery = false;
807 744  
808 745 //秦皇岛
809   - if ("216".equals(hospitalId))
810   - {
  746 + if ("216".equals(hospitalId)) {
811 747 titles.add("尿常规");
812 748 titles.add("[丙]血常规(24项)");
813 749 titles.add("血常规(24项)");
814 750 isQuery = true;
815 751 }
816 752 //青龙满族自治县医院
817   - else if ("204".equals(hospitalId))
818   - {
  753 + else if ("204".equals(hospitalId)) {
819 754 titles.add("尿常规30");
820 755 titles.add("尿常规检查");
821 756  
... ... @@ -827,8 +762,7 @@
827 762 //德州市妇幼保健院
828 763  
829 764 //如果不为上面的医院就直接返回
830   - if (!isQuery || "2".equals(run_mode))
831   - {
  765 + if (!isQuery || "2".equals(run_mode)) {
832 766 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(map);
833 767 }
834 768  
835 769  
836 770  
837 771  
838 772  
839 773  
840 774  
841 775  
842 776  
843 777  
844 778  
845 779  
846 780  
847 781  
848 782  
849 783  
850 784  
851 785  
852 786  
853 787  
854 788  
... ... @@ -836,162 +770,112 @@
836 770 query.setHospitalId(hospitalId);
837 771 query.setCheckTime(checkTime);
838 772 List<LisReportModel> lises = null;
839   - if ("216".equals(hospitalId))
840   - {
841   - lises = qhdfyHisService.queryQhdCheckLisInfo(vcCardNo,phone,"('尿常规','[丙]血常规(24项)','血常规(24项)','血细胞分析(末梢)')", checkTime);
  773 + if ("216".equals(hospitalId)) {
  774 + lises = qhdfyHisService.queryQhdCheckLisInfo(vcCardNo, phone, "('尿常规','[丙]血常规(24项)','血常规(24项)','血细胞分析(末梢)')", checkTime);
  775 + } else {
  776 + lises = queryCheckLis(vcCardNo, phone, query);
842 777 }
843   - else
844   - {
845   - lises = queryCheckLis(vcCardNo,phone,query);
846   - }
847 778  
848   - if (CollectionUtils.isNotEmpty(lises))
849   - {
850   - for(LisReportModel model : lises)
851   - {
852   - if ("216".equals(hospitalId))
853   - {
854   - if ("尿常规".equals(model.getTitle()))
855   - {
856   - Map<String,String> map1 = new HashMap<>();
857   - map1.put("ndb",""); //尿蛋白
858   - map1.put("nt",""); //尿糖
859   - map1.put("ntt",""); //尿酮体
860   - map1.put("nqx",""); //尿潜血
  779 + if (CollectionUtils.isNotEmpty(lises)) {
  780 + for (LisReportModel model : lises) {
  781 + if ("216".equals(hospitalId)) {
  782 + if ("尿常规".equals(model.getTitle())) {
  783 + Map<String, String> map1 = new HashMap<>();
  784 + map1.put("ndb", ""); //尿蛋白
  785 + map1.put("nt", ""); //尿糖
  786 + map1.put("ntt", ""); //尿酮体
  787 + map1.put("nqx", ""); //尿潜血
861 788 String itemJson = model.getItemJson();
862   - List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class);
863   - if (CollectionUtils.isNotEmpty(items))
864   - {
865   - for(LisReportItemModel item : items)
866   - {
867   - if (item == null)
868   - {
  789 + List<LisReportItemModel> items = JsonUtil.toList(itemJson, LisReportItemModel.class);
  790 + if (CollectionUtils.isNotEmpty(items)) {
  791 + for (LisReportItemModel item : items) {
  792 + if (item == null) {
869 793 continue;
870 794 }
871   - if ("尿蛋白".equals(item.getName()))
872   - {
873   - map1.put("ndb",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  795 + if ("尿蛋白".equals(item.getName())) {
  796 + map1.put("ndb", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  797 + } else if ("尿糖".equals(item.getName()) || "尿葡萄糖".equals(item.getName())) {
  798 + map1.put("nt", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  799 + } else if ("尿酮体".equals(item.getName())) {
  800 + map1.put("ntt", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  801 + } else if ("尿潜血".equals(item.getName()) || "尿隐血".equals(item.getName())) {
  802 + map1.put("nqx", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
874 803 }
875   - else if ("尿糖".equals(item.getName()) || "尿葡萄糖".equals(item.getName()))
876   - {
877   - map1.put("nt",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
878   - }
879   - else if ("尿酮体".equals(item.getName()))
880   - {
881   - map1.put("ntt",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
882   - }
883   - else if ("尿潜血".equals(item.getName()) || "尿隐血".equals(item.getName()))
884   - {
885   - map1.put("nqx",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
886   - }
887 804 }
888 805 }
889   - map.put("ncg",map1);
890   - }
891   - else if ("[丙]血常规(24项)".equals(model.getTitle()) || "血常规(24项)".equals(model.getTitle()))
892   - {
893   - Map<String,String> map1 = new HashMap<>();
894   - map1.put("xhdb",""); //血红蛋白
895   - map1.put("bxbjs","");//白细胞计数
896   - map1.put("xxbjs",""); //血小板计数
  806 + map.put("ncg", map1);
  807 + } else if ("[丙]血常规(24项)".equals(model.getTitle()) || "血常规(24项)".equals(model.getTitle())) {
  808 + Map<String, String> map1 = new HashMap<>();
  809 + map1.put("xhdb", ""); //血红蛋白
  810 + map1.put("bxbjs", "");//白细胞计数
  811 + map1.put("xxbjs", ""); //血小板计数
897 812 String itemJson = model.getItemJson();
898 813 List<LisReportItemModel> items = JsonUtil.toList(itemJson, LisReportItemModel.class);
899   - if (CollectionUtils.isNotEmpty(items))
900   - {
901   - for(LisReportItemModel item : items)
902   - {
903   - if (item == null)
904   - {
  814 + if (CollectionUtils.isNotEmpty(items)) {
  815 + for (LisReportItemModel item : items) {
  816 + if (item == null) {
905 817 continue;
906 818 }
907   - if ("血红蛋白".equals(item.getName()))
908   - {
909   - map1.put("xhdb",item.getNumberResult());
  819 + if ("血红蛋白".equals(item.getName())) {
  820 + map1.put("xhdb", item.getNumberResult());
  821 + } else if ("白细胞计数".equals(item.getName())) {
  822 + map1.put("bxbjs", item.getNumberResult());
  823 + } else if ("血小板计数".equals(item.getName()) || "血小板".equals(item.getName())) {
  824 + map1.put("xxbjs", item.getNumberResult());
910 825 }
911   - else if ("白细胞计数".equals(item.getName()))
912   - {
913   - map1.put("bxbjs",item.getNumberResult());
914   - }
915   - else if ("血小板计数".equals(item.getName()) || "血小板".equals(item.getName()))
916   - {
917   - map1.put("xxbjs",item.getNumberResult());
918   - }
919 826 }
920 827 }
921   - map.put("xcg",map1);
  828 + map.put("xcg", map1);
922 829 }
923   - }
924   - else if ("204".equals(hospitalId))
925   - {
926   - if ("尿常规30".equals(model.getTitle()) || "尿常规检查".equals(model.getTitle()))
927   - {
928   - Map<String,String> map1 = new HashMap<>();
929   - map1.put("ndb",""); //尿蛋白
930   - map1.put("nt",""); //尿糖
931   - map1.put("ntt",""); //尿酮体
932   - map1.put("nqx",""); //尿潜血
  830 + } else if ("204".equals(hospitalId)) {
  831 + if ("尿常规30".equals(model.getTitle()) || "尿常规检查".equals(model.getTitle())) {
  832 + Map<String, String> map1 = new HashMap<>();
  833 + map1.put("ndb", ""); //尿蛋白
  834 + map1.put("nt", ""); //尿糖
  835 + map1.put("ntt", ""); //尿酮体
  836 + map1.put("nqx", ""); //尿潜血
933 837 String itemJson = model.getItemJson();
934   - List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class);
935   - if (CollectionUtils.isNotEmpty(items))
936   - {
937   - for(LisReportItemModel item : items)
938   - {
939   - if (item == null)
940   - {
  838 + List<LisReportItemModel> items = JsonUtil.toList(itemJson, LisReportItemModel.class);
  839 + if (CollectionUtils.isNotEmpty(items)) {
  840 + for (LisReportItemModel item : items) {
  841 + if (item == null) {
941 842 continue;
942 843 }
943   - if ("尿蛋白".equals(item.getName()))
944   - {
945   - map1.put("ndb",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  844 + if ("尿蛋白".equals(item.getName())) {
  845 + map1.put("ndb", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  846 + } else if ("葡萄糖".equals(item.getName())) {
  847 + map1.put("nt", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  848 + } else if ("酮体".equals(item.getName())) {
  849 + map1.put("ntt", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
  850 + } else if ("隐血".equals(item.getName())) {
  851 + map1.put("nqx", item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
946 852 }
947   - else if ("葡萄糖".equals(item.getName()))
948   - {
949   - map1.put("nt",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
950   - }
951   - else if ("酮体".equals(item.getName()))
952   - {
953   - map1.put("ntt",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
954   - }
955   - else if ("隐血".equals(item.getName()))
956   - {
957   - map1.put("nqx",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
958   - }
959 853 }
960 854 }
961   - map.put("ncg",map1);
962   - }
963   - else if ("血常规、血型".equals(model.getTitle()) || "血常规5分类".equals(model.getTitle()) || "小儿血常规5分类".equals(model.getTitle()))
964   - {
  855 + map.put("ncg", map1);
  856 + } else if ("血常规、血型".equals(model.getTitle()) || "血常规5分类".equals(model.getTitle()) || "小儿血常规5分类".equals(model.getTitle())) {
965 857  
966   - Map<String,String> map1 = new HashMap<>();
967   - map1.put("xhdb",""); //血红蛋白
968   - map1.put("bxbjs","");//白细胞计数
969   - map1.put("xxbjs",""); //血小板计数
  858 + Map<String, String> map1 = new HashMap<>();
  859 + map1.put("xhdb", ""); //血红蛋白
  860 + map1.put("bxbjs", "");//白细胞计数
  861 + map1.put("xxbjs", ""); //血小板计数
970 862 String itemJson = model.getItemJson();
971   - List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class);
972   - if (CollectionUtils.isNotEmpty(items))
973   - {
974   - for(LisReportItemModel item : items)
975   - {
976   - if (item == null)
977   - {
  863 + List<LisReportItemModel> items = JsonUtil.toList(itemJson, LisReportItemModel.class);
  864 + if (CollectionUtils.isNotEmpty(items)) {
  865 + for (LisReportItemModel item : items) {
  866 + if (item == null) {
978 867 continue;
979 868 }
980   - if ("血红蛋白".equals(item.getName()))
981   - {
982   - map1.put("xhdb",item.getNumberResult());
  869 + if ("血红蛋白".equals(item.getName())) {
  870 + map1.put("xhdb", item.getNumberResult());
  871 + } else if ("白细胞".equals(item.getName())) {
  872 + map1.put("bxbjs", item.getNumberResult());
  873 + } else if ("血小板计数".equals(item.getName()) || "血小板".equals(item.getName())) {
  874 + map1.put("xxbjs", item.getNumberResult());
983 875 }
984   - else if ("白细胞".equals(item.getName()))
985   - {
986   - map1.put("bxbjs",item.getNumberResult());
987   - }
988   - else if ("血小板计数".equals(item.getName()) || "血小板".equals(item.getName()))
989   - {
990   - map1.put("xxbjs",item.getNumberResult());
991   - }
992 876 }
993 877 }
994   - map.put("xcg",map1);
  878 + map.put("xcg", map1);
995 879 }
996 880 }
997 881