|
@@ -1,15 +1,24 @@
|
|
|
package com.diagbot.facade.his;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.his.HisBehospitalInfo;
|
|
|
import com.diagbot.service.impl.his.HisBehospitalInfoServiceImpl;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.data.ABehospitalInfoVO;
|
|
|
+import com.diagbot.vo.data.HisDataDealVO;
|
|
|
+import com.diagbot.vo.data.HisDataImportVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import io.github.lvyahui8.spring.facade.DataFacade;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class HisBehospitalInfoFacade extends HisBehospitalInfoServiceImpl {
|
|
|
|
|
|
public List<HisBehospitalInfo> getHisBeHospitalInfoData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
|
|
@@ -24,4 +33,40 @@ public class HisBehospitalInfoFacade extends HisBehospitalInfoServiceImpl {
|
|
|
});
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ * @Description:拉取指定病历号,或指定出院时间段内的病历号的所有病历号用户导入历史数据
|
|
|
+ * @Author:liuqq
|
|
|
+ * @time: ${DATE} ${TIME}
|
|
|
+ **/
|
|
|
+ public void getPatientRecord(HisDataImportVO hisDataImportVO){
|
|
|
+ try {
|
|
|
+ QueryWrapper queryWrapper=new QueryWrapper<HisBehospitalInfo>();
|
|
|
+ if(hisDataImportVO.getHospitalId()!=null && hisDataImportVO.getHospitalId()!=0L){
|
|
|
+ queryWrapper.eq("hospital_id", hisDataImportVO.getHospitalId());
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(hisDataImportVO.getBehospitalCode())){
|
|
|
+ queryWrapper.eq("behospital_code", hisDataImportVO.getBehospitalCode());
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(hisDataImportVO.getStartDate()) && StringUtil.isNotEmpty(hisDataImportVO.getEndDate())){
|
|
|
+ queryWrapper.gt("LEAVE_HOSPITAL_DATE",hisDataImportVO.getStartDate());
|
|
|
+ queryWrapper.lt("LEAVE_HOSPITAL_DATE",hisDataImportVO.getEndDate());
|
|
|
+ }
|
|
|
+ List<HisBehospitalInfo> list=this.baseMapper.selectList(queryWrapper);
|
|
|
+ if(list.size()>0){
|
|
|
+ List<ABehospitalInfoVO> aList=Lists.newLinkedList();
|
|
|
+ list.stream().forEach(s->{
|
|
|
+ ABehospitalInfoVO aBehospitalInfoVO=new ABehospitalInfoVO();
|
|
|
+ aBehospitalInfoVO.setBehospitalCode(s.getBehospitalCode());
|
|
|
+ aList.add(aBehospitalInfoVO);
|
|
|
+ });
|
|
|
+ Map<String, Object> invokeParams = new HashMap<>();
|
|
|
+ invokeParams.put("aBehospitalInfoVO", list);
|
|
|
+ DataFacade.get("dataSupplement", invokeParams, RespDTO.class);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("导入历史数据异常==========",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|