Commit 5c69e8ccc4911d0915dea4bf27d4e1a0f14ee86c
1 parent
84cf2a5c02
Exists in
master
and in
6 other branches
update
Showing 4 changed files with 97 additions and 26 deletions
- platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
View file @
5c69e8c
| ... | ... | @@ -108,14 +108,9 @@ |
| 108 | 108 | <if test="lisId != null and lisId != ''"> |
| 109 | 109 | AND LIS_ID = #{lisId} |
| 110 | 110 | </if> |
| 111 | - <if test="vcCardNo != null and vcCardNo != ''"> | |
| 112 | - AND VCCARDNO = #{vcCardNo} | |
| 111 | + <if test="vcCardNo != null OR phone != null"> | |
| 112 | + AND (VCCARDNO = #{vcCardNo} OR PHONE = #{phone}) | |
| 113 | 113 | </if> |
| 114 | - | |
| 115 | - <if test="phone != null and phone != ''"> | |
| 116 | - AND PHONE = #{phone} | |
| 117 | - </if> | |
| 118 | - | |
| 119 | 114 | <if test="hospitalId != null and hospitalId != ''"> |
| 120 | 115 | AND HOSPITAL_ID = #{hospitalId} |
| 121 | 116 | </if> |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
5c69e8c
| ... | ... | @@ -212,7 +212,16 @@ |
| 212 | 212 | |
| 213 | 213 | private String phoneOrCert; |
| 214 | 214 | private String[] pc; |
| 215 | + private String[] pv; | |
| 215 | 216 | |
| 217 | + public String[] getPv() { | |
| 218 | + return pv; | |
| 219 | + } | |
| 220 | + | |
| 221 | + public void setPv(String[] pv) { | |
| 222 | + this.pv = pv; | |
| 223 | + } | |
| 224 | + | |
| 216 | 225 | public String[] getPc() { |
| 217 | 226 | return pc; |
| 218 | 227 | } |
| ... | ... | @@ -1032,6 +1041,17 @@ |
| 1032 | 1041 | MongoCondition c = MongoCondition.newInstance(); |
| 1033 | 1042 | MongoCondition con1 = MongoCondition.newInstance("phone", pc[0], MongoOper.IS); |
| 1034 | 1043 | MongoCondition con2 = MongoCondition.newInstance("cardNo", pc[1], MongoOper.IS); |
| 1044 | + if(c1!=null) { | |
| 1045 | + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
| 1046 | + }else { | |
| 1047 | + c1 = c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
| 1048 | + } | |
| 1049 | + } | |
| 1050 | + | |
| 1051 | + if (null != pv) { | |
| 1052 | + MongoCondition c = MongoCondition.newInstance(); | |
| 1053 | + MongoCondition con1 = MongoCondition.newInstance("phone", pc[0], MongoOper.IS); | |
| 1054 | + MongoCondition con2 = MongoCondition.newInstance("vcCardNo", pc[1], MongoOper.IS); | |
| 1035 | 1055 | if(c1!=null) { |
| 1036 | 1056 | c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); |
| 1037 | 1057 | }else { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
View file @
5c69e8c
| ... | ... | @@ -108,11 +108,12 @@ |
| 108 | 108 | @RequestMapping(method = RequestMethod.GET, value = "/getLisAndRisData") |
| 109 | 109 | @ResponseBody |
| 110 | 110 | @TokenRequired |
| 111 | - public BaseResponse getLisAndRisData(@RequestParam("vcCardNo") String vcCardNo, | |
| 111 | + public BaseResponse getLisAndRisData(@RequestParam(required = false) String vcCardNo, | |
| 112 | 112 | @RequestParam("sortType") Integer sortType, |
| 113 | + @RequestParam(required = false) String phone, | |
| 113 | 114 | HttpServletRequest request) { |
| 114 | 115 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 115 | - return lisFacade.getLisAndRisData(vcCardNo, sortType, loginState.getId()); | |
| 116 | + return lisFacade.getLisAndRisData(vcCardNo,phone, sortType, loginState.getId()); | |
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | |
| ... | ... | @@ -138,6 +139,27 @@ |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | 141 | return lisFacade.getAppLisList(patientId, status, page, limit); |
| 142 | + } | |
| 143 | + | |
| 144 | + | |
| 145 | + /** | |
| 146 | + * 查询每一个检验明细包括检验项的内容 | |
| 147 | + * @param id | |
| 148 | + * @param token | |
| 149 | + * @return | |
| 150 | + */ | |
| 151 | + @RequestMapping(method = RequestMethod.GET, value = "/getAppLisById") | |
| 152 | + @ResponseBody | |
| 153 | + public BaseResponse getAppLisById(@RequestParam("id") Integer id, | |
| 154 | + @RequestHeader("Authorization") String token) { | |
| 155 | + | |
| 156 | + if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) | |
| 157 | + { | |
| 158 | + ExceptionUtils.catchException("The request token is " + token); | |
| 159 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Token is error"); | |
| 160 | + } | |
| 161 | + | |
| 162 | + return lisFacade.getAppLisById(id); | |
| 141 | 163 | } |
| 142 | 164 | |
| 143 | 165 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
5c69e8c
| ... | ... | @@ -76,12 +76,12 @@ |
| 76 | 76 | * @param sortType 排序类型(1,根据日期分类;2,根据检查项目分类) |
| 77 | 77 | * @return |
| 78 | 78 | */ |
| 79 | - public BaseResponse getLisAndRisData(String vcCardNo,Integer sortType,Integer userId) { | |
| 79 | + public BaseResponse getLisAndRisData(String vcCardNo,String phone,Integer sortType,Integer userId) { | |
| 80 | 80 | List<CheckByDate> checkByDate=new ArrayList<CheckByDate>(); |
| 81 | 81 | if(1 == sortType){ |
| 82 | 82 | List<CheckResponse> result = new ArrayList<>(); |
| 83 | 83 | //获取lis数据 |
| 84 | - result.addAll(queryLisCheckList(vcCardNo,userId)); | |
| 84 | + result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
| 85 | 85 | //result.addAll(queryPacsCheckList(cardNo)); |
| 86 | 86 | List<String> keyList = new ArrayList<>(); |
| 87 | 87 | // 去重 |
| ... | ... | @@ -163,7 +163,7 @@ |
| 163 | 163 | } |
| 164 | 164 | }else{ |
| 165 | 165 | List<CheckResponse> result = new ArrayList<CheckResponse>(); |
| 166 | - result.addAll(queryLisCheckList(vcCardNo,userId)); | |
| 166 | + result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
| 167 | 167 | //result.addAll(queryPacsCheckList(cardNo)); |
| 168 | 168 | List<String> keyList = new ArrayList<>(); |
| 169 | 169 | List<String> listtype=new ArrayList<>(); |
| 170 | 170 | |
| ... | ... | @@ -266,11 +266,12 @@ |
| 266 | 266 | * 2、再根据pid查询到这个孕妇在区域所有的建档记录 |
| 267 | 267 | * 3、分别取每个建档中的医院id和就诊卡号在lis记录表中查询数据 |
| 268 | 268 | * 4、封装lis数据 |
| 269 | - * @param vcCardNo | |
| 269 | + * @param vcCardNo 就诊卡号 | |
| 270 | + * @param phone 手机号码 | |
| 270 | 271 | * @param userId 用户ID |
| 271 | 272 | * @return |
| 272 | 273 | */ |
| 273 | - public List<CheckResponse> queryLisCheckList(String vcCardNo,Integer userId) { | |
| 274 | + public List<CheckResponse> queryLisCheckList(String vcCardNo,String phone,Integer userId) { | |
| 274 | 275 | |
| 275 | 276 | //保存这个人在所有医院的lis记录 |
| 276 | 277 | List<CheckResponse> result = new ArrayList<>(); |
| 277 | 278 | |
| ... | ... | @@ -285,10 +286,11 @@ |
| 285 | 286 | organizationQuery.setYn(YnEnums.YES.getId()); |
| 286 | 287 | |
| 287 | 288 | PatientsQuery patientsQuery=new PatientsQuery(); |
| 288 | - patientsQuery.setVcCardNo(vcCardNo); | |
| 289 | + String[] strs = new String[]{phone, vcCardNo}; | |
| 290 | + patientsQuery.setPv(strs); | |
| 289 | 291 | patientsQuery.setHospitalId(hospitalId); |
| 290 | 292 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 291 | - //通过医院id和就诊卡号查询到孕妇信息 | |
| 293 | + //通过医院id和就诊卡号或者手机号码查询到孕妇信息 | |
| 292 | 294 | List<Patients> list= patientsService.queryPatient(patientsQuery); |
| 293 | 295 | if(CollectionUtils.isNotEmpty(list)){ |
| 294 | 296 | |
| ... | ... | @@ -305,7 +307,7 @@ |
| 305 | 307 | if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId())) |
| 306 | 308 | { |
| 307 | 309 | |
| 308 | - if (StringUtils.isNotEmpty(pat.getVcCardNo()) && StringUtils.isNotEmpty(pat.getPhone())) | |
| 310 | + if (StringUtils.isEmpty(pat.getVcCardNo()) && StringUtils.isEmpty(pat.getPhone())) | |
| 309 | 311 | { |
| 310 | 312 | continue; |
| 311 | 313 | } |
| ... | ... | @@ -407,6 +409,7 @@ |
| 407 | 409 | patientsQuery.setId(patientId); |
| 408 | 410 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 409 | 411 | List<Patients> list= patientsService.queryPatient(patientsQuery); |
| 412 | + List<LisReportModel> lises = null; | |
| 410 | 413 | if (CollectionUtils.isNotEmpty(list)) |
| 411 | 414 | { |
| 412 | 415 | Patients patients = list.get(0); |
| ... | ... | @@ -422,7 +425,7 @@ |
| 422 | 425 | query.setStatus(status); |
| 423 | 426 | query.setHospitalId(patients.getHospitalId()); |
| 424 | 427 | |
| 425 | - List<LisReportModel> lises = lisService.queryLisDataByQuery(query); | |
| 428 | + lises = lisService.queryLisDataByQuery(query); | |
| 426 | 429 | if (CollectionUtils.isNotEmpty(lises)) |
| 427 | 430 | { |
| 428 | 431 | for(LisReportModel lisReportModel : lises) |
| 429 | 432 | |
| 430 | 433 | |
| ... | ... | @@ -430,20 +433,20 @@ |
| 430 | 433 | String json = lisReportModel.getItemJson(); |
| 431 | 434 | if (StringUtils.isNotEmpty(json)) |
| 432 | 435 | { |
| 433 | - List<LisReportItemModel> items = JsonUtil.toList(json,LisReportItemModel.class); | |
| 434 | - lisReportModel.setItems(items); | |
| 436 | + List<LisReportItemModel> items = JsonUtil.toList(json, LisReportItemModel.class); | |
| 437 | + lisReportModel.setItems(items.size() > 3 ? items.subList(0, 3) : items.subList(0,items.size())); | |
| 435 | 438 | lisReportModel.setItemJson(null); |
| 436 | 439 | } |
| 437 | 440 | } |
| 438 | 441 | } |
| 439 | 442 | |
| 440 | - BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 441 | - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 442 | - objectResponse.setData(lises); | |
| 443 | - objectResponse.setErrormsg("成功"); | |
| 444 | - return objectResponse; | |
| 443 | + | |
| 445 | 444 | } |
| 446 | - return null; | |
| 445 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 446 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 447 | + objectResponse.setData(lises); | |
| 448 | + objectResponse.setErrormsg("成功"); | |
| 449 | + return objectResponse; | |
| 447 | 450 | } |
| 448 | 451 | |
| 449 | 452 | /** |
| ... | ... | @@ -469,6 +472,37 @@ |
| 469 | 472 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); |
| 470 | 473 | } |
| 471 | 474 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
| 475 | + } | |
| 476 | + | |
| 477 | + /** | |
| 478 | + * 通过id查询到lis检查报告详情 | |
| 479 | + * @param id | |
| 480 | + * @return | |
| 481 | + */ | |
| 482 | + public BaseResponse getAppLisById(Integer id) { | |
| 483 | + | |
| 484 | + LisReportQuery query = new LisReportQuery(); | |
| 485 | + query.setId(id); | |
| 486 | + | |
| 487 | + List<LisReportModel> lises = lisService.queryLisDataByQuery(query); | |
| 488 | + if (CollectionUtils.isNotEmpty(lises)) | |
| 489 | + { | |
| 490 | + for(LisReportModel lisReportModel : lises) | |
| 491 | + { | |
| 492 | + String json = lisReportModel.getItemJson(); | |
| 493 | + if (StringUtils.isNotEmpty(json)) | |
| 494 | + { | |
| 495 | + List<LisReportItemModel> items = JsonUtil.toList(json, LisReportItemModel.class); | |
| 496 | + lisReportModel.setItems(items); | |
| 497 | + lisReportModel.setItemJson(null); | |
| 498 | + } | |
| 499 | + } | |
| 500 | + } | |
| 501 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 502 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 503 | + objectResponse.setData(lises); | |
| 504 | + objectResponse.setErrormsg("成功"); | |
| 505 | + return objectResponse; | |
| 472 | 506 | } |
| 473 | 507 | } |