diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java b/platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java index 58b30ae..1deafec 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java @@ -137,6 +137,17 @@ public class PatientWeight extends BaseModel { // private boolean printing; + //高危风险id + private List riskFactorId; + + public List getRiskFactorId() { + return riskFactorId; + } + + public void setRiskFactorId(List riskFactorId) { + this.riskFactorId = riskFactorId; + } + public boolean isPrinting() { return printing; } diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java index 72b6192..3e3661c 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java @@ -38,7 +38,7 @@ public class SyncHsPatientService { @Autowired private CommonService commonService; - private static final int BATCH_SIZE = 40; + private static final int BATCH_SIZE = 20; /** * 同步孕妇 */ @@ -48,7 +48,7 @@ public class SyncHsPatientService { int pageStart = 1; - int pageEnd = 400; + int pageEnd = 100; do { @@ -82,12 +82,12 @@ public class SyncHsPatientService { List> tempList = list.subList(i, end); commonThreadPool.execute(new PatientWorker(countDownLatch,tempList, mongoTemplate)); } - pageStart += 400; - pageEnd += 400; + pageStart += 100; + pageEnd += 100; try { countDownLatch.await(20, TimeUnit.SECONDS); - Thread.sleep(5000); + Thread.sleep(10000); } catch (InterruptedException e) { } }while (true); @@ -158,6 +158,7 @@ public class SyncHsPatientService { { e.printStackTrace(); System.out.println("分娩孕周计算末次月经错误"); + ExceptionUtils.catchException(e,"分娩孕周计算末次月经错误"); return; } @@ -173,7 +174,7 @@ public class SyncHsPatientService { map.put("P_LASTMENSTRUALPERIOD",lastmenstrualperiod); } - Date dueDate = DateUtil.addDay(DateUtil.addMonth(HsDataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), 9), 7); //280 天 + Date dueDate = DateUtil.addDay(HsDataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), 280); //280 天 patients.setDueDate(dueDate); patients.setBuildDays(DateUtil.getDays(HsDataUtil.getDate(map.get("P_LASTMENSTRUALPERIOD")), HsDataUtil.getDate(map.get("P_FILINGTIME")))); @@ -481,7 +482,6 @@ public class SyncHsPatientService { //分娩孕妇处理 if ( CollectionUtils.isNotEmpty(chanList)) { if (CollectionUtils.isNotEmpty(chanList)) { - System.out.println("============"+chanList.size()); //分娩记录 Map fmMap = chanList.get(0); Date fmDate = HsDataUtil.getDate(fmMap.get("PDR_CHILDBIRTHDAY")); @@ -519,18 +519,6 @@ public class SyncHsPatientService { patients.setType(type); //患者类型 - - /** - * 初诊数据处理 - */ - List> chuList = null; - if (StringUtils.isNotEmpty(HsDataUtil.getString(map.get("P_NO")))) { - chuList = JDBCUtil.getOracleListDataBySql("SELECT * FROM MOMMY_FIRSTEXAMINE WHERE FE_TRIAGEORDERNO= '" + HsDataUtil.getString(map.get("P_NO")) + "'"); - - createCZ(chuList,patients); - } - - 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); if (dbPerson != null && type != dbPerson.getType()) { @@ -557,22 +545,26 @@ public class SyncHsPatientService { dbPerson = person; } - - patients.setPid(dbPerson.getId()); - + /** + * 初诊数据处理 + */ + if (StringUtils.isNotEmpty(HsDataUtil.getString(map.get("P_NO")))) { + String sql = "SELECT * FROM MOMMY_FIRSTEXAMINE WHERE FE_TRIAGEORDERNO= '" + HsDataUtil.getString(map.get("P_NO")) + "'"; + List> chuList = JDBCUtil.getOracleListDataBySql(sql); + createCZ(chuList, patients); + } mongoTemplate.save(patients); System.out.println("建档创建完成==="+patients.getId()); } - private Map createCZ(List> chuList,Patients patients) { - Map data = null; + private void createCZ(List> chuList,Patients patients) { try { if (CollectionUtils.isNotEmpty(chuList)) { - data = new HashMap(); + System.out.println("createCZ============"); Map cmap = chuList.get(0); AntExChuModel antExChuModel = new AntExChuModel(); @@ -628,10 +620,11 @@ public class SyncHsPatientService { } }catch (Exception e) { + ExceptionUtils.catchException(e,"初诊同步异常"); e.printStackTrace(); System.out.println(e.getMessage()); + } - return data; } @@ -653,19 +646,19 @@ public class SyncHsPatientService { antExRecordModel.setNextCheckTime(antExChuModel.getNextCheckTime()); antExRecordModel.setFirst(antExChuModel.getFirst()); - //高危信息 - List li = null; - try { - li = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); - } catch (Exception e) { - } - antExRecordModel.sethScore(0); - if (null != li) { - antExRecordModel.sethRisk(li); - Map result = commonService.calculateRiskScore(li); - antExRecordModel.sethScore((Integer) result.get("score")); - antExRecordModel.sethLevel((List) result.get("levelList")); - } +// //高危信息 +// List li = null; +// try { +// li = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); +// } catch (Exception e) { +// } +// antExRecordModel.sethScore(0); +// if (null != li) { +// antExRecordModel.sethRisk(li); +// Map result = commonService.calculateRiskScore(li); +// antExRecordModel.sethScore((Integer) result.get("score")); +// antExRecordModel.sethLevel((List) result.get("levelList")); +// } if (null != patients) { if (patients.getType() == 1) { @@ -703,6 +696,7 @@ public class SyncHsPatientService { } }catch (Exception e) { + ExceptionUtils.catchException(e, "产检记录同步异常"); e.printStackTrace(); System.out.println(e.getMessage()); } @@ -838,6 +832,7 @@ public class SyncHsPatientService { }catch (Exception e) { + ExceptionUtils.catchException(e,"分娩同步异常"); e.printStackTrace(); System.out.println(e.getMessage()); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java index e2632e6..b42a3da 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java @@ -142,6 +142,13 @@ public class BloodSugarServiceImpl extends BaseServiceImpl implements IBloodSuga List pids = mongoUtil.getPidsByCondition2(hospitalIds, key, vcCardNo, weekStart, weekEnd, age); criteria.and("pid").in(pids); } + + List rids = new ArrayList<>(); + rids.add("5aab6d3d422b03d4ad2bf83e"); + rids.add("5aab6d3e422b03d4ad2bf83f"); + rids.add("de7468e6-1bb5-4fab-ae84-78857868409a"); + criteria.and("riskFactorId").in(rids); + PageResult pageResult = findMongoPage(BloodSugar.class, Query.query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); List bloodSugars = (List) pageResult.getGrid(); List> restList = new ArrayList<>();