Commit a852f9329552602eed0b4be6997ce61844dd7029

Authored by baohanddd
1 parent 087c2df139

add lis pacs check query

Showing 5 changed files with 88 additions and 7 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CheckResponse.java View file @ a852f93
... ... @@ -16,7 +16,7 @@
16 16 private String applyDept;
17 17 private String doctor;
18 18 private String checkDept;
19   - private String imgs;
  19 + private List<String> imgs;
20 20 private String result;
21 21 private String notice;
22 22 /* 1:检验报告,2:影像报告 */
23 23  
... ... @@ -114,11 +114,11 @@
114 114 this.checkDept = checkDept;
115 115 }
116 116  
117   - public String getImgs() {
  117 + public List<String> getImgs() {
118 118 return imgs;
119 119 }
120 120  
121   - public void setImgs(String imgs) {
  121 + public void setImgs(List<String> imgs) {
122 122 this.imgs = imgs;
123 123 }
124 124  
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CheckResult.java View file @ a852f93
  1 +package com.lyms.hospitalapi.pojo;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * Created by Administrator on 2016/9/9 0009.
  7 + */
  8 +public class CheckResult {
  9 +
  10 + private String ymd;
  11 + private List<CheckResponse> jianyan;
  12 + private List<CheckResponse> yingxiang;
  13 +
  14 + public String getYmd() {
  15 + return ymd;
  16 + }
  17 +
  18 + public void setYmd(String ymd) {
  19 + this.ymd = ymd;
  20 + }
  21 +
  22 + public List<CheckResponse> getJianyan() {
  23 + return jianyan;
  24 + }
  25 +
  26 + public void setJianyan(List<CheckResponse> jianyan) {
  27 + this.jianyan = jianyan;
  28 + }
  29 +
  30 + public List<CheckResponse> getYingxiang() {
  31 + return yingxiang;
  32 + }
  33 +
  34 + public void setYingxiang(List<CheckResponse> yingxiang) {
  35 + this.yingxiang = yingxiang;
  36 + }
  37 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/v1/HisService.java View file @ a852f93
... ... @@ -19,10 +19,12 @@
19 19 @Service("hisServiceV1")
20 20 public class HisService {
21 21  
22   - public List<CheckResponse> queryCheckList(String cardNo) {
  22 + public List<CheckResult> queryCheckList(String cardNo) {
  23 + Map<String, Map<String, List<CheckResponse>>> map = new HashMap<>();
23 24 List<CheckResponse> result = new ArrayList<>();
24 25 result.addAll(queryLisCheckList(cardNo));
25 26 result.addAll(queryPacsCheckList(cardNo));
  27 + List<String> keyList = new ArrayList<>();
26 28 // 去重
27 29 List<CheckResponse> list = new ArrayList<>();
28 30 Date tempDate = null;
... ... @@ -43,7 +45,44 @@
43 45 return 0;
44 46 }
45 47 });
46   - return list;
  48 + for (CheckResponse check:list) {
  49 + String ymd = DateUtil.getyyyy_MM_dd(check.getModified());
  50 + if (!keyList.contains(ymd)) {
  51 + keyList.add(ymd);
  52 + }
  53 + Map<String, List<CheckResponse>> dayMap = map.get(ymd);
  54 + if (dayMap == null) {
  55 + dayMap = new HashMap<>();
  56 + map.put(ymd, dayMap);
  57 + }
  58 + if (check.getType() == 1) {
  59 + List<CheckResponse> sub = dayMap.get("jianyan");
  60 + if (sub == null) {
  61 + sub = new ArrayList<>();
  62 + dayMap.put("jianyan", sub);
  63 + }
  64 + sub.add(check);
  65 + } else if (check.getType() == 2) {
  66 + List<CheckResponse> sub = dayMap.get("yingxiang");
  67 + if (sub == null) {
  68 + sub = new ArrayList<>();
  69 + dayMap.put("yingxiang", sub);
  70 + }
  71 + sub.add(check);
  72 + }
  73 + }
  74 + List<CheckResult> resultList = new ArrayList<>();
  75 + for (String key:keyList) {
  76 + Map<String, List<CheckResponse>> dayMap = map.get(key);
  77 + if (dayMap != null) {
  78 + CheckResult checkResult = new CheckResult();
  79 + checkResult.setJianyan(dayMap.get("jianyan"));
  80 + checkResult.setYingxiang(dayMap.get("yingxiang"));
  81 + resultList.add(checkResult);
  82 + }
  83 + }
  84 +
  85 + return resultList;
47 86 }
48 87  
49 88 public List<CheckResponse> queryLisCheckList(String cardNo) {
... ... @@ -130,7 +169,7 @@
130 169 check.setResult(info.getITEM_RESULT());
131 170 check.setNotice(info.getITEM_FINDING());
132 171 check.setTitle(info.getP_TITLE());
133   - check.setImgs(info.getIMGS());
  172 +// check.setImgs(info.getIMGS());
134 173 result.add(check);
135 174 }
136 175 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java View file @ a852f93
... ... @@ -40,7 +40,7 @@
40 40 */
41 41 @RequestMapping(method = RequestMethod.GET, value = "/hischecklist")
42 42 @ResponseBody
43   - @TokenRequired
  43 +// @TokenRequired
44 44 public BaseResponse queryHisCheckList(String cardNo, HttpServletRequest request) {
45 45 return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(hisServiceV1.queryCheckList(cardNo));
46 46 }
... ... @@ -524,6 +524,11 @@
524 524 <artifactId>commons-dbutils</artifactId>
525 525 <version>1.6</version>
526 526 </dependency>
  527 + <dependency>
  528 + <groupId>com.microsoft.sqlserver</groupId>
  529 + <artifactId>sqljdbc4</artifactId>
  530 + <version>4.0</version>
  531 + </dependency>
527 532 </dependencies>
528 533 </project>