Commit 3150078505c763e60869c3fb1a5f0f25c14c7885

Authored by wangbo
1 parent 7210b96e3b

儿童出院诊断查询

Showing 4 changed files with 319 additions and 127 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/BabyDischargeDiagnosisModel.java View file @ 3150078
  1 +package com.lyms.hospitalapi.pojo;
  2 +
  3 +import java.util.Date;
  4 +
  5 +public class BabyDischargeDiagnosisModel {
  6 + //病历号=住院号
  7 + private String blh;
  8 +
  9 + //出院日期
  10 + private Date cyrq;
  11 +
  12 + //姓名
  13 + private String hzxm;
  14 +
  15 + //性别
  16 + private String sex;
  17 +
  18 + //出生日期
  19 + private String birth;
  20 +
  21 + //出院诊断
  22 + private String cyzdmc;
  23 +
  24 + public String getBlh() {
  25 + return blh;
  26 + }
  27 +
  28 + public void setBlh(String blh) {
  29 + this.blh = blh;
  30 + }
  31 +
  32 + public Date getCyrq() {
  33 + return cyrq;
  34 + }
  35 +
  36 + public void setCyrq(Date cyrq) {
  37 + this.cyrq = cyrq;
  38 + }
  39 +
  40 + public String getHzxm() {
  41 + return hzxm;
  42 + }
  43 +
  44 + public void setHzxm(String hzxm) {
  45 + this.hzxm = hzxm;
  46 + }
  47 +
  48 + public String getSex() {
  49 + return sex;
  50 + }
  51 +
  52 + public void setSex(String sex) {
  53 + this.sex = sex;
  54 + }
  55 +
  56 + public String getBirth() {
  57 + return birth;
  58 + }
  59 +
  60 + public void setBirth(String birth) {
  61 + this.birth = birth;
  62 + }
  63 +
  64 + public String getCyzdmc() {
  65 + return cyzdmc;
  66 + }
  67 +
  68 + public void setCyzdmc(String cyzdmc) {
  69 + this.cyzdmc = cyzdmc;
  70 + }
  71 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java View file @ 3150078
... ... @@ -71,17 +71,16 @@
71 71 public void syncLisReportTask(final String dateStr) {
72 72 // DateTime dt = new DateTime();
73 73 // dt = dt.minusDays(1);
74   - new Thread("syncLisReportTask"){
  74 + new Thread("syncLisReportTask") {
75 75 @Override
76   - public void run()
77   - {
  76 + public void run() {
78 77 queryLisReport(DateUtil.parseYMD(dateStr));
79 78 }
80 79 }.start();
81 80 }
82 81  
83 82 public List<QhdfyLisReport> queryLisReport(Date startDate) {
84   - System.out.print("begin queryLisReport"+ DateUtil.getyyyy_MM_dd_hms(new Date()));
  83 + System.out.print("begin queryLisReport" + DateUtil.getyyyy_MM_dd_hms(new Date()));
85 84 Integer hospitalId = 216;
86 85  
87 86 List<QhdfyLisReport> result = new ArrayList<>();
... ... @@ -95,7 +94,7 @@
95 94 referConfigQuery.setLimit(10000);
96 95 List<ReferValue> referValueList = referConfigService.queryRefer(referConfigQuery);
97 96 Map<String, ReferValue> referValueMap = new HashMap<>();
98   - for (ReferValue referValue:referValueList) {
  97 + for (ReferValue referValue : referValueList) {
99 98 referValueMap.put(referValue.getCode(), referValue);
100 99 }
101 100 PatientsQuery patientsQuery = new PatientsQuery();
... ... @@ -107,8 +106,8 @@
107 106 patientsQuery.setBuildTypeList(buildType);
108 107  
109 108  
110   - String startDateStr=DateUtil.getyyyy_MM_dd_hms(startDate);
111   - String sql = "select top 100000 shenqinghao as hospitalId,bingrenid as patientFid,zhuyuanhao as patientHid,kahao as vcCardNo,phone,huanzhexingming as name,xingbie as sex,nianling as age,shenqingkeshidaima as deptCode,shenqingkeshimingcheng as deptName,shenqingyishengdaima as applyDoctorCode,shenqingyishengmingcheng as applyDoctorName,jianchayishengdaima as checkDoctorCode,jianchayishengxingming as checkDoctorName,baogaofabushijian as publishTime from valllist_ex_en where baogaofabushijian > CONVERT(DATETIME,'"+startDateStr+"', 20) and phone is not null and phone !='' " +
  109 + String startDateStr = DateUtil.getyyyy_MM_dd_hms(startDate);
  110 + String sql = "select top 100000 shenqinghao as hospitalId,bingrenid as patientFid,zhuyuanhao as patientHid,kahao as vcCardNo,phone,huanzhexingming as name,xingbie as sex,nianling as age,shenqingkeshidaima as deptCode,shenqingkeshimingcheng as deptName,shenqingyishengdaima as applyDoctorCode,shenqingyishengmingcheng as applyDoctorName,jianchayishengdaima as checkDoctorCode,jianchayishengxingming as checkDoctorName,baogaofabushijian as publishTime from valllist_ex_en where baogaofabushijian > CONVERT(DATETIME,'" + startDateStr + "', 20) and phone is not null and phone !='' " +
112 111 " and shenqinghao is not null and shenqingkeshidaima in ('2320', '2321', '2322', '2323', '2324', '2325', '2326', '2327', '2328', '2329', '2310', '2540', '2541', '2544', '2555', '2558', '2559', '2560') order by shenqinghao desc";
113 112 String subSql = "select top 1000 sheqingdanhao as id,xiangmudaima as code,xiangmumingcheng as name,xiangmujieguo as result,zifujieguo as charResult,shuzijieguo as numberResult,gaodibiaozhi as flag,cankaozhi as ref,danwei as unit,jieguoleixing as result from valresult_ex_en where sheqingdanhao='";
114 113 List<LisReport> list = queryRunner.query(conn, sql, new BeanListHandler<LisReport>(LisReport.class));
115 114  
116 115  
117 116  
118 117  
119 118  
... ... @@ -116,28 +115,28 @@
116 115  
117 116  
118 117 if (list.size() > 0) {
119   - MongoCondition mongoCondition = MongoCondition.newInstance("hospitalId", ""+hospitalId, MongoOper.IS);
  118 + MongoCondition mongoCondition = MongoCondition.newInstance("hospitalId", "" + hospitalId, MongoOper.IS);
120 119 List<AssayConfig> assayConfigList = assayConfigDao.query(mongoCondition.toMongoQuery());
121   - Map<String, AssayConfig> assayConfigMap = new HashMap<>();
122   - for (AssayConfig config:assayConfigList) {
  120 + Map<String, AssayConfig> assayConfigMap = new HashMap<>();
  121 + for (AssayConfig config : assayConfigList) {
123 122 assayConfigMap.put(config.getProjectCode(), config);
124 123 }
125   - for (LisReport report:list) {
  124 + for (LisReport report : list) {
126 125 patientsQuery.setPhone(report.getPhone().trim());
127 126 int count = patientsService.queryPatientCount(patientsQuery);
128 127 LisReportQuery lisReportQuery = new LisReportQuery();
129 128 lisReportQuery.setId(hospitalId + "_" + report.getHospitalId());
130   - lisReportQuery.setHospitalId(""+hospitalId);
  129 + lisReportQuery.setHospitalId("" + hospitalId);
131 130 int reportCount = lisReportService.queryLisReportCount(lisReportQuery);
132 131  
133 132 if (count > 0 && reportCount == 0) {
134 133 patientsQuery.setLimit(1);
135 134 patientsQuery.setPage(0);
136 135 patientsQuery.setNeed("y");
137   - patientsQuery.setHospitalId(hospitalId+"");
  136 + patientsQuery.setHospitalId(hospitalId + "");
138 137 List<Patients> patientsList = patientsService.queryPatient(patientsQuery);
139 138 Patients patients = patientsList.get(0);
140   - if(null == patients.getLastMenses()){
  139 + if (null == patients.getLastMenses()) {
141 140 continue;
142 141 }
143 142  
... ... @@ -160,8 +159,8 @@
160 159 crisisItem.setStatusName("待处理");
161 160 crisisItem.setSyncStatus(0);
162 161  
163   - List<LisReportItem> itemList = queryRunner.query(conn, subSql+report.getHospitalId()+"'", new BeanListHandler<LisReportItem>(LisReportItem.class));
164   - System.out.println("itemList ====> "+itemList.size() );
  162 + List<LisReportItem> itemList = queryRunner.query(conn, subSql + report.getHospitalId() + "'", new BeanListHandler<LisReportItem>(LisReportItem.class));
  163 + System.out.println("itemList ====> " + itemList.size());
165 164 if (itemList.size() > 0) {
166 165 System.out.println("3====> " + reportCount);
167 166 report.setId(hospitalId + "_" + report.getHospitalId());
... ... @@ -170,7 +169,7 @@
170 169 lisReportService.addLisReport(report);
171 170  
172 171 // crisis init
173   - for (LisReportItem item:itemList) {
  172 + for (LisReportItem item : itemList) {
174 173 boolean flag = false;
175 174 ReferValue referValue = referValueMap.get(item.getCode().trim());
176 175 if (referValue != null) {
... ... @@ -212,10 +211,8 @@
212 211 //当前孕妇关联的初诊复诊医生危急通知
213 212 Set<String> sets = antenatalExaminationFacade.getCrisisUnionDoc(patients);
214 213  
215   - if (CollectionUtils.isNotEmpty(sets))
216   - {
217   - for (String doctorId : sets)
218   - {
  214 + if (CollectionUtils.isNotEmpty(sets)) {
  215 + for (String doctorId : sets) {
219 216 LisCrisisNotify notify = new LisCrisisNotify();
220 217 notify.setHospitalId(patients.getHospitalId());
221 218 notify.setPatientId(patients.getId());
222 219  
223 220  
224 221  
... ... @@ -244,18 +241,18 @@
244 241 return result;
245 242 }
246 243 }
247   - System.out.print("end queryLisReport"+ DateUtil.getyyyy_MM_dd_hms(new Date()));
  244 + System.out.print("end queryLisReport" + DateUtil.getyyyy_MM_dd_hms(new Date()));
248 245 return result;
249 246 }
250 247  
251 248 private String buildRef(ReferValue referValue) {
252 249 if (StringUtils.isNotBlank(referValue.getEmergencyMin()) && StringUtils.isNotBlank(referValue.getEmergencyMax())) {
253   - return referValue.getEmergencyMin() +"~"+referValue.getEmergencyMax();
  250 + return referValue.getEmergencyMin() + "~" + referValue.getEmergencyMax();
254 251 } else {
255 252 if (StringUtils.isNotBlank(referValue.getEmergencyMin())) {
256   - return ">"+referValue.getEmergencyMin();
  253 + return ">" + referValue.getEmergencyMin();
257 254 } else if (StringUtils.isNotBlank(referValue.getEmergencyMax())) {
258   - return "<"+referValue.getEmergencyMax();
  255 + return "<" + referValue.getEmergencyMax();
259 256 }
260 257 }
261 258 return "";
... ... @@ -270,7 +267,7 @@
270 267 // 去重
271 268 List<CheckResponse> list = new ArrayList<>();
272 269 Date tempDate = null;
273   - for (CheckResponse check:result) {
  270 + for (CheckResponse check : result) {
274 271 if (check.getModified() != null && check.getModified().equals(tempDate)) {
275 272 continue;
276 273 }
277 274  
278 275  
279 276  
... ... @@ -281,19 +278,19 @@
281 278 // 排序
282 279 Collections.sort(list, new Comparator() {
283 280 public int compare(Object a, Object b) {
284   - if (((CheckResponse)a).getModified() == null) {
  281 + if (((CheckResponse) a).getModified() == null) {
285 282 return 1;
286 283 }
287   - if (((CheckResponse)b).getModified() == null) {
  284 + if (((CheckResponse) b).getModified() == null) {
288 285 return 1;
289 286 }
290   - if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) {
  287 + if (((CheckResponse) a).getModified().before(((CheckResponse) a).getModified())) {
291 288 return -1;
292 289 }
293 290 return 1;
294 291 }
295 292 });
296   - for (CheckResponse check:list) {
  293 + for (CheckResponse check : list) {
297 294 String ymd = DateUtil.getyyyy_MM_dd(check.getModified());
298 295 if (!keyList.contains(ymd)) {
299 296 keyList.add(ymd);
... ... @@ -320,7 +317,7 @@
320 317 }
321 318 }
322 319 List<CheckResult> resultList = new ArrayList<>();
323   - for (String key:keyList) {
  320 + for (String key : keyList) {
324 321 Map<String, List<CheckResponse>> dayMap = map.get(key);
325 322 if (dayMap != null) {
326 323 CheckResult checkResult = new CheckResult();
327 324  
... ... @@ -338,11 +335,12 @@
338 335 /**
339 336 * gxk 新建接口(与queryCheckList接口显示格式不同)
340 337 * 根据日期或检查项目分类调用的方法
  338 + *
341 339 * @param cardNo
342 340 * @param ftype(1,根据日期分类;2,根据检查项目分类)
343 341 * @return
344 342 */
345   - public List<CheckByDate> queryCheckListupdate(String cardNo,int ftype){
  343 + public List<CheckByDate> queryCheckListupdate(String cardNo, int ftype) {
346 344  
347 345 /* CheckResponse check1=new CheckResponse();
348 346 check1.setHospitalName("秦皇岛妇幼保健");
349 347  
... ... @@ -426,10 +424,10 @@
426 424 l.add(check10);
427 425 l.add(check9);*/
428 426  
429   - if(1==ftype){
  427 + if (1 == ftype) {
430 428 List<CheckResponse> result = new ArrayList<>();
431 429  
432   - List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>();
  430 + List<CheckByDate> CheckByDate = new ArrayList<CheckByDate>();
433 431 //List<CheckType> CheckType=new ArrayList<CheckType>();
434 432 //result.addAll(l);
435 433 result.addAll(queryLisCheckList(cardNo));
... ... @@ -438,7 +436,7 @@
438 436 // 去重
439 437 List<CheckResponse> list = new ArrayList<>();
440 438 Date tempDate = null;
441   - for (CheckResponse check:result) {
  439 + for (CheckResponse check : result) {
442 440 if (check.getModified() != null && check.getModified().equals(tempDate)) {
443 441 continue;
444 442 }
445 443  
446 444  
447 445  
... ... @@ -448,20 +446,20 @@
448 446 // 排序
449 447 Collections.sort(list, new Comparator() {
450 448 public int compare(Object a, Object b) {
451   - if (((CheckResponse)a).getModified() == null) {
  449 + if (((CheckResponse) a).getModified() == null) {
452 450 return -1;
453 451 }
454   - if (((CheckResponse)b).getModified() == null) {
  452 + if (((CheckResponse) b).getModified() == null) {
455 453 return -1;
456 454 }
457   - if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) {
  455 + if (((CheckResponse) a).getModified().before(((CheckResponse) a).getModified())) {
458 456 return 1;
459 457 }
460 458 return -1;
461 459 }
462 460 });
463 461  
464   - for (CheckResponse check:list) {
  462 + for (CheckResponse check : list) {
465 463 String ymd = DateUtil.getyyyy_MM_dd(check.getModified());
466 464 if (!keyList.contains(ymd)) {
467 465 keyList.add(ymd);
468 466  
469 467  
470 468  
471 469  
472 470  
... ... @@ -469,28 +467,28 @@
469 467  
470 468 }
471 469  
472   - for(String time:keyList){
473   - List<CheckType> CheckType=new ArrayList<CheckType>();
474   - List<CheckResponse> result2=new ArrayList<>();//存放所有检验报告(type=1)
475   - List<CheckResponse> result3=new ArrayList<>();//存放所有影像报告(type=2)
476   - List<CheckResponse> result4=new ArrayList<>();//存放所有其他报告
477   - CheckType jianyan=new CheckType();
  470 + for (String time : keyList) {
  471 + List<CheckType> CheckType = new ArrayList<CheckType>();
  472 + List<CheckResponse> result2 = new ArrayList<>();//存放所有检验报告(type=1)
  473 + List<CheckResponse> result3 = new ArrayList<>();//存放所有影像报告(type=2)
  474 + List<CheckResponse> result4 = new ArrayList<>();//存放所有其他报告
  475 + CheckType jianyan = new CheckType();
478 476 jianyan.setType("检验报告");
479   - CheckType yingxiang=new CheckType();
  477 + CheckType yingxiang = new CheckType();
480 478 yingxiang.setType("影像报告");
481   - CheckType other=new CheckType();
  479 + CheckType other = new CheckType();
482 480 other.setType("其它报告");
483   - for(CheckResponse chre:result){
484   - if(time.equals(DateUtil.getyyyy_MM_dd(chre.getModified()))){
485   - if(chre.getType() == 1){
  481 + for (CheckResponse chre : result) {
  482 + if (time.equals(DateUtil.getyyyy_MM_dd(chre.getModified()))) {
  483 + if (chre.getType() == 1) {
486 484 result2.add(chre);
487 485 //jianyan.setTypeName(result2);
488 486 //CheckType.add(jianyan);
489   - }else if(chre.getType() == 2){
  487 + } else if (chre.getType() == 2) {
490 488 result3.add(chre);
491 489 //yingxiang.setTypeName(result3);
492 490 //CheckType.add(yingxiang);
493   - }else{
  491 + } else {
494 492 result4.add(chre);
495 493 //other.setTypeName(result4);
496 494 //CheckType.add(other);
... ... @@ -509,7 +507,7 @@
509 507 CheckType.add(other);
510 508  
511 509  
512   - CheckByDate CheckByDate1=new CheckByDate();
  510 + CheckByDate CheckByDate1 = new CheckByDate();
513 511 CheckByDate1.setTime(time);
514 512 CheckByDate1.setTypes(CheckType);
515 513 CheckByDate.add(CheckByDate1);
516 514  
517 515  
518 516  
519 517  
520 518  
521 519  
522 520  
523 521  
524 522  
525 523  
526 524  
527 525  
528 526  
529 527  
530 528  
531 529  
... ... @@ -517,87 +515,85 @@
517 515  
518 516 return CheckByDate;
519 517  
520   - }else{
  518 + } else {
521 519 List<CheckResponse> result = new ArrayList<CheckResponse>();
522   - List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>();
  520 + List<CheckByDate> CheckByDate = new ArrayList<CheckByDate>();
523 521 //List<CheckType> CheckType=new ArrayList<CheckType>();
524 522 //result.addAll(l);
525 523 result.addAll(queryLisCheckList(cardNo));
526 524 //result.addAll(queryPacsCheckList(cardNo));
527 525 List<String> keyList = new ArrayList<>();
528   - List<String> listtype=new ArrayList<>();
  526 + List<String> listtype = new ArrayList<>();
529 527 List<CheckResponse> listt = new ArrayList<>();
530 528 // 去重
531 529 List<CheckResponse> list = new ArrayList<>();
532   - Integer num=0;
533   - for(CheckResponse check:result){
534   - if(check.getType()!=null && check.getType()==num){
  530 + Integer num = 0;
  531 + for (CheckResponse check : result) {
  532 + if (check.getType() != null && check.getType() == num) {
535 533 continue;
536 534 }
537 535 list.add(check);
538   - num=check.getType();
  536 + num = check.getType();
539 537 }
540   - String t=null;
541   - for(CheckResponse check:result){
542   - if(check.getTitle()!=null && check.getTitle().equals(t)){
  538 + String t = null;
  539 + for (CheckResponse check : result) {
  540 + if (check.getTitle() != null && check.getTitle().equals(t)) {
543 541 continue;
544 542 }
545 543 listt.add(check);
546   - t=check.getTitle();
  544 + t = check.getTitle();
547 545 }
548 546  
549 547  
550 548 // 排序
551 549 Collections.sort(list, new Comparator() {
552 550 public int compare(Object a, Object b) {
553   - if (((CheckResponse)a).getModified() == null) {
  551 + if (((CheckResponse) a).getModified() == null) {
554 552 return -1;
555 553 }
556   - if (((CheckResponse)b).getModified() == null) {
  554 + if (((CheckResponse) b).getModified() == null) {
557 555 return -1;
558 556 }
559   - if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) {
  557 + if (((CheckResponse) a).getModified().before(((CheckResponse) a).getModified())) {
560 558 return 1;
561 559 }
562 560 return -1;
563 561 }
564 562 });
565 563  
566   - for (CheckResponse check:list) {
  564 + for (CheckResponse check : list) {
567 565 Integer ymd = check.getType();
568 566 if (!keyList.contains(ymd.toString())) {
569 567 keyList.add(ymd.toString());
570 568 }
571 569  
572 570 }
573   - for(CheckResponse check:listt){
574   - String ty=check.getTitle();
575   - if(!listtype.contains(ty)){
  571 + for (CheckResponse check : listt) {
  572 + String ty = check.getTitle();
  573 + if (!listtype.contains(ty)) {
576 574 listtype.add(ty);
577 575 }
578 576 }
579 577  
580 578  
  579 + for (String type : keyList) {
581 580  
  581 + List<CheckType> CheckType = new ArrayList<CheckType>();
582 582  
583   - for(String type:keyList){
584   -
585   - List<CheckType> CheckType=new ArrayList<CheckType>();
586   -
587   - for(String typ:listtype){
588   - List<CheckResponse> result2=new ArrayList<>();
589   - CheckType CheckType1=new CheckType();
  583 + for (String typ : listtype) {
  584 + List<CheckResponse> result2 = new ArrayList<>();
  585 + CheckType CheckType1 = new CheckType();
590 586 //CheckType1.setType(typ);
591   - for(CheckResponse chre:result){
592   - if(type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())){
593   - chre.setTitle(DateUtil.getyyyy_MM_dd(chre.getModified())+" "+chre.getTitle());
  587 + for (CheckResponse chre : result) {
  588 + if (type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())) {
  589 + chre.setTitle(DateUtil.getyyyy_MM_dd(chre.getModified()) + " " + chre.getTitle());
594 590 result2.add(chre);
595 591 //CheckType1.setTypeName(result2);
596 592 //CheckType.add(CheckType1);
597 593 }
598 594  
599 595 }
600   - if(result2.size()>0){
  596 + if (result2.size() > 0) {
601 597 CheckType1.setType(typ);
602 598 CheckType1.setTypeName(result2);
603 599 CheckType.add(CheckType1);
604 600  
605 601  
... ... @@ -606,16 +602,16 @@
606 602 }
607 603  
608 604  
609   - CheckByDate CheckByDate1=new CheckByDate();
610   - if("1".equals(type)){
  605 + CheckByDate CheckByDate1 = new CheckByDate();
  606 + if ("1".equals(type)) {
611 607 CheckByDate1.setTime("检验报告");
612 608 CheckByDate1.setTypes(CheckType);
613 609 CheckByDate.add(CheckByDate1);
614   - }else if("2".equals(type)){
  610 + } else if ("2".equals(type)) {
615 611 CheckByDate1.setTime("影像报告");
616 612 CheckByDate1.setTypes(CheckType);
617 613 CheckByDate.add(CheckByDate1);
618   - }else{
  614 + } else {
619 615 CheckByDate1.setTime("其它报告");
620 616 CheckByDate1.setTypes(CheckType);
621 617 CheckByDate.add(CheckByDate1);
622 618  
623 619  
624 620  
625 621  
626 622  
... ... @@ -623,41 +619,33 @@
623 619  
624 620 }
625 621  
626   - for(String typ:listtype){
  622 + for (String typ : listtype) {
627 623  
628 624  
629 625 }
630 626  
631 627  
632   -
633   -
634   -
635 628 return CheckByDate;
636 629 }
637 630  
638 631 }
639 632  
640 633  
641   -
642   -
643   -
644   -
645   -
646 634 public static List<CheckResponse> queryLisCheckList(String cardNo) {
647 635 List<CheckResponse> result = new ArrayList<>();
648 636 if (StringUtils.isNotBlank(cardNo)) {
649 637 Connection conn = ConnTools.makeLisConnection();
650 638 QueryRunner queryRunner = new QueryRunner(true);
651 639 try {
652   - String sql = "select top 10000 baogaoleibiemingcheng as classifyName,huanzhexingming as name,shenqinghao as hospitalId,bingrenid as patientFid,zhuyuanhao as patientHid,kahao as vcCardNo,huanzhexingming as name,xingbie as sex,nianling as age,shenqingkeshidaima as deptCode,shenqingkeshimingcheng as deptName,shenqingyishengdaima as applyDoctorCode,shenqingyishengmingcheng as applyDoctorName,jianchayishengdaima as checkDoctorCode,jianchayishengxingming as checkDoctorName,baogaofabushijian as publishTime from valllist_ex_en where kahao ='"+cardNo+"' order by shenqinghao desc";
  640 + String sql = "select top 10000 baogaoleibiemingcheng as classifyName,huanzhexingming as name,shenqinghao as hospitalId,bingrenid as patientFid,zhuyuanhao as patientHid,kahao as vcCardNo,huanzhexingming as name,xingbie as sex,nianling as age,shenqingkeshidaima as deptCode,shenqingkeshimingcheng as deptName,shenqingyishengdaima as applyDoctorCode,shenqingyishengmingcheng as applyDoctorName,jianchayishengdaima as checkDoctorCode,jianchayishengxingming as checkDoctorName,baogaofabushijian as publishTime from valllist_ex_en where kahao ='" + cardNo + "' order by shenqinghao desc";
653 641 String subSql = "select top 1000 sheqingdanhao as id,xiangmudaima as code,xiangmumingcheng as name,xiangmujieguo as result,zifujieguo as charResult,shuzijieguo as numberResult,gaodibiaozhi as flag,cankaozhi as ref,danwei as unit,jieguoleixing as result from valresult_ex_en where sheqingdanhao='";
654 642 List<LisReport> lisReportList = queryRunner.query(conn, sql, new BeanListHandler<LisReport>(LisReport.class));
655 643 List<LisCheckInfo> list = new ArrayList<>();
656 644 if (lisReportList.size() > 0) {
657   - for (LisReport lisReport:lisReportList) {
  645 + for (LisReport lisReport : lisReportList) {
658 646 // hospitalId为申请号
659 647 if (StringUtils.isNotBlank(lisReport.getHospitalId())) {
660   - List<LisReportItem> lisReportItemList = queryRunner.query(conn, subSql+lisReport.getHospitalId()+"'", new BeanListHandler<LisReportItem>(LisReportItem.class));
  648 + List<LisReportItem> lisReportItemList = queryRunner.query(conn, subSql + lisReport.getHospitalId() + "'", new BeanListHandler<LisReportItem>(LisReportItem.class));
661 649 if (lisReportItemList != null && lisReportItemList.size() > 0) {
662 650 CheckResponse check = new CheckResponse();
663 651 check.setModified(lisReport.getPublishTime());
... ... @@ -675,7 +663,7 @@
675 663 check.setSex(lisReport.getSex());
676 664 List<CheckItemResponse> itemList = new ArrayList<>();
677 665 check.setItemList(itemList);
678   - for (LisReportItem checkItem:lisReportItemList) {
  666 + for (LisReportItem checkItem : lisReportItemList) {
679 667 CheckItemResponse item = new CheckItemResponse();
680 668 item.setName(checkItem.getName());
681 669 item.setCode(checkItem.getCode());
682 670  
... ... @@ -708,10 +696,10 @@
708 696 return result;
709 697 }
710 698  
711   - public List<LisReportModel> queryQhdCheckLisInfo(String vcCardNo,String phone,String titles,String checkTime) {
  699 + public List<LisReportModel> queryQhdCheckLisInfo(String vcCardNo, String phone, String titles, String checkTime) {
712 700 System.out.println("checktime = " + checkTime);
713   - String startDate = DateUtil.getyyyy_MM_dd(DateUtil.parseYMD(checkTime))+" 00:00:00";
714   - String endDate = DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.parseYMD(checkTime),2))+" 00:00:00";
  701 + String startDate = DateUtil.getyyyy_MM_dd(DateUtil.parseYMD(checkTime)) + " 00:00:00";
  702 + String endDate = DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.parseYMD(checkTime), 2)) + " 00:00:00";
715 703  
716 704 List<LisReportModel> result = new ArrayList<>();
717 705 Connection conn = ConnTools.makeLisConnection();
... ... @@ -736,10 +724,10 @@
736 724 + " baogaofabushijian as modified, "
737 725 + " baogaofabushijian as created, "
738 726 + " phone as phone "
739   - + " from valllist_ex_en where kahao = '"+vcCardNo+"' "
740   - + " and baogaofabushijian >= CONVERT(DATETIME,'" + startDate +"', 120) "
741   - + " and baogaofabushijian <= CONVERT(DATETIME,'" + endDate +"', 120) "
742   - + " and baogaoleibiemingcheng in "+ titles + " order by baogaofabushijian desc ";
  727 + + " from valllist_ex_en where kahao = '" + vcCardNo + "' "
  728 + + " and baogaofabushijian >= CONVERT(DATETIME,'" + startDate + "', 120) "
  729 + + " and baogaofabushijian <= CONVERT(DATETIME,'" + endDate + "', 120) "
  730 + + " and baogaoleibiemingcheng in " + titles + " order by baogaofabushijian desc ";
743 731 String subSql = " select "
744 732 + " sheqingdanhao as lisId, "
745 733 + " xiangmudaima as code, "
... ... @@ -760,7 +748,7 @@
760 748 for (LisReportModel lisReport : lisReportList) {
761 749 if (StringUtils.isNotBlank(lisReport.getLisId())) {
762 750 List<LisReportItemModel> lisReportItemList =
763   - queryRunner.query(conn, subSql+lisReport.getLisId()+"'",
  751 + queryRunner.query(conn, subSql + lisReport.getLisId() + "'",
764 752 new BeanListHandler<LisReportItemModel>(LisReportItemModel.class));
765 753 if (CollectionUtils.isNotEmpty(lisReportItemList)) {
766 754 System.out.println("items = " + lisReportItemList.size());
767 755  
768 756  
... ... @@ -773,18 +761,17 @@
773 761 } catch (SQLException e) {
774 762 e.printStackTrace();
775 763 return result;
776   - }finally {
  764 + } finally {
777 765 DbUtils.closeQuietly(conn);
778 766 }
779 767 }
780 768 return result;
781 769 }
782 770  
783   - public List<Map<String,Object>> getPatientInfoList(String cardNo){
784   - List<Map<String,Object>> result = new ArrayList<>();
  771 + public List<Map<String, Object>> getPatientInfoList(String cardNo) {
  772 + List<Map<String, Object>> result = new ArrayList<>();
785 773  
786 774  
787   -
788 775 if (StringUtils.isNotBlank(cardNo)) {
789 776 long start = System.currentTimeMillis();
790 777  
791 778  
... ... @@ -795,10 +782,10 @@
795 782  
796 783 System.out.println("times3 = " + (end - start));
797 784 try {
798   - List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 patid as P_ID,hzxm as P_NAME, sex as P_SEX, birth as BIRTH, sfzh as P_CARDNO, lxdh as P_MOBILEPHONE from SF_BRXXK where cardno= '"+cardNo+"'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class));
  785 + List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 patid as P_ID,hzxm as P_NAME, sex as P_SEX, birth as BIRTH, sfzh as P_CARDNO, lxdh as P_MOBILEPHONE from SF_BRXXK where cardno= '" + cardNo + "'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class));
799 786 if (list.size() > 0) {
800   - for (PregPatientinfo info:list) {
801   - Map<String,Object> map = new HashMap<>();
  787 + for (PregPatientinfo info : list) {
  788 + Map<String, Object> map = new HashMap<>();
802 789 map.put("bhnum", info.getP_BHNUM());
803 790 if ("男".equals(info.getP_SEX())) {
804 791 map.put("sex", "男");
... ... @@ -818,7 +805,7 @@
818 805 DbUtils.closeQuietly(conn);
819 806 } catch (SQLException e) {
820 807 DbUtils.closeQuietly(conn);
821   - ExceptionUtils.catchException(e,"qhd his exception ");
  808 + ExceptionUtils.catchException(e, "qhd his exception ");
822 809 e.printStackTrace();
823 810 }
824 811 }
825 812  
... ... @@ -838,9 +825,9 @@
838 825 }
839 826 }
840 827  
841   - public Map<String,Object> queryHisBabyDiagnosis(String blNo) {
  828 + public Map<String, Object> queryHisBabyDiagnosis(String blNo) {
842 829  
843   - Map<String,Object> map = new HashMap<>();
  830 + Map<String, Object> map = new HashMap<>();
844 831 StringBuffer sb = new StringBuffer();
845 832 if (StringUtils.isNotBlank(blNo)) {
846 833 Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeFmConnection();
847 834  
848 835  
... ... @@ -848,22 +835,18 @@
848 835  
849 836 try {
850 837 // List<DiagnosisInfo> list = queryRunner.query(conn, "select cyzdmc as diagnosisItem from ZY_BRSYK where blh= '"+blNo+"'", new BeanListHandler<DiagnosisInfo>(DiagnosisInfo.class));
851   - List<DiagnosisInfo> list = queryRunner.query(conn, "select ZDMC as diagnosisItem from JHMK_BRZDQK where ZYHM = '"+blNo+"'", new BeanListHandler<DiagnosisInfo>(DiagnosisInfo.class));
  838 + List<DiagnosisInfo> list = queryRunner.query(conn, "select ZDMC as diagnosisItem from JHMK_BRZDQK where ZYHM = '" + blNo + "'", new BeanListHandler<DiagnosisInfo>(DiagnosisInfo.class));
852 839 if (CollectionUtils.isNotEmpty(list)) {
853 840 // for (DiagnosisInfo info:list) {
854 841 // map.put("diagnosisItem", info.getDiagnosisItem());
855 842 // break;
856 843 // }
857 844  
858   - for (int i = 0 ; i < list.size() ; i++)
859   - {
860   - if (i < list.size() -1)
861   - {
  845 + for (int i = 0; i < list.size(); i++) {
  846 + if (i < list.size() - 1) {
862 847 sb.append(list.get(i).getDiagnosisItem());
863 848 sb.append(", ");
864   - }
865   - else
866   - {
  849 + } else {
867 850 sb.append(list.get(i).getDiagnosisItem());
868 851 }
869 852 }
... ... @@ -877,5 +860,101 @@
877 860 map.put("diagnosisItem", sb.toString());
878 861 return map;
879 862 }
  863 +
  864 + public List<Map<String, Object>> getBabyDiacrisis(String startDischargeDate, String endDischargeDate,
  865 + String startBirthDate, String endBirthDate,
  866 + String hospitalizationNo, String babyName,
  867 + Integer finalDiagnosis, Integer page, Integer limit) {
  868 + List<Map<String, Object>> result = new ArrayList<>();
  869 + String startDate = startDischargeDate + " 00:00:00";
  870 + String endDate = endDischargeDate + " 00:00:00";
  871 + int startPage = 1;
  872 + int endlimit = 10;
  873 + if (null != page && null != limit) {
  874 + if (page == 1) {
  875 + startPage = 1;
  876 + endlimit = limit;
  877 + } else {
  878 + startPage = (page - 1) * 10 + 1;
  879 + endlimit = startPage + limit - 1;
  880 + }
  881 + }
  882 +
  883 + long start = System.currentTimeMillis();
  884 +
  885 + /* Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeHisConnection();
  886 + QueryRunner queryRunner = new QueryRunner();
  887 + */
  888 + long end = System.currentTimeMillis();
  889 + System.out.println("times3 = " + (end - start));
  890 + //try {
  891 + String sql = "";
  892 + String hospitalizationNoSql = "";
  893 + String babyNameSql = "";
  894 + String finalDiagnosisSql = "";
  895 + String dischargeDateSql = "";
  896 + String birthDateSql = "";
  897 + if (StringUtils.isNotEmpty(hospitalizationNo) || StringUtils.isNotEmpty(startDischargeDate) || StringUtils.isNotEmpty(endDischargeDate)
  898 + || StringUtils.isNotEmpty(babyName) || null != finalDiagnosis || StringUtils.isNotEmpty(startBirthDate) || StringUtils.isNotEmpty(endBirthDate)) {
  899 + if (StringUtils.isNotEmpty(hospitalizationNo)) {
  900 + hospitalizationNoSql = " and blh= " + "'" + hospitalizationNo + "'";
  901 + }
  902 + if (StringUtils.isNotEmpty(babyName)) {
  903 + babyNameSql = " and hzxm= " + "'" + babyName + "'";
  904 + }
  905 + if (null != finalDiagnosis) {
  906 + finalDiagnosisSql = " and cyzddm like " + "'" + finalDiagnosis + "%" + "'";
  907 + }
  908 + if (StringUtils.isNotEmpty(startBirthDate) && StringUtils.isNotEmpty(endBirthDate)) {
  909 + birthDateSql = " and birth >= CONVERT(varchar(100),'" + startBirthDate + "', 112) and birth <= CONVERT(varchar(100),'" + endBirthDate + "', 112)";
  910 + }
  911 + if (StringUtils.isNotEmpty(startDischargeDate) && StringUtils.isNotEmpty(endDischargeDate)) {
  912 + dischargeDateSql = " and cyrq >= CONVERT(varchar(100),'" + startDate + "', 120) and cyrq <= CONVERT(varchar(100),'" + endDate + "', 120)";
  913 + }
  914 + sql = hospitalizationNoSql + babyNameSql + finalDiagnosisSql + dischargeDateSql + birthDateSql;
  915 + }
  916 + System.out.println("select * from (select top 99999999 ROW_NUMBER() OVER(ORDER BY lrrq DESC ) " +
  917 + "AS ROWID,blh,cyrq,hzxm,sex,birth,cyzdmc from VW_LYMS_XSE_BRSYK where cyrq is not null " + sql + ") " +
  918 + "AS TEMP where ROWID BETWEEN " + startPage + " and " + endlimit + " order by ROWID Asc");
  919 +
  920 +
  921 + Map<String, Object> map = new HashMap<>();
  922 + map.put("dischargeDate", "20190524");
  923 + map.put("babyName", "陈晨");
  924 + map.put("sex", "女");
  925 + map.put("birth", "20190404");
  926 + map.put("monthAge", "2月2天");
  927 + map.put("hospitalizationNo", "123456");
  928 + map.put("dischargeDiagnosis", "新生儿肺炎");
  929 + result.add(map);
  930 +
  931 + /*List<BabyDischargeDiagnosisModel> list = queryRunner.query(conn, "select * from (select top 99999999 ROW_NUMBER() OVER(ORDER BY lrrq DESC ) " +
  932 + "AS ROWID,blh,cyrq,hzxm,sex,birth,cyzdmc from VW_LYMS_XSE_BRSYK where cyrq is not null " + sql + ") " +
  933 + "AS TEMP where ROWID BETWEEN " + startPage + " and " + endlimit + " order by ROWID Asc", new BeanListHandler<BabyDischargeDiagnosisModel>(BabyDischargeDiagnosisModel.class));
  934 + if (list.size() > 0) {
  935 + for (BabyDischargeDiagnosisModel info : list) {
  936 + Map<String, Object> map = new HashMap<>();
  937 + map.put("dischargeDate", DateUtil.getyyyy_MM_dd(info.getCyrq()));
  938 + map.put("babyName", info.getHzxm());
  939 + map.put("sex", info.getSex());
  940 + map.put("birth", info.getBirth());
  941 + map.put("monthAge", "");
  942 + map.put("hospitalizationNo", info.getBlh());
  943 + map.put("dischargeDiagnosis", info.getCyzdmc());
  944 + result.add(map);
  945 + }
  946 + }*/
  947 + long end1 = System.currentTimeMillis();
  948 + System.out.println("times4 = " + (end1 - end));
  949 + //DbUtils.closeQuietly(conn);
  950 + /*} catch (SQLException e) {
  951 + DbUtils.closeQuietly(conn);
  952 + ExceptionUtils.catchException(e, "qhd his exception ");
  953 + e.printStackTrace();
  954 +
  955 + }*/
  956 + return result;
  957 + }
  958 +
880 959 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java View file @ 3150078
... ... @@ -2,6 +2,7 @@
2 2  
3 3  
4 4 import com.aspose.words.*;
  5 +import com.google.inject.spi.Toolable;
5 6 import com.lyms.platform.common.annotation.TokenRequired;
6 7 import com.lyms.platform.common.base.BaseController;
7 8 import com.lyms.platform.common.base.LoginContext;
8 9  
9 10  
... ... @@ -100,19 +101,20 @@
100 101 @RequestMapping(value = "/queryBabyBuildById/{id}", method = RequestMethod.GET)
101 102 @ResponseBody
102 103 public BaseObjectResponse queryBabyBuildById(@PathVariable("id") String id) {
103   - return babyBookbuildingFacade.queryBabyBuildById(id,true);
  104 + return babyBookbuildingFacade.queryBabyBuildById(id, true);
104 105 }
105 106  
106 107  
107 108 /**
108 109 * 预建档查询
  110 + *
109 111 * @param id
110 112 * @return
111 113 */
112 114 @RequestMapping(value = "/queryBabyTempBuildById/{id}", method = RequestMethod.GET)
113 115 @ResponseBody
114 116 public BaseObjectResponse queryBabyTempBuildById(@PathVariable("id") String id) {
115   - return babyBookbuildingFacade.queryBabyTempBuildById(id,false);
  117 + return babyBookbuildingFacade.queryBabyTempBuildById(id, false);
116 118 }
117 119  
118 120  
... ... @@ -542,6 +544,28 @@
542 544 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
543 545 return babyBookbuildingFacade.queryWcBabyReport(loginState.getId(), time, ageType, lievType, provinceId, cityId);
544 546 }
  547 +
  548 + /**
  549 + * 秦皇岛儿童出院诊断查询
  550 + */
  551 +
  552 + @ResponseBody
  553 + @RequestMapping(value = "/getBabyLeaveHospitalDiacrisis", method = RequestMethod.GET)
  554 + @TokenRequired
  555 + public BaseResponse getBabyLeaveHospitaiacrisis(HttpServletRequest request, HttpServletResponse response,
  556 + @RequestParam(value = "startDischargeDate", required = false) String startDischargeDate,
  557 + @RequestParam(value = "endDischargeDate", required = false) String endDischargeDate,
  558 + @RequestParam(value = "startBirthDate", required = false) String startBirthDate,
  559 + @RequestParam(value = "endBirthDate", required = false) String endBirthDate,
  560 + @RequestParam(value = "hospitalizationNo", required = false) String hospitalizationNo,
  561 + @RequestParam(value = "babyName", required = false) String babyName,
  562 + @RequestParam(value = "finalDiagnosis", required = false) Integer finalDiagnosis,
  563 + @RequestParam("page") Integer page,
  564 + @RequestParam("limit") Integer limit) {
  565 +
  566 + return babyBookbuildingFacade.getBabyDiacrisis(startDischargeDate, endDischargeDate, startBirthDate, endBirthDate, hospitalizationNo, babyName, finalDiagnosis, page, limit);
  567 + }
  568 +
545 569  
546 570 /**
547 571 * 获取可以导出的医院列表
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 3150078
... ... @@ -4030,5 +4030,23 @@
4030 4030 public BaseObjectResponse queryBabyTempBuildById(String id, boolean isBuild) {
4031 4031 return queryBabyBuildById(id, isBuild);
4032 4032 }
  4033 +
  4034 +
  4035 + public BaseListResponse getBabyDiacrisis(String startDischargeDate, String endDischargeDate,
  4036 + String startBirthDate, String endBirthDate,
  4037 + String hospitalizationNo, String babyName,
  4038 + Integer finalDiagnosis, Integer page, Integer limit) {
  4039 +
  4040 + List list = qhdfyHisService.getBabyDiacrisis(startDischargeDate, endDischargeDate, startBirthDate, endBirthDate, hospitalizationNo, babyName, finalDiagnosis, page, limit);
  4041 + BaseListResponse objectResponse = new BaseListResponse();
  4042 + //objectResponse.setPageInfo();
  4043 + objectResponse.setData(list);
  4044 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  4045 + objectResponse.setErrormsg("成功");
  4046 + return objectResponse;
  4047 +
  4048 + }
  4049 +
  4050 +
4033 4051 }