From 91764300275817c220cdbf45b11903987f41636a Mon Sep 17 00:00:00 2001 From: liquanyu Date: Wed, 24 May 2017 17:04:51 +0800 Subject: [PATCH] update --- .../main/resources/mainOrm/master/MasterLis.xml | 59 +-------- .../platform/operate/web/facade/LisFacade.java | 140 +++++++++++---------- 2 files changed, 77 insertions(+), 122 deletions(-) diff --git a/platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml b/platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml index 73de3b0..41ff468 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml @@ -2,7 +2,7 @@ - + INSERT INTO LIS_REPORT_TBL( LIS_ID, TITLE, @@ -83,7 +83,7 @@ DELETE FROM LIS_REPORT_TBL WHERE LIS_ID = #{lisId} AND HOSPITAL_ID = #{hospitalId} - diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java index 22ff82a..1782b11 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java @@ -312,13 +312,10 @@ public class LisFacade { hIdNames.put(hospitals.get(0).getId()+"",hospitalName); } } - LisReportQuery model = new LisReportQuery(); - model.setVcCardNo(pat.getVcCardNo()); - model.setHospitalId(pat.getHospitalId()); - model.setPhone(pat.getPhone()); + model.setHospitalId(hospitalId); //通过就诊卡号和医院id查询到医院下面的lis记录 - List lises = lisService.queryLisDataByModel(model); + List lises = queryLisData(pat.getVcCardNo(), pat.getPhone(), model); if (CollectionUtils.isNotEmpty(lises)) { for (LisReportModel lis : lises) @@ -384,6 +381,59 @@ public class LisFacade { return result; } + private List queryLisData(String vcCardNo, String phone,LisReportQuery model) { + + + List reportModelList = new ArrayList<>(); + //通过就诊卡号和医院id查询到医院下面的lis记录 + if (StringUtils.isNotEmpty(vcCardNo)) + { + model.setVcCardNo(vcCardNo); + List lises = lisService.queryLisDataByModel(model); + reportModelList.addAll(lises); + } + if (StringUtils.isNotEmpty(phone)) + { + model.setVcCardNo(null); + model.setPhone(phone); + List lises = lisService.queryLisDataByModel(model); + if (CollectionUtils.isNotEmpty(lises)) + { + List noExists = new ArrayList<>(); + for(LisReportModel lis : lises) + { + boolean isExist = false; + if (CollectionUtils.isNotEmpty(reportModelList)) + { + for(LisReportModel reportModel : reportModelList) + { + if (lis != null && reportModel != null) + { + if (StringUtils.isNotEmpty(lis.getLisId()) && lis.getLisId().equals(reportModel.getLisId())) + { + isExist = true; + break; + } + } + } + if (isExist) + { + noExists.add(lis); + } + } + else + { + noExists.add(lis); + } + + } + reportModelList.addAll(noExists); + } + } + return reportModelList; + + } + /** * 返回小程序查询个人的lis报告 * 该接口由app服务器端调用 @@ -395,7 +445,7 @@ public class LisFacade { List ids = new ArrayList<>(); if (StringUtils.isNotEmpty(patientIds)) { - CollectionUtils.addAll(ids,patientIds.split(",")); + CollectionUtils.addAll(ids, patientIds.split(",")); } PatientsQuery patientsQuery=new PatientsQuery(); @@ -453,11 +503,6 @@ public class LisFacade { } } } -// BaseObjectResponse objectResponse = new BaseObjectResponse(); -// objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); -// objectResponse.setData(lises); -// objectResponse.setErrormsg("成功"); -// return objectResponse; return lises; } @@ -519,11 +564,6 @@ public class LisFacade { } } } -// BaseObjectResponse objectResponse = new BaseObjectResponse(); -// objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); -// objectResponse.setData(lises); -// objectResponse.setErrormsg("成功"); -// return objectResponse; return lises; } @@ -611,44 +651,6 @@ public class LisFacade { } } } - -// for(LisReportModel lisReportModel : lises) -// { -// Map map = new HashMap<>(); -// if (StringUtils.isNotEmpty(lisReportModel.getHospitalId())) -// { -// Organization organization = organizationService.getOrganization(Integer.parseInt(lisReportModel.getHospitalId())); -// if (organization != null) -// { -// map.put("hospitalName",organization.getName()); -// } -// } -// -// PatientsQuery patientsQuery=new PatientsQuery(); -// String[] strs = new String[]{lisReportModel.getPhone(), lisReportModel.getVcCardNo()}; -// patientsQuery.setPv(strs); -// patientsQuery.setYn(YnEnums.YES.getId()); -// List list= patientsService.queryPatient(patientsQuery); -// if (CollectionUtils.isNotEmpty(list)) -// { -// Patients pat = list.get(0); -// String patientId = pat.getId(); -// if (!patientIds.contains(patientId)) -// { -// patientIds.add(patientId); -// map.put("vcCardNo", pat.getVcCardNo()); -// map.put("name",pat.getUsername()); -// map.put("phone",pat.getPhone()); -// map.put("checkTime",lisReportModel.getCheckTime() == null ? DateUtil.getyyyy_MM_dd_hms(lisReportModel.getPublishTime()) -// : DateUtil.getyyyy_MM_dd_hms(lisReportModel.getCheckTime())); -// map.put("patientId",patientId); -// map.put("hospitalId",lisReportModel.getHospitalId()); -// map.put("title",lisReportModel.getTitle()); -// map.put("id",lisReportModel.getId()+""); -// lists.add(map); -// } -// } -// } } patientIds.clear(); @@ -665,12 +667,9 @@ public class LisFacade { titles.add("[丙]血常规(24项)"); titles.add("血常规(24项)"); query.setTitles(titles); - query.setPhone(phone); - query.setPhone(phone); - query.setVcCardNo(vcCardNo); query.setHospitalId(hospitalId); query.setCheckTime(DateUtil.parseYMD(checkTime)); - List lises = lisService.queryLisDataByModel(query); + List lises = queryLisData(vcCardNo,phone,query); Map> map = new HashMap<>(); if (CollectionUtils.isNotEmpty(lises)) { @@ -679,6 +678,10 @@ public class LisFacade { if ("尿常规".equals(model.getTitle())) { Map map1 = new HashMap<>(); + map1.put("ndb",""); //尿蛋白 + map1.put("nt",""); //尿糖 + map1.put("ntt",""); //尿酮体 + map1.put("nqx",""); //尿潜血 String itemJson = model.getItemJson(); List items = JsonUtil.toList(itemJson,LisReportItemModel.class); if (CollectionUtils.isNotEmpty(items)) @@ -689,26 +692,29 @@ public class LisFacade { { map1.put("ndb",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult()); } - else if ("尿糖".equals(item.getName())) + else if ("尿糖".equals(item.getName()) || "尿葡萄糖".equals(item.getName())) { - map1.put("tn",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult()); + map1.put("nt",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult()); } else if ("尿酮体".equals(item.getName())) { map1.put("ntt",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult()); } - else if ("尿潜血".equals(item.getName())) + else if ("尿潜血".equals(item.getName()) || "尿隐血".equals(item.getName())) { - map1.put("ntx",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult()); + map1.put("nqx",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult()); } } } map.put("ncg",map1); } - else if ("[丙]血常规(24项)".equals(model.getTitle()) || "血常规(24项".equals(model.getTitle())) + else if ("[丙]血常规(24项)".equals(model.getTitle()) || "血常规(24项)".equals(model.getTitle())) { Map map1 = new HashMap<>(); + map1.put("xhdb",""); //血红蛋白 + map1.put("bxbjs","");//白细胞计数 + map1.put("xxbjs",""); //血小板计数 String itemJson = model.getItemJson(); List items = JsonUtil.toList(itemJson,LisReportItemModel.class); if (CollectionUtils.isNotEmpty(items)) @@ -717,15 +723,15 @@ public class LisFacade { { if ("血红蛋白".equals(item.getName())) { - map1.put("xhdb",item.getResult()); + map1.put("xhdb",item.getNumberResult()); } else if ("白细胞计数".equals(item.getName())) { - map1.put("xxbjs",item.getResult()); + map1.put("bxbjs",item.getNumberResult()); } - else if ("血小板计数".equals(item.getName())) + else if ("血小板计数".equals(item.getName()) || "血小板".equals(item.getName())) { - map1.put("xxbjs",item.getResult()); + map1.put("xxbjs",item.getNumberResult()); } } } -- 1.8.3.1