| | |
| | | package com.ruoyi.datacollection.service.impl; |
| | | |
| | | import com.ruoyi.common.core.service.HisGatherApi; |
| | | import com.ruoyi.datacollection.collect.HisGatherCollectors; |
| | | import com.ruoyi.common.core.service.dto.SltdGatherReq; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.datacollection.service.IHisDataCollectionService; |
| | |
| | | * |
| | | * <h3>它不管什么</h3> |
| | | * 真正的采集动作(HTTP 取数、入库)不在本类:那里仍在 smartor,经 |
| | | * {@link HisGatherApi} 契约调用,后续分批搬进本模块。 |
| | | * {@link HisGatherCollectors} 契约调用,后续分批搬进本模块。 |
| | | * |
| | | * @see com.ruoyi.datacollection.api.DataCollectionFacade 对外门面 |
| | | */ |
| | |
| | | * 这里让它启动期就暴露(宁可启动失败,也不要静默少数据)。 |
| | | */ |
| | | @Autowired |
| | | private HisGatherApi hisGatherApi; |
| | | private HisGatherCollectors hisGatherCollectors; |
| | | |
| | | /** |
| | | * 参数配置服务(ruoyi-system 的 API):读 {@code sltd.gather.sysuser} / {@code sltd.gather.campusid} |
| | |
| | | try { |
| | | // 采集入院数据 |
| | | log.info("【dealHisData】新华开始采集入院数据"); |
| | | hisGatherApi.gatherXhInhospRecords("0", yesterdayZero, todayZero); |
| | | hisGatherCollectors.gatherXhInhospRecords("0", yesterdayZero, todayZero); |
| | | log.info("【dealHisData】新华入院数据采集完成"); |
| | | |
| | | // 采集出院数据 |
| | | log.info("【dealHisData】新华开始采集出院数据"); |
| | | hisGatherApi.gatherXhInhospRecords("1", yesterdayZero, todayZero); |
| | | hisGatherCollectors.gatherXhInhospRecords("1", yesterdayZero, todayZero); |
| | | log.info("【dealHisData】新华出院数据采集完成"); |
| | | |
| | | } catch (Exception e) { |
| | |
| | | Date startTime = Date.from(yesterdayZero.atZone(ZoneId.systemDefault()).toInstant()); |
| | | Date endTime = Date.from(todayZero.atZone(ZoneId.systemDefault()).toInstant()); |
| | | |
| | | hisGatherApi.gatherHnRecords(startTime, endTime); |
| | | hisGatherCollectors.gatherHnRecords(startTime, endTime); |
| | | log.info("【dealHisData】河南结束采集数据"); |
| | | } catch (Exception e) { |
| | | log.error("【dealHisData】河南数据采集异常", e); |
| | |
| | | SltdGatherReq serviceSLTDDeptReqVO = new SltdGatherReq(); |
| | | serviceSLTDDeptReqVO.setOrgId(SLTD_ORG_ID); |
| | | serviceSLTDDeptReqVO.setCampusIds(campusidList); |
| | | Boolean aBoolean1 = hisGatherApi.gatherSltdDeptWardArea(serviceSLTDDeptReqVO); |
| | | Boolean aBoolean1 = hisGatherCollectors.gatherSltdDeptWardArea(serviceSLTDDeptReqVO); |
| | | log.info("【dealHisData】省立同德“部门信息”结束采集数据:{}", aBoolean1); |
| | | |
| | | Boolean aBoolean = false; |
| | |
| | | ArrayList<String> statusList = new ArrayList<>(); |
| | | statusList.add("1"); |
| | | reqVO.setStatusList(statusList); |
| | | aBoolean = hisGatherApi.gatherSltdHospUser(reqVO); |
| | | aBoolean = hisGatherCollectors.gatherSltdHospUser(reqVO); |
| | | } |
| | | log.info("【dealHisData】省立同德“用户信息”结束采集数据:{}", aBoolean); |
| | | //疾病字典采集 |
| | | hisGatherApi.gatherIcd10(); |
| | | hisGatherCollectors.gatherIcd10(); |
| | | } |
| | | |
| | | // nhfy/sltd回溯30天分段采集判断(每段最多 BACKFILL_SEGMENT_DAYS 天,触顶自动二分) |
| | |
| | | |
| | | int count; |
| | | try { |
| | | count = hisGatherApi.gatherSltdHealthcareRecords(req); |
| | | count = hisGatherCollectors.gatherSltdHealthcareRecords(req); |
| | | } catch (Exception e) { |
| | | // 单类数据失败不向上抛:否则一段失败会让本次回溯后面的所有段都不执行 |
| | | log.error("【dealHisData】{}采集失败,跳过该类继续。院区:{},时间段:{} ~ {}", kind.label, cid, from, to, e); |