| 
					
				 | 
			
			
				@ -3,12 +3,9 @@ package com.yihu.ehr.crawler.service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.fasterxml.jackson.databind.JsonNode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.fasterxml.jackson.databind.ObjectMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.crawler.model.adapter.AdapterDataSet; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.crawler.model.adapter.AdapterDictEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.crawler.model.config.SysConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.crawler.model.patient.Patient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.constrant.Constants; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.model.DictItem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.model.Result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.util.operator.CollectionUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.util.operator.StringUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.util.springutil.SpringBeanUtil; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -18,6 +15,7 @@ import com.yihu.ehr.standard.model.adapter.AdapterSchemeVersionModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.adapter.AdapterDatasetService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.adapter.AdapterSchemeVersionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.bo.AdapterVersion; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import net.sf.json.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.logging.log4j.LogManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.logging.log4j.Logger; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -71,7 +69,6 @@ public class CrawlerManager { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        message = "本次采集病人共" + totalCount + "条,成功采集信息"+ count + "条"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info(message); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return message; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -116,7 +113,7 @@ public class CrawlerManager { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (!StringUtil.isEmpty(jsonObject.get("data")) && !StringUtil.isEmpty(jsonObject.get("data").get(0))) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (!StringUtil.isEmpty(jsonObject.get("data").get(0).get(SysConfig.getInstance().getRegisterIdCardNo()))) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("注册病人"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            dispatch.register(patient, jsonObject); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            dispatch.register(patient, jsonObject.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -143,13 +140,13 @@ public class CrawlerManager { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Boolean getDataForPrepare() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("适配基本相关数据准备"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (adapterFlg) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("适配基本相关数据准备"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            adapterDataSetMap = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            AdapterVersion adapterVersion = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            AdapterVersion adapterVersion; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            AdapterDatasetService adapterDatasetService = SpringBeanUtil.getService(AdapterDatasetService.BEAN_ID); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<AdapterDatasetModel> adapterDataSetModelList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (!CollectionUtil.isEmpty(datasetList)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -180,6 +177,10 @@ public class CrawlerManager { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    adapterFlg = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map<String, String> condition = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                condition.put("column", "adapter_dataset_code"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject jsonpObject = JSONObject.fromObject(condition); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                adapterDataSetModelList = adapterDatasetService.getAdapterDatasetNotNullList(adapterVersion, jsonpObject.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            /** 
			 |