Commit 7b0466492a875946ea643e42b9a3e311f0ae4366
1 parent
0446d4c3ce
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 52 additions and 39 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java
View file @
7b04664
... | ... | @@ -137,6 +137,17 @@ |
137 | 137 | // |
138 | 138 | private boolean printing; |
139 | 139 | |
140 | + //高危风险id | |
141 | + private List<String> riskFactorId; | |
142 | + | |
143 | + public List<String> getRiskFactorId() { | |
144 | + return riskFactorId; | |
145 | + } | |
146 | + | |
147 | + public void setRiskFactorId(List<String> riskFactorId) { | |
148 | + this.riskFactorId = riskFactorId; | |
149 | + } | |
150 | + | |
140 | 151 | public boolean isPrinting() { |
141 | 152 | return printing; |
142 | 153 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java
View file @
7b04664
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | |
39 | 39 | @Autowired |
40 | 40 | private CommonService commonService; |
41 | - private static final int BATCH_SIZE = 40; | |
41 | + private static final int BATCH_SIZE = 20; | |
42 | 42 | /** |
43 | 43 | * 同步孕妇 |
44 | 44 | */ |
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | |
49 | 49 | |
50 | 50 | int pageStart = 1; |
51 | - int pageEnd = 400; | |
51 | + int pageEnd = 100; | |
52 | 52 | |
53 | 53 | |
54 | 54 | do { |
55 | 55 | |
... | ... | @@ -82,12 +82,12 @@ |
82 | 82 | List<Map<String, Object>> tempList = list.subList(i, end); |
83 | 83 | commonThreadPool.execute(new PatientWorker(countDownLatch,tempList, mongoTemplate)); |
84 | 84 | } |
85 | - pageStart += 400; | |
86 | - pageEnd += 400; | |
85 | + pageStart += 100; | |
86 | + pageEnd += 100; | |
87 | 87 | |
88 | 88 | try { |
89 | 89 | countDownLatch.await(20, TimeUnit.SECONDS); |
90 | - Thread.sleep(5000); | |
90 | + Thread.sleep(10000); | |
91 | 91 | } catch (InterruptedException e) { |
92 | 92 | } |
93 | 93 | }while (true); |
... | ... | @@ -158,6 +158,7 @@ |
158 | 158 | { |
159 | 159 | e.printStackTrace(); |
160 | 160 | System.out.println("分娩孕周计算末次月经错误"); |
161 | + ExceptionUtils.catchException(e,"分娩孕周计算末次月经错误"); | |
161 | 162 | return; |
162 | 163 | } |
163 | 164 | |
... | ... | @@ -173,7 +174,7 @@ |
173 | 174 | map.put("P_LASTMENSTRUALPERIOD",lastmenstrualperiod); |
174 | 175 | } |
175 | 176 | |
176 | - Date dueDate = DateUtil.addDay(DateUtil.addMonth(HsDataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), 9), 7); //280 天 | |
177 | + Date dueDate = DateUtil.addDay(HsDataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), 280); //280 天 | |
177 | 178 | patients.setDueDate(dueDate); |
178 | 179 | |
179 | 180 | patients.setBuildDays(DateUtil.getDays(HsDataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), HsDataUtil.getDate(map.get("P_FILINGTIME")))); |
... | ... | @@ -481,7 +482,6 @@ |
481 | 482 | //分娩孕妇处理 |
482 | 483 | if ( CollectionUtils.isNotEmpty(chanList)) { |
483 | 484 | if (CollectionUtils.isNotEmpty(chanList)) { |
484 | - System.out.println("============"+chanList.size()); | |
485 | 485 | //分娩记录 |
486 | 486 | Map<String, Object> fmMap = chanList.get(0); |
487 | 487 | Date fmDate = HsDataUtil.getDate(fmMap.get("PDR_CHILDBIRTHDAY")); |
... | ... | @@ -519,18 +519,6 @@ |
519 | 519 | |
520 | 520 | patients.setType(type); //患者类型 |
521 | 521 | |
522 | - | |
523 | - /** | |
524 | - * 初诊数据处理 | |
525 | - */ | |
526 | - List<Map<String, Object>> chuList = null; | |
527 | - if (StringUtils.isNotEmpty(HsDataUtil.getString(map.get("P_NO")))) { | |
528 | - chuList = JDBCUtil.getOracleListDataBySql("SELECT * FROM MOMMY_FIRSTEXAMINE WHERE FE_TRIAGEORDERNO= '" + HsDataUtil.getString(map.get("P_NO")) + "'"); | |
529 | - | |
530 | - createCZ(chuList,patients); | |
531 | - } | |
532 | - | |
533 | - | |
534 | 522 | PersonModel dbPerson = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(HsDataUtil.getString(map.get("P_CARDNO"))).and("yn").is(1).and("type").ne(2)), PersonModel.class); |
535 | 523 | if (dbPerson != null && type != dbPerson.getType()) |
536 | 524 | { |
537 | 525 | |
538 | 526 | |
539 | 527 | |
540 | 528 | |
... | ... | @@ -557,22 +545,26 @@ |
557 | 545 | dbPerson = person; |
558 | 546 | } |
559 | 547 | |
560 | - | |
561 | - | |
562 | 548 | patients.setPid(dbPerson.getId()); |
563 | - | |
549 | + /** | |
550 | + * 初诊数据处理 | |
551 | + */ | |
552 | + if (StringUtils.isNotEmpty(HsDataUtil.getString(map.get("P_NO")))) { | |
553 | + String sql = "SELECT * FROM MOMMY_FIRSTEXAMINE WHERE FE_TRIAGEORDERNO= '" + HsDataUtil.getString(map.get("P_NO")) + "'"; | |
554 | + List<Map<String, Object>> chuList = JDBCUtil.getOracleListDataBySql(sql); | |
555 | + createCZ(chuList, patients); | |
556 | + } | |
564 | 557 | mongoTemplate.save(patients); |
565 | 558 | System.out.println("建档创建完成==="+patients.getId()); |
566 | 559 | |
567 | 560 | } |
568 | 561 | |
569 | - private Map createCZ(List<Map<String, Object>> chuList,Patients patients) { | |
570 | - Map data = null; | |
562 | + private void createCZ(List<Map<String, Object>> chuList,Patients patients) { | |
571 | 563 | try { |
572 | 564 | if (CollectionUtils.isNotEmpty(chuList)) |
573 | 565 | { |
574 | - data = new HashMap(); | |
575 | 566 | |
567 | + System.out.println("createCZ============"); | |
576 | 568 | Map<String, Object> cmap = chuList.get(0); |
577 | 569 | |
578 | 570 | AntExChuModel antExChuModel = new AntExChuModel(); |
579 | 571 | |
580 | 572 | |
... | ... | @@ -628,10 +620,11 @@ |
628 | 620 | } |
629 | 621 | }catch (Exception e) |
630 | 622 | { |
623 | + ExceptionUtils.catchException(e,"初诊同步异常"); | |
631 | 624 | e.printStackTrace(); |
632 | 625 | System.out.println(e.getMessage()); |
626 | + | |
633 | 627 | } |
634 | - return data; | |
635 | 628 | } |
636 | 629 | |
637 | 630 | |
... | ... | @@ -653,19 +646,19 @@ |
653 | 646 | antExRecordModel.setNextCheckTime(antExChuModel.getNextCheckTime()); |
654 | 647 | antExRecordModel.setFirst(antExChuModel.getFirst()); |
655 | 648 | |
656 | - //高危信息 | |
657 | - List li = null; | |
658 | - try { | |
659 | - li = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
660 | - } catch (Exception e) { | |
661 | - } | |
662 | - antExRecordModel.sethScore(0); | |
663 | - if (null != li) { | |
664 | - antExRecordModel.sethRisk(li); | |
665 | - Map result = commonService.calculateRiskScore(li); | |
666 | - antExRecordModel.sethScore((Integer) result.get("score")); | |
667 | - antExRecordModel.sethLevel((List) result.get("levelList")); | |
668 | - } | |
649 | +// //高危信息 | |
650 | +// List li = null; | |
651 | +// try { | |
652 | +// li = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
653 | +// } catch (Exception e) { | |
654 | +// } | |
655 | +// antExRecordModel.sethScore(0); | |
656 | +// if (null != li) { | |
657 | +// antExRecordModel.sethRisk(li); | |
658 | +// Map result = commonService.calculateRiskScore(li); | |
659 | +// antExRecordModel.sethScore((Integer) result.get("score")); | |
660 | +// antExRecordModel.sethLevel((List) result.get("levelList")); | |
661 | +// } | |
669 | 662 | |
670 | 663 | if (null != patients) { |
671 | 664 | if (patients.getType() == 1) { |
... | ... | @@ -703,6 +696,7 @@ |
703 | 696 | } |
704 | 697 | }catch (Exception e) |
705 | 698 | { |
699 | + ExceptionUtils.catchException(e, "产检记录同步异常"); | |
706 | 700 | e.printStackTrace(); |
707 | 701 | System.out.println(e.getMessage()); |
708 | 702 | } |
... | ... | @@ -838,6 +832,7 @@ |
838 | 832 | |
839 | 833 | }catch (Exception e) |
840 | 834 | { |
835 | + ExceptionUtils.catchException(e,"分娩同步异常"); | |
841 | 836 | e.printStackTrace(); |
842 | 837 | System.out.println(e.getMessage()); |
843 | 838 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
7b04664
... | ... | @@ -142,6 +142,13 @@ |
142 | 142 | List<String> pids = mongoUtil.getPidsByCondition2(hospitalIds, key, vcCardNo, weekStart, weekEnd, age); |
143 | 143 | criteria.and("pid").in(pids); |
144 | 144 | } |
145 | + | |
146 | + List<String> rids = new ArrayList<>(); | |
147 | + rids.add("5aab6d3d422b03d4ad2bf83e"); | |
148 | + rids.add("5aab6d3e422b03d4ad2bf83f"); | |
149 | + rids.add("de7468e6-1bb5-4fab-ae84-78857868409a"); | |
150 | + criteria.and("riskFactorId").in(rids); | |
151 | + | |
145 | 152 | PageResult pageResult = findMongoPage(BloodSugar.class, Query.query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); |
146 | 153 | List<BloodSugar> bloodSugars = (List<BloodSugar>) pageResult.getGrid(); |
147 | 154 | List<Map<String, Object>> restList = new ArrayList<>(); |