|
@@ -6,12 +6,14 @@ import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Sets;
|
|
import com.google.common.collect.Sets;
|
|
import com.lantone.qc.dbanaly.facade.changx.CxXmlUtil;
|
|
import com.lantone.qc.dbanaly.facade.changx.CxXmlUtil;
|
|
import com.lantone.qc.dbanaly.facade.taizhou.TzXmlUtil;
|
|
import com.lantone.qc.dbanaly.facade.taizhou.TzXmlUtil;
|
|
|
|
+import com.lantone.qc.dbanaly.lt.entity.Abnormal;
|
|
import com.lantone.qc.dbanaly.lt.entity.BehospitalInfo;
|
|
import com.lantone.qc.dbanaly.lt.entity.BehospitalInfo;
|
|
import com.lantone.qc.dbanaly.lt.entity.MedicalRecord;
|
|
import com.lantone.qc.dbanaly.lt.entity.MedicalRecord;
|
|
import com.lantone.qc.dbanaly.lt.entity.MedicalRecordContent;
|
|
import com.lantone.qc.dbanaly.lt.entity.MedicalRecordContent;
|
|
import com.lantone.qc.dbanaly.lt.entity.RecordAnalyze;
|
|
import com.lantone.qc.dbanaly.lt.entity.RecordAnalyze;
|
|
import com.lantone.qc.dbanaly.lt.entity.RecordAnalyzeDetail;
|
|
import com.lantone.qc.dbanaly.lt.entity.RecordAnalyzeDetail;
|
|
import com.lantone.qc.dbanaly.lt.entity.RecordAnalyzeExample;
|
|
import com.lantone.qc.dbanaly.lt.entity.RecordAnalyzeExample;
|
|
|
|
+import com.lantone.qc.dbanaly.lt.service.impl.AbnormalServiceImpl;
|
|
import com.lantone.qc.dbanaly.lt.service.impl.BehospitalInfoServiceImpl;
|
|
import com.lantone.qc.dbanaly.lt.service.impl.BehospitalInfoServiceImpl;
|
|
import com.lantone.qc.dbanaly.lt.service.impl.MedicalRecordContentServiceImpl;
|
|
import com.lantone.qc.dbanaly.lt.service.impl.MedicalRecordContentServiceImpl;
|
|
import com.lantone.qc.dbanaly.lt.service.impl.MedicalRecordServiceImpl;
|
|
import com.lantone.qc.dbanaly.lt.service.impl.MedicalRecordServiceImpl;
|
|
@@ -58,6 +60,9 @@ public class XmlDataAnalysisFacade {
|
|
@Autowired
|
|
@Autowired
|
|
@Qualifier("recordAnalyzeExampleServiceImpl")
|
|
@Qualifier("recordAnalyzeExampleServiceImpl")
|
|
private RecordAnalyzeExampleServiceImpl recordAnalyzeExampleService;
|
|
private RecordAnalyzeExampleServiceImpl recordAnalyzeExampleService;
|
|
|
|
+ @Autowired
|
|
|
|
+ @Qualifier("abnormalServiceImpl")
|
|
|
|
+ private AbnormalServiceImpl abnormalService;
|
|
@Value("${xml-is-encryped}")
|
|
@Value("${xml-is-encryped}")
|
|
private boolean encryped;
|
|
private boolean encryped;
|
|
|
|
|
|
@@ -191,10 +196,9 @@ public class XmlDataAnalysisFacade {
|
|
}
|
|
}
|
|
|
|
|
|
//总结出将要新增或者更新的数据
|
|
//总结出将要新增或者更新的数据
|
|
- //1、需要新增的文书模块模板类型;2、需要更新的文书模块模板类型;3、需要新增的map_key;4、需要新增的示例病历号;
|
|
|
|
|
|
+ //1、需要新增的文书模块模板类型;2、需要更新的文书模块模板类型;3、需要新增的示例病历号;
|
|
List<RecordAnalyze> addRecordAnalyzeList = Lists.newArrayList();//需要新增的文书模块模板类型
|
|
List<RecordAnalyze> addRecordAnalyzeList = Lists.newArrayList();//需要新增的文书模块模板类型
|
|
List<RecordAnalyze> uptRecordAnalyzeList = Lists.newArrayList();//需要更新的文书模块模板类型
|
|
List<RecordAnalyze> uptRecordAnalyzeList = Lists.newArrayList();//需要更新的文书模块模板类型
|
|
- List<RecordAnalyzeDetail> recordAnalyzeDetailList = Lists.newArrayList();//需要新增的map_key
|
|
|
|
List<RecordAnalyzeExample> recordAnalyzeExampleList = Lists.newArrayList();//需要新增的示例病历号
|
|
List<RecordAnalyzeExample> recordAnalyzeExampleList = Lists.newArrayList();//需要新增的示例病历号
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
int type = alreadyExistsDataMap.size() + 1;
|
|
int type = alreadyExistsDataMap.size() + 1;
|
|
@@ -249,6 +253,8 @@ public class XmlDataAnalysisFacade {
|
|
//进行数据新增或者更新
|
|
//进行数据新增或者更新
|
|
if (ListUtil.isNotEmpty(addRecordAnalyzeList)) {
|
|
if (ListUtil.isNotEmpty(addRecordAnalyzeList)) {
|
|
recordAnalyzeService.saveBatch(addRecordAnalyzeList);
|
|
recordAnalyzeService.saveBatch(addRecordAnalyzeList);
|
|
|
|
+ List<RecordAnalyzeDetail> recordAnalyzeDetailList = Lists.newArrayList();//需要新增的map_key
|
|
|
|
+ List<Abnormal> abnormalList = Lists.newArrayList();//需要新增的异常记录
|
|
addRecordAnalyzeList.forEach(raly -> {
|
|
addRecordAnalyzeList.forEach(raly -> {
|
|
Set<String> mapKeySet = Sets.newHashSet(raly.getMapKeys().split(","));
|
|
Set<String> mapKeySet = Sets.newHashSet(raly.getMapKeys().split(","));
|
|
mapKeySet.forEach(mky -> {
|
|
mapKeySet.forEach(mky -> {
|
|
@@ -257,14 +263,26 @@ public class XmlDataAnalysisFacade {
|
|
recordAnalyzeDetail.setMapKey(mky);
|
|
recordAnalyzeDetail.setMapKey(mky);
|
|
recordAnalyzeDetailList.add(recordAnalyzeDetail);
|
|
recordAnalyzeDetailList.add(recordAnalyzeDetail);
|
|
});
|
|
});
|
|
- recordAnalyzeDetailService.saveBatch(recordAnalyzeDetailList);
|
|
|
|
|
|
+
|
|
keysBehospitalCodesMap.get(mapKeySet).forEach(bocd -> {
|
|
keysBehospitalCodesMap.get(mapKeySet).forEach(bocd -> {
|
|
RecordAnalyzeExample recordAnalyzeExample = new RecordAnalyzeExample();
|
|
RecordAnalyzeExample recordAnalyzeExample = new RecordAnalyzeExample();
|
|
recordAnalyzeExample.setRecordAnalyzeId(raly.getId());
|
|
recordAnalyzeExample.setRecordAnalyzeId(raly.getId());
|
|
recordAnalyzeExample.setBehospitalCode(bocd);
|
|
recordAnalyzeExample.setBehospitalCode(bocd);
|
|
recordAnalyzeExampleList.add(recordAnalyzeExample);
|
|
recordAnalyzeExampleList.add(recordAnalyzeExample);
|
|
|
|
+
|
|
|
|
+ Abnormal abnormal = new Abnormal();
|
|
|
|
+ abnormal.setHospitalId(hospitalId);
|
|
|
|
+ abnormal.setBehospitalCode(bocd);
|
|
|
|
+ abnormal.setType(3);
|
|
|
|
+ abnormal.setStatus(0);
|
|
|
|
+ abnormal.setDescription(raly.getName());
|
|
|
|
+ abnormal.setGmtCreate(now);
|
|
|
|
+ abnormal.setGmtModified(now);
|
|
|
|
+ abnormalList.add(abnormal);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ recordAnalyzeDetailService.saveBatch(recordAnalyzeDetailList);
|
|
|
|
+ abnormalService.saveBatch(abnormalList);
|
|
}
|
|
}
|
|
if (ListUtil.isNotEmpty(uptRecordAnalyzeList)) {
|
|
if (ListUtil.isNotEmpty(uptRecordAnalyzeList)) {
|
|
recordAnalyzeService.updateBatchById(uptRecordAnalyzeList);
|
|
recordAnalyzeService.updateBatchById(uptRecordAnalyzeList);
|