Commit d3a8bd5a6d4ef368894c60d0e6b146f6940d76df
1 parent
ca74f1465b
Exists in
master
and in
6 other branches
改变接口展现形式重新返回数据结构
Showing 4 changed files with 976 additions and 117 deletions
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/v1/HisService.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/v2/HisService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
View file @
d3a8bd5
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | import com.lyms.platform.pojo.*; |
| 16 | 16 | import com.lyms.platform.query.LisReportQuery; |
| 17 | 17 | import com.lyms.platform.query.PatientsQuery; |
| 18 | + | |
| 18 | 19 | import org.apache.commons.collections.CollectionUtils; |
| 19 | 20 | import org.apache.commons.dbutils.DbUtils; |
| 20 | 21 | import org.apache.commons.dbutils.QueryRunner; |
| ... | ... | @@ -273,6 +274,284 @@ |
| 273 | 274 | |
| 274 | 275 | return resultList; |
| 275 | 276 | } |
| 277 | + | |
| 278 | + | |
| 279 | + /** | |
| 280 | + * gxk 新建接口(与queryCheckList接口显示格式不同) | |
| 281 | + * 根据日期或检查项目分类调用的方法 | |
| 282 | + * @param cardNo | |
| 283 | + * @param ftype(1,根据日期分类;2,根据检查项目分类) | |
| 284 | + * @return | |
| 285 | + */ | |
| 286 | + public List<CheckByDate> queryCheckListupdate(String cardNo,int ftype){ | |
| 287 | + | |
| 288 | + CheckResponse check1=new CheckResponse(); | |
| 289 | + check1.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 290 | + check1.setType(1); | |
| 291 | + check1.setName("张三"); | |
| 292 | + check1.setTitle("血常规"); | |
| 293 | + check1.setAge("30"); | |
| 294 | + check1.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 295 | + check1.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 296 | + check1.setCheckDept("血科"); | |
| 297 | + check1.setDoctor("王医生"); | |
| 298 | + | |
| 299 | + CheckResponse check10=new CheckResponse(); | |
| 300 | + check10.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 301 | + check10.setType(1); | |
| 302 | + check10.setName("张三"); | |
| 303 | + check10.setTitle("肝功能"); | |
| 304 | + check10.setAge("30"); | |
| 305 | + check10.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 306 | + check10.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 307 | + check10.setCheckDept("肝科"); | |
| 308 | + check10.setDoctor("刘医生"); | |
| 309 | + | |
| 310 | + CheckResponse check9=new CheckResponse(); | |
| 311 | + check9.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 312 | + check9.setType(2); | |
| 313 | + check9.setName("张三"); | |
| 314 | + check9.setTitle("肝功能"); | |
| 315 | + check9.setAge("30"); | |
| 316 | + check9.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 317 | + check9.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 318 | + check9.setCheckDept("肝科"); | |
| 319 | + check9.setDoctor("刘医生"); | |
| 320 | + | |
| 321 | + CheckItemResponse check2=new CheckItemResponse(); | |
| 322 | + check2.setName("白细胞"); | |
| 323 | + check2.setCode("0101001"); | |
| 324 | + check2.setRefer("4.00--10.00"); | |
| 325 | + check2.setResult("13.68"); | |
| 326 | + check2.setSpecial("H"); | |
| 327 | + | |
| 328 | + CheckItemResponse check3=new CheckItemResponse(); | |
| 329 | + | |
| 330 | + check3.setName("超敏 C反应蛋白"); | |
| 331 | + check3.setCode("0101501"); | |
| 332 | + check3.setRefer("0--5"); | |
| 333 | + check3.setResult("3.2"); | |
| 334 | + check3.setSpecial("M"); | |
| 335 | + check3.setUnit("mg/L"); | |
| 336 | + | |
| 337 | + CheckItemResponse check4=new CheckItemResponse(); | |
| 338 | + check4.setName("大便性状"); | |
| 339 | + check4.setCode("0103003"); | |
| 340 | + check4.setRefer(""); | |
| 341 | + check4.setResult("稀便"); | |
| 342 | + check4.setSpecial("M"); | |
| 343 | + check4.setUnit(""); | |
| 344 | + | |
| 345 | + CheckItemResponse check5=new CheckItemResponse(); | |
| 346 | + check5.setName("大便颜色"); | |
| 347 | + check5.setCode("0103002"); | |
| 348 | + check5.setRefer(""); | |
| 349 | + check5.setResult("黄色"); | |
| 350 | + check5.setSpecial("M"); | |
| 351 | + check5.setUnit(""); | |
| 352 | + | |
| 353 | + List<CheckItemResponse> listc=new ArrayList<CheckItemResponse>(); | |
| 354 | + listc.add(check2); | |
| 355 | + listc.add(check3); | |
| 356 | + List<CheckItemResponse> listc2=new ArrayList<CheckItemResponse>(); | |
| 357 | + listc2.add(check4); | |
| 358 | + listc2.add(check5); | |
| 359 | + check1.setItemList(listc); | |
| 360 | + check10.setItemList(listc2); | |
| 361 | + check9.setItemList(listc2); | |
| 362 | + List<CheckResponse> l=new ArrayList<CheckResponse>(); | |
| 363 | + l.add(check1); | |
| 364 | + l.add(check10); | |
| 365 | + l.add(check9); | |
| 366 | + | |
| 367 | + if(1==ftype){ | |
| 368 | + List<CheckResponse> result = new ArrayList<>(); | |
| 369 | + | |
| 370 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 371 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 372 | + result.addAll(l); | |
| 373 | + //result.addAll(queryLisCheckList(cardNo));解开 | |
| 374 | + //result.addAll(queryPacsCheckList(cardNo)); | |
| 375 | + List<String> keyList = new ArrayList<>(); | |
| 376 | + // 去重 | |
| 377 | + List<CheckResponse> list = new ArrayList<>(); | |
| 378 | + Date tempDate = null; | |
| 379 | + for (CheckResponse check:result) { | |
| 380 | + if (check.getModified() != null && check.getModified().equals(tempDate)) { | |
| 381 | + continue; | |
| 382 | + } | |
| 383 | + list.add(check); | |
| 384 | + tempDate = check.getModified(); | |
| 385 | + } | |
| 386 | + // 排序 | |
| 387 | + Collections.sort(list, new Comparator() { | |
| 388 | + public int compare(Object a, Object b) { | |
| 389 | + if (((CheckResponse)a).getModified() == null) { | |
| 390 | + return -1; | |
| 391 | + } | |
| 392 | + if (((CheckResponse)b).getModified() == null) { | |
| 393 | + return -1; | |
| 394 | + } | |
| 395 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 396 | + return 1; | |
| 397 | + } | |
| 398 | + return -1; | |
| 399 | + } | |
| 400 | + }); | |
| 401 | + | |
| 402 | + for (CheckResponse check:list) { | |
| 403 | + String ymd = DateUtil.getyyyy_MM_dd(check.getModified()); | |
| 404 | + if (!keyList.contains(ymd)) { | |
| 405 | + keyList.add(ymd); | |
| 406 | + } | |
| 407 | + | |
| 408 | + } | |
| 409 | + | |
| 410 | + for(String time:keyList){ | |
| 411 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 412 | + CheckType jianyan=new CheckType(); | |
| 413 | + jianyan.setType("检验报告"); | |
| 414 | + CheckType yingxiang=new CheckType(); | |
| 415 | + yingxiang.setType("影像报告"); | |
| 416 | + CheckType other=new CheckType(); | |
| 417 | + other.setType("其它报告"); | |
| 418 | + for(CheckResponse chre:result){ | |
| 419 | + if(time.equals(DateUtil.getyyyy_MM_dd(chre.getModified()))){ | |
| 420 | + if(chre.getType() == 1){ | |
| 421 | + result2.add(chre); | |
| 422 | + jianyan.setTypeName(result2); | |
| 423 | + CheckType.add(jianyan); | |
| 424 | + }else if(chre.getType() == 2){ | |
| 425 | + result2.add(chre); | |
| 426 | + yingxiang.setTypeName(result2); | |
| 427 | + CheckType.add(yingxiang); | |
| 428 | + }else{ | |
| 429 | + result2.add(chre); | |
| 430 | + other.setTypeName(result2); | |
| 431 | + CheckType.add(other); | |
| 432 | + } | |
| 433 | + } | |
| 434 | + } | |
| 435 | + | |
| 436 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 437 | + CheckByDate1.setTime(time); | |
| 438 | + CheckByDate1.setTypes(CheckType); | |
| 439 | + CheckByDate.add(CheckByDate1); | |
| 440 | + } | |
| 441 | + | |
| 442 | + return CheckByDate; | |
| 443 | + | |
| 444 | + }else{ | |
| 445 | + List<CheckResponse> result = new ArrayList<>(); | |
| 446 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 447 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 448 | + result.addAll(l); | |
| 449 | + //result.addAll(queryLisCheckList(cardNo));解开 | |
| 450 | + //result.addAll(queryPacsCheckList(cardNo)); | |
| 451 | + List<String> keyList = new ArrayList<>(); | |
| 452 | + List<String> listtype=new ArrayList<>(); | |
| 453 | + List<CheckResponse> listt = new ArrayList<>(); | |
| 454 | + // 去重 | |
| 455 | + List<CheckResponse> list = new ArrayList<>(); | |
| 456 | + Integer num=0; | |
| 457 | + for(CheckResponse check:result){ | |
| 458 | + if(check.getType()!=null && check.getType()==num){ | |
| 459 | + continue; | |
| 460 | + } | |
| 461 | + list.add(check); | |
| 462 | + num=check.getType(); | |
| 463 | + } | |
| 464 | + String t=null; | |
| 465 | + for(CheckResponse check:result){ | |
| 466 | + if(check.getTitle()!=null && check.getTitle().equals(t)){ | |
| 467 | + continue; | |
| 468 | + } | |
| 469 | + listt.add(check); | |
| 470 | + t=check.getTitle(); | |
| 471 | + } | |
| 472 | + | |
| 473 | + | |
| 474 | + // 排序 | |
| 475 | + Collections.sort(list, new Comparator() { | |
| 476 | + public int compare(Object a, Object b) { | |
| 477 | + if (((CheckResponse)a).getModified() == null) { | |
| 478 | + return -1; | |
| 479 | + } | |
| 480 | + if (((CheckResponse)b).getModified() == null) { | |
| 481 | + return -1; | |
| 482 | + } | |
| 483 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 484 | + return 1; | |
| 485 | + } | |
| 486 | + return -1; | |
| 487 | + } | |
| 488 | + }); | |
| 489 | + | |
| 490 | + for (CheckResponse check:list) { | |
| 491 | + Integer ymd = check.getType(); | |
| 492 | + if (!keyList.contains(ymd.toString())) { | |
| 493 | + keyList.add(ymd.toString()); | |
| 494 | + } | |
| 495 | + | |
| 496 | + } | |
| 497 | + for(CheckResponse check:listt){ | |
| 498 | + String ty=check.getTitle(); | |
| 499 | + if(!listtype.contains(ty)){ | |
| 500 | + listtype.add(ty); | |
| 501 | + } | |
| 502 | + } | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + for(String type:keyList){ | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + for(String typ:listtype){ | |
| 512 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 513 | + CheckType CheckType1=new CheckType(); | |
| 514 | + CheckType1.setType(typ); | |
| 515 | + for(CheckResponse chre:result){ | |
| 516 | + if(type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())){ | |
| 517 | + chre.setTitle(DateUtil.getyyyy_MM_dd(chre.getModified())+" "+chre.getTitle()); | |
| 518 | + result2.add(chre); | |
| 519 | + CheckType1.setTypeName(result2); | |
| 520 | + CheckType.add(CheckType1); | |
| 521 | + } | |
| 522 | + | |
| 523 | + } | |
| 524 | + } | |
| 525 | + | |
| 526 | + | |
| 527 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 528 | + if("1".equals(type)){ | |
| 529 | + CheckByDate1.setTime("检验报告"); | |
| 530 | + CheckByDate1.setTypes(CheckType); | |
| 531 | + CheckByDate.add(CheckByDate1); | |
| 532 | + }else if("2".equals(type)){ | |
| 533 | + CheckByDate1.setTime("影像报告"); | |
| 534 | + CheckByDate1.setTypes(CheckType); | |
| 535 | + CheckByDate.add(CheckByDate1); | |
| 536 | + }else{ | |
| 537 | + CheckByDate1.setTime("其它报告"); | |
| 538 | + CheckByDate1.setTypes(CheckType); | |
| 539 | + CheckByDate.add(CheckByDate1); | |
| 540 | + } | |
| 541 | + | |
| 542 | + } | |
| 543 | + | |
| 544 | + | |
| 545 | + return CheckByDate; | |
| 546 | + } | |
| 547 | + | |
| 548 | + } | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 276 | 555 | |
| 277 | 556 | public List<CheckResponse> queryLisCheckList(String cardNo) { |
| 278 | 557 | List<CheckResponse> result = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/hospitalapi/v1/HisService.java
View file @
d3a8bd5
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.hospitalapi.v2.*; |
| 5 | 5 | import com.lyms.platform.common.utils.DateUtil; |
| 6 | 6 | import com.lyms.platform.common.utils.JsonUtil; |
| 7 | + | |
| 7 | 8 | import org.apache.commons.dbutils.DbUtils; |
| 8 | 9 | import org.apache.commons.dbutils.QueryRunner; |
| 9 | 10 | import org.apache.commons.dbutils.handlers.BeanListHandler; |
| ... | ... | @@ -92,6 +93,282 @@ |
| 92 | 93 | |
| 93 | 94 | return resultList; |
| 94 | 95 | } |
| 96 | + | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * gxk 新建接口(与queryCheckList接口显示格式不同) | |
| 100 | + * 根据日期或检查项目分类调用的方法 | |
| 101 | + * @param cardNo | |
| 102 | + * @param ftype(1,根据日期分类;2,根据检查项目分类) | |
| 103 | + * @return | |
| 104 | + */ | |
| 105 | + public List<CheckByDate> queryCheckListupdate(String cardNo,int ftype){ | |
| 106 | + | |
| 107 | + CheckResponse check1=new CheckResponse(); | |
| 108 | + check1.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 109 | + check1.setType(1); | |
| 110 | + check1.setName("张三"); | |
| 111 | + check1.setTitle("血常规"); | |
| 112 | + check1.setAge("30"); | |
| 113 | + check1.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 114 | + check1.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 115 | + check1.setCheckDept("血科"); | |
| 116 | + check1.setDoctor("王医生"); | |
| 117 | + | |
| 118 | + CheckResponse check10=new CheckResponse(); | |
| 119 | + check10.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 120 | + check10.setType(1); | |
| 121 | + check10.setName("张三"); | |
| 122 | + check10.setTitle("肝功能"); | |
| 123 | + check10.setAge("30"); | |
| 124 | + check10.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 125 | + check10.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 126 | + check10.setCheckDept("肝科"); | |
| 127 | + check10.setDoctor("刘医生"); | |
| 128 | + | |
| 129 | + CheckResponse check9=new CheckResponse(); | |
| 130 | + check9.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 131 | + check9.setType(2); | |
| 132 | + check9.setName("张三"); | |
| 133 | + check9.setTitle("肝功能"); | |
| 134 | + check9.setAge("30"); | |
| 135 | + check9.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 136 | + check9.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 137 | + check9.setCheckDept("肝科"); | |
| 138 | + check9.setDoctor("刘医生"); | |
| 139 | + | |
| 140 | + CheckItemResponse check2=new CheckItemResponse(); | |
| 141 | + check2.setName("白细胞"); | |
| 142 | + check2.setCode("0101001"); | |
| 143 | + check2.setRefer("4.00--10.00"); | |
| 144 | + check2.setResult("13.68"); | |
| 145 | + check2.setSpecial("H"); | |
| 146 | + | |
| 147 | + CheckItemResponse check3=new CheckItemResponse(); | |
| 148 | + | |
| 149 | + check3.setName("超敏 C反应蛋白"); | |
| 150 | + check3.setCode("0101501"); | |
| 151 | + check3.setRefer("0--5"); | |
| 152 | + check3.setResult("3.2"); | |
| 153 | + check3.setSpecial("M"); | |
| 154 | + check3.setUnit("mg/L"); | |
| 155 | + | |
| 156 | + CheckItemResponse check4=new CheckItemResponse(); | |
| 157 | + check4.setName("大便性状"); | |
| 158 | + check4.setCode("0103003"); | |
| 159 | + check4.setRefer(""); | |
| 160 | + check4.setResult("稀便"); | |
| 161 | + check4.setSpecial("M"); | |
| 162 | + check4.setUnit(""); | |
| 163 | + | |
| 164 | + CheckItemResponse check5=new CheckItemResponse(); | |
| 165 | + check5.setName("大便颜色"); | |
| 166 | + check5.setCode("0103002"); | |
| 167 | + check5.setRefer(""); | |
| 168 | + check5.setResult("黄色"); | |
| 169 | + check5.setSpecial("M"); | |
| 170 | + check5.setUnit(""); | |
| 171 | + | |
| 172 | + List<CheckItemResponse> listc=new ArrayList<CheckItemResponse>(); | |
| 173 | + listc.add(check2); | |
| 174 | + listc.add(check3); | |
| 175 | + List<CheckItemResponse> listc2=new ArrayList<CheckItemResponse>(); | |
| 176 | + listc2.add(check4); | |
| 177 | + listc2.add(check5); | |
| 178 | + check1.setItemList(listc); | |
| 179 | + check10.setItemList(listc2); | |
| 180 | + check9.setItemList(listc2); | |
| 181 | + List<CheckResponse> l=new ArrayList<CheckResponse>(); | |
| 182 | + l.add(check1); | |
| 183 | + l.add(check10); | |
| 184 | + l.add(check9); | |
| 185 | + | |
| 186 | + if(1==ftype){ | |
| 187 | + List<CheckResponse> result = new ArrayList<>(); | |
| 188 | + | |
| 189 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 190 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 191 | + result.addAll(l); | |
| 192 | + //result.addAll(queryLisCheckList(cardNo));解开 | |
| 193 | + //result.addAll(queryPacsCheckList(cardNo));解开 | |
| 194 | + List<String> keyList = new ArrayList<>(); | |
| 195 | + // 去重 | |
| 196 | + List<CheckResponse> list = new ArrayList<>(); | |
| 197 | + Date tempDate = null; | |
| 198 | + for (CheckResponse check:result) { | |
| 199 | + if (check.getModified() != null && check.getModified().equals(tempDate)) { | |
| 200 | + continue; | |
| 201 | + } | |
| 202 | + list.add(check); | |
| 203 | + tempDate = check.getModified(); | |
| 204 | + } | |
| 205 | + // 排序 | |
| 206 | + Collections.sort(list, new Comparator() { | |
| 207 | + public int compare(Object a, Object b) { | |
| 208 | + if (((CheckResponse)a).getModified() == null) { | |
| 209 | + return -1; | |
| 210 | + } | |
| 211 | + if (((CheckResponse)b).getModified() == null) { | |
| 212 | + return -1; | |
| 213 | + } | |
| 214 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 215 | + return 1; | |
| 216 | + } | |
| 217 | + return -1; | |
| 218 | + } | |
| 219 | + }); | |
| 220 | + | |
| 221 | + for (CheckResponse check:list) { | |
| 222 | + String ymd = DateUtil.getyyyy_MM_dd(check.getModified()); | |
| 223 | + if (!keyList.contains(ymd)) { | |
| 224 | + keyList.add(ymd); | |
| 225 | + } | |
| 226 | + | |
| 227 | + } | |
| 228 | + | |
| 229 | + for(String time:keyList){ | |
| 230 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 231 | + CheckType jianyan=new CheckType(); | |
| 232 | + jianyan.setType("检验报告"); | |
| 233 | + CheckType yingxiang=new CheckType(); | |
| 234 | + yingxiang.setType("影像报告"); | |
| 235 | + CheckType other=new CheckType(); | |
| 236 | + other.setType("其它报告"); | |
| 237 | + for(CheckResponse chre:result){ | |
| 238 | + if(time.equals(DateUtil.getyyyy_MM_dd(chre.getModified()))){ | |
| 239 | + if(chre.getType() == 1){ | |
| 240 | + result2.add(chre); | |
| 241 | + jianyan.setTypeName(result2); | |
| 242 | + CheckType.add(jianyan); | |
| 243 | + }else if(chre.getType() == 2){ | |
| 244 | + result2.add(chre); | |
| 245 | + yingxiang.setTypeName(result2); | |
| 246 | + CheckType.add(yingxiang); | |
| 247 | + }else{ | |
| 248 | + result2.add(chre); | |
| 249 | + other.setTypeName(result2); | |
| 250 | + CheckType.add(other); | |
| 251 | + } | |
| 252 | + } | |
| 253 | + } | |
| 254 | + | |
| 255 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 256 | + CheckByDate1.setTime(time); | |
| 257 | + CheckByDate1.setTypes(CheckType); | |
| 258 | + CheckByDate.add(CheckByDate1); | |
| 259 | + } | |
| 260 | + | |
| 261 | + return CheckByDate; | |
| 262 | + | |
| 263 | + }else{ | |
| 264 | + List<CheckResponse> result = new ArrayList<>(); | |
| 265 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 266 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 267 | + result.addAll(l); | |
| 268 | + //result.addAll(queryLisCheckList(cardNo));解开 | |
| 269 | + //result.addAll(queryPacsCheckList(cardNo));解开 | |
| 270 | + List<String> keyList = new ArrayList<>(); | |
| 271 | + List<String> listtype=new ArrayList<>(); | |
| 272 | + List<CheckResponse> listt = new ArrayList<>(); | |
| 273 | + // 去重 | |
| 274 | + List<CheckResponse> list = new ArrayList<>(); | |
| 275 | + Integer num=0; | |
| 276 | + for(CheckResponse check:result){ | |
| 277 | + if(check.getType()!=null && check.getType()==num){ | |
| 278 | + continue; | |
| 279 | + } | |
| 280 | + list.add(check); | |
| 281 | + num=check.getType(); | |
| 282 | + } | |
| 283 | + String t=null; | |
| 284 | + for(CheckResponse check:result){ | |
| 285 | + if(check.getTitle()!=null && check.getTitle().equals(t)){ | |
| 286 | + continue; | |
| 287 | + } | |
| 288 | + listt.add(check); | |
| 289 | + t=check.getTitle(); | |
| 290 | + } | |
| 291 | + | |
| 292 | + | |
| 293 | + // 排序 | |
| 294 | + Collections.sort(list, new Comparator() { | |
| 295 | + public int compare(Object a, Object b) { | |
| 296 | + if (((CheckResponse)a).getModified() == null) { | |
| 297 | + return -1; | |
| 298 | + } | |
| 299 | + if (((CheckResponse)b).getModified() == null) { | |
| 300 | + return -1; | |
| 301 | + } | |
| 302 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 303 | + return 1; | |
| 304 | + } | |
| 305 | + return -1; | |
| 306 | + } | |
| 307 | + }); | |
| 308 | + | |
| 309 | + for (CheckResponse check:list) { | |
| 310 | + Integer ymd = check.getType(); | |
| 311 | + if (!keyList.contains(ymd.toString())) { | |
| 312 | + keyList.add(ymd.toString()); | |
| 313 | + } | |
| 314 | + | |
| 315 | + } | |
| 316 | + for(CheckResponse check:listt){ | |
| 317 | + String ty=check.getTitle(); | |
| 318 | + if(!listtype.contains(ty)){ | |
| 319 | + listtype.add(ty); | |
| 320 | + } | |
| 321 | + } | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + for(String type:keyList){ | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + for(String typ:listtype){ | |
| 331 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 332 | + CheckType CheckType1=new CheckType(); | |
| 333 | + CheckType1.setType(typ); | |
| 334 | + for(CheckResponse chre:result){ | |
| 335 | + if(type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())){ | |
| 336 | + chre.setTitle(DateUtil.getyyyy_MM_dd(chre.getModified())+" "+chre.getTitle()); | |
| 337 | + result2.add(chre); | |
| 338 | + CheckType1.setTypeName(result2); | |
| 339 | + CheckType.add(CheckType1); | |
| 340 | + } | |
| 341 | + | |
| 342 | + } | |
| 343 | + } | |
| 344 | + | |
| 345 | + | |
| 346 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 347 | + if("1".equals(type)){ | |
| 348 | + CheckByDate1.setTime("检验报告"); | |
| 349 | + CheckByDate1.setTypes(CheckType); | |
| 350 | + CheckByDate.add(CheckByDate1); | |
| 351 | + }else if("2".equals(type)){ | |
| 352 | + CheckByDate1.setTime("影像报告"); | |
| 353 | + CheckByDate1.setTypes(CheckType); | |
| 354 | + CheckByDate.add(CheckByDate1); | |
| 355 | + }else{ | |
| 356 | + CheckByDate1.setTime("其它报告"); | |
| 357 | + CheckByDate1.setTypes(CheckType); | |
| 358 | + CheckByDate.add(CheckByDate1); | |
| 359 | + } | |
| 360 | + | |
| 361 | + } | |
| 362 | + | |
| 363 | + | |
| 364 | + return CheckByDate; | |
| 365 | + } | |
| 366 | + | |
| 367 | + } | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 95 | 372 | |
| 96 | 373 | public List<CheckResponse> queryLisCheckList(String cardNo) { |
| 97 | 374 | List<CheckResponse> result = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/hospitalapi/v2/HisService.java
View file @
d3a8bd5
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.pojo.*; |
| 4 | 4 | import com.lyms.platform.common.utils.DateUtil; |
| 5 | + | |
| 5 | 6 | import org.apache.commons.dbutils.DbUtils; |
| 6 | 7 | import org.apache.commons.dbutils.QueryRunner; |
| 7 | 8 | import org.apache.commons.dbutils.handlers.BeanListHandler; |
| ... | ... | @@ -90,6 +91,283 @@ |
| 90 | 91 | |
| 91 | 92 | return resultList; |
| 92 | 93 | } |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * gxk 新建接口(与queryCheckList接口显示格式不同) | |
| 99 | + * 根据日期或检查项目分类调用的方法 | |
| 100 | + * @param cardNo | |
| 101 | + * @param ftype(1,根据日期分类;2,根据检查项目分类) | |
| 102 | + * @return | |
| 103 | + */ | |
| 104 | + public List<CheckByDate> queryCheckListupdate(String cardNo,int ftype){ | |
| 105 | + | |
| 106 | + CheckResponse check1=new CheckResponse(); | |
| 107 | + check1.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 108 | + check1.setType(1); | |
| 109 | + check1.setName("张三"); | |
| 110 | + check1.setTitle("血常规"); | |
| 111 | + check1.setAge("30"); | |
| 112 | + check1.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 113 | + check1.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 114 | + check1.setCheckDept("血科"); | |
| 115 | + check1.setDoctor("王医生"); | |
| 116 | + | |
| 117 | + CheckResponse check10=new CheckResponse(); | |
| 118 | + check10.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 119 | + check10.setType(1); | |
| 120 | + check10.setName("张三"); | |
| 121 | + check10.setTitle("肝功能"); | |
| 122 | + check10.setAge("30"); | |
| 123 | + check10.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 124 | + check10.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 125 | + check10.setCheckDept("肝科"); | |
| 126 | + check10.setDoctor("刘医生"); | |
| 127 | + | |
| 128 | + CheckResponse check9=new CheckResponse(); | |
| 129 | + check9.setModified(DateUtil.parseYMDHMS("2017-3-31")); | |
| 130 | + check9.setType(2); | |
| 131 | + check9.setName("张三"); | |
| 132 | + check9.setTitle("肝功能"); | |
| 133 | + check9.setAge("30"); | |
| 134 | + check9.setApplyDate(DateUtil.parseYMDHMS("2017-3-31")); | |
| 135 | + check9.setApplyDateStr(DateUtil.getyyyy_MM_dd(DateUtil.parseYMDHMS("2017-3-31"))); | |
| 136 | + check9.setCheckDept("肝科"); | |
| 137 | + check9.setDoctor("刘医生"); | |
| 138 | + | |
| 139 | + CheckItemResponse check2=new CheckItemResponse(); | |
| 140 | + check2.setName("白细胞"); | |
| 141 | + check2.setCode("0101001"); | |
| 142 | + check2.setRefer("4.00--10.00"); | |
| 143 | + check2.setResult("13.68"); | |
| 144 | + check2.setSpecial("H"); | |
| 145 | + | |
| 146 | + CheckItemResponse check3=new CheckItemResponse(); | |
| 147 | + | |
| 148 | + check3.setName("超敏 C反应蛋白"); | |
| 149 | + check3.setCode("0101501"); | |
| 150 | + check3.setRefer("0--5"); | |
| 151 | + check3.setResult("3.2"); | |
| 152 | + check3.setSpecial("M"); | |
| 153 | + check3.setUnit("mg/L"); | |
| 154 | + | |
| 155 | + CheckItemResponse check4=new CheckItemResponse(); | |
| 156 | + check4.setName("大便性状"); | |
| 157 | + check4.setCode("0103003"); | |
| 158 | + check4.setRefer(""); | |
| 159 | + check4.setResult("稀便"); | |
| 160 | + check4.setSpecial("M"); | |
| 161 | + check4.setUnit(""); | |
| 162 | + | |
| 163 | + CheckItemResponse check5=new CheckItemResponse(); | |
| 164 | + check5.setName("大便颜色"); | |
| 165 | + check5.setCode("0103002"); | |
| 166 | + check5.setRefer(""); | |
| 167 | + check5.setResult("黄色"); | |
| 168 | + check5.setSpecial("M"); | |
| 169 | + check5.setUnit(""); | |
| 170 | + | |
| 171 | + List<CheckItemResponse> listc=new ArrayList<CheckItemResponse>(); | |
| 172 | + listc.add(check2); | |
| 173 | + listc.add(check3); | |
| 174 | + List<CheckItemResponse> listc2=new ArrayList<CheckItemResponse>(); | |
| 175 | + listc2.add(check4); | |
| 176 | + listc2.add(check5); | |
| 177 | + check1.setItemList(listc); | |
| 178 | + check10.setItemList(listc2); | |
| 179 | + check9.setItemList(listc2); | |
| 180 | + List<CheckResponse> l=new ArrayList<CheckResponse>(); | |
| 181 | + l.add(check1); | |
| 182 | + l.add(check10); | |
| 183 | + | |
| 184 | + if(1==ftype){ | |
| 185 | + List<CheckResponse> result = new ArrayList<>(); | |
| 186 | + | |
| 187 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 188 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 189 | + result.addAll(l); | |
| 190 | + //result.addAll(queryLisCheckList(cardNo));解开 | |
| 191 | + //result.addAll(queryPacsCheckList(cardNo)); | |
| 192 | + List<String> keyList = new ArrayList<>(); | |
| 193 | + // 去重 | |
| 194 | + List<CheckResponse> list = new ArrayList<>(); | |
| 195 | + Date tempDate = null; | |
| 196 | + for (CheckResponse check:result) { | |
| 197 | + if (check.getModified() != null && check.getModified().equals(tempDate)) { | |
| 198 | + continue; | |
| 199 | + } | |
| 200 | + list.add(check); | |
| 201 | + tempDate = check.getModified(); | |
| 202 | + } | |
| 203 | + // 排序 | |
| 204 | + Collections.sort(list, new Comparator() { | |
| 205 | + public int compare(Object a, Object b) { | |
| 206 | + if (((CheckResponse)a).getModified() == null) { | |
| 207 | + return -1; | |
| 208 | + } | |
| 209 | + if (((CheckResponse)b).getModified() == null) { | |
| 210 | + return -1; | |
| 211 | + } | |
| 212 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 213 | + return 1; | |
| 214 | + } | |
| 215 | + return -1; | |
| 216 | + } | |
| 217 | + }); | |
| 218 | + | |
| 219 | + for (CheckResponse check:list) { | |
| 220 | + String ymd = DateUtil.getyyyy_MM_dd(check.getModified()); | |
| 221 | + if (!keyList.contains(ymd)) { | |
| 222 | + keyList.add(ymd); | |
| 223 | + } | |
| 224 | + | |
| 225 | + } | |
| 226 | + | |
| 227 | + for(String time:keyList){ | |
| 228 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 229 | + CheckType jianyan=new CheckType(); | |
| 230 | + jianyan.setType("检验报告"); | |
| 231 | + CheckType yingxiang=new CheckType(); | |
| 232 | + yingxiang.setType("影像报告"); | |
| 233 | + CheckType other=new CheckType(); | |
| 234 | + other.setType("其它报告"); | |
| 235 | + for(CheckResponse chre:result){ | |
| 236 | + if(time.equals(DateUtil.getyyyy_MM_dd(chre.getModified()))){ | |
| 237 | + if(chre.getType() == 1){ | |
| 238 | + result2.add(chre); | |
| 239 | + jianyan.setTypeName(result2); | |
| 240 | + CheckType.add(jianyan); | |
| 241 | + }else if(chre.getType() == 2){ | |
| 242 | + result2.add(chre); | |
| 243 | + yingxiang.setTypeName(result2); | |
| 244 | + CheckType.add(yingxiang); | |
| 245 | + }else{ | |
| 246 | + result2.add(chre); | |
| 247 | + other.setTypeName(result2); | |
| 248 | + CheckType.add(other); | |
| 249 | + } | |
| 250 | + } | |
| 251 | + } | |
| 252 | + | |
| 253 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 254 | + CheckByDate1.setTime(time); | |
| 255 | + CheckByDate1.setTypes(CheckType); | |
| 256 | + CheckByDate.add(CheckByDate1); | |
| 257 | + } | |
| 258 | + | |
| 259 | + return CheckByDate; | |
| 260 | + | |
| 261 | + }else{ | |
| 262 | + List<CheckResponse> result = new ArrayList<>(); | |
| 263 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 264 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 265 | + result.addAll(l); | |
| 266 | + //result.addAll(queryLisCheckList(cardNo));解开 | |
| 267 | + //result.addAll(queryPacsCheckList(cardNo)); | |
| 268 | + List<String> keyList = new ArrayList<>(); | |
| 269 | + List<String> listtype=new ArrayList<>(); | |
| 270 | + List<CheckResponse> listt = new ArrayList<>(); | |
| 271 | + // 去重 | |
| 272 | + List<CheckResponse> list = new ArrayList<>(); | |
| 273 | + Integer num=0; | |
| 274 | + for(CheckResponse check:result){ | |
| 275 | + if(check.getType()!=null && check.getType()==num){ | |
| 276 | + continue; | |
| 277 | + } | |
| 278 | + list.add(check); | |
| 279 | + num=check.getType(); | |
| 280 | + } | |
| 281 | + String t=null; | |
| 282 | + for(CheckResponse check:result){ | |
| 283 | + if(check.getTitle()!=null && check.getTitle().equals(t)){ | |
| 284 | + continue; | |
| 285 | + } | |
| 286 | + listt.add(check); | |
| 287 | + t=check.getTitle(); | |
| 288 | + } | |
| 289 | + | |
| 290 | + | |
| 291 | + // 排序 | |
| 292 | + Collections.sort(list, new Comparator() { | |
| 293 | + public int compare(Object a, Object b) { | |
| 294 | + if (((CheckResponse)a).getModified() == null) { | |
| 295 | + return -1; | |
| 296 | + } | |
| 297 | + if (((CheckResponse)b).getModified() == null) { | |
| 298 | + return -1; | |
| 299 | + } | |
| 300 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 301 | + return 1; | |
| 302 | + } | |
| 303 | + return -1; | |
| 304 | + } | |
| 305 | + }); | |
| 306 | + | |
| 307 | + for (CheckResponse check:list) { | |
| 308 | + Integer ymd = check.getType(); | |
| 309 | + if (!keyList.contains(ymd.toString())) { | |
| 310 | + keyList.add(ymd.toString()); | |
| 311 | + } | |
| 312 | + | |
| 313 | + } | |
| 314 | + for(CheckResponse check:listt){ | |
| 315 | + String ty=check.getTitle(); | |
| 316 | + if(!listtype.contains(ty)){ | |
| 317 | + listtype.add(ty); | |
| 318 | + } | |
| 319 | + } | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + for(String type:keyList){ | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + for(String typ:listtype){ | |
| 329 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 330 | + CheckType CheckType1=new CheckType(); | |
| 331 | + CheckType1.setType(typ); | |
| 332 | + for(CheckResponse chre:result){ | |
| 333 | + if(type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())){ | |
| 334 | + chre.setTitle(DateUtil.getyyyy_MM_dd(chre.getModified())+" "+chre.getTitle()); | |
| 335 | + result2.add(chre); | |
| 336 | + CheckType1.setTypeName(result2); | |
| 337 | + CheckType.add(CheckType1); | |
| 338 | + } | |
| 339 | + | |
| 340 | + } | |
| 341 | + } | |
| 342 | + | |
| 343 | + | |
| 344 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 345 | + if("1".equals(type)){ | |
| 346 | + CheckByDate1.setTime("检验报告"); | |
| 347 | + CheckByDate1.setTypes(CheckType); | |
| 348 | + CheckByDate.add(CheckByDate1); | |
| 349 | + }else if("2".equals(type)){ | |
| 350 | + CheckByDate1.setTime("影像报告"); | |
| 351 | + CheckByDate1.setTypes(CheckType); | |
| 352 | + CheckByDate.add(CheckByDate1); | |
| 353 | + }else{ | |
| 354 | + CheckByDate1.setTime("其它报告"); | |
| 355 | + CheckByDate1.setTypes(CheckType); | |
| 356 | + CheckByDate.add(CheckByDate1); | |
| 357 | + } | |
| 358 | + | |
| 359 | + } | |
| 360 | + | |
| 361 | + | |
| 362 | + return CheckByDate; | |
| 363 | + } | |
| 364 | + | |
| 365 | + } | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 93 | 371 | |
| 94 | 372 | public List<CheckResponse> queryLisCheckList(String cardNo) { |
| 95 | 373 | List<CheckResponse> result = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
d3a8bd5
| ... | ... | @@ -71,8 +71,33 @@ |
| 71 | 71 | return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(qhdfyHisService.queryCheckList(cardNo)); |
| 72 | 72 | } else { |
| 73 | 73 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); |
| 74 | + | |
| 74 | 75 | } |
| 75 | 76 | } |
| 77 | + | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * gxk | |
| 81 | + * 返回新的按照日期分类的数据 | |
| 82 | + */ | |
| 83 | + @RequestMapping(method = RequestMethod.GET, value = "/hischecklistbydate") | |
| 84 | + @ResponseBody | |
| 85 | + public BaseResponse queryHisCheckList2(String cardNo, int ftype,HttpServletRequest request) { | |
| 86 | + if ("1".equals(HIS_VERSION)) { | |
| 87 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(hisServiceV1.queryCheckListupdate(cardNo,ftype)); | |
| 88 | + } else if ("2".equals(HIS_VERSION)) { | |
| 89 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(hisServiceV2.queryCheckListupdate(cardNo,ftype)); | |
| 90 | + } else if ("3".equals(HIS_VERSION)) { | |
| 91 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); | |
| 92 | + } else if ("4".equals(HIS_VERSION)) { | |
| 93 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(qhdfyHisService.queryCheckListupdate(cardNo,ftype)); | |
| 94 | + } else { | |
| 95 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); | |
| 96 | + | |
| 97 | + } | |
| 98 | + } | |
| 99 | + | |
| 100 | + | |
| 76 | 101 | |
| 77 | 102 | /** |
| 78 | 103 | * 查询产前检查 |