|
@@ -328,6 +328,10 @@ public class ExportFacade {
|
|
|
}
|
|
|
|
|
|
private void import2MySqlR(List<ExportRelation> exportRelations, Integer stype, Integer etype, Map<String, KlConcept> map) {
|
|
|
+ import2MySqlR(exportRelations, stype, etype, 600, map);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void import2MySqlR(List<ExportRelation> exportRelations, Integer stype, Integer etype, Integer rType, Map<String, KlConcept> map) {
|
|
|
List<KlRelation> klRelations = new ArrayList<>();
|
|
|
for (ExportRelation exportRelation : exportRelations) {
|
|
|
if (null != map.get(exportRelation.getSname() + "_" + stype)
|
|
@@ -335,13 +339,58 @@ public class ExportFacade {
|
|
|
KlRelation klRelation = new KlRelation();
|
|
|
klRelation.setStartId(map.get(exportRelation.getSname() + "_" + stype).getId());
|
|
|
klRelation.setEndId(map.get(exportRelation.getEname() + "_" + etype).getId());
|
|
|
- klRelation.setRelationId(600);
|
|
|
+ klRelation.setRelationId(rType);
|
|
|
klRelations.add(klRelation);
|
|
|
}
|
|
|
}
|
|
|
klRelationService.saveBatch(klRelations);
|
|
|
}
|
|
|
|
|
|
+ public Map<String, Object> importExcelGraphDB() {
|
|
|
+ graphRelationDealdiagnose();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void graphRelationDealdiagnose() {
|
|
|
+ List<KlConcept> klConcepts
|
|
|
+ = klConceptService.list(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ );
|
|
|
+ Map<String, KlConcept> map
|
|
|
+ = EntityUtil.makeEntityMapByKeys(klConcepts, "_", "libName", "libType");
|
|
|
+ //主症状
|
|
|
+ List<ExportRelation> exportRelations = exportRelationRepository.symptomMainPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 103, 501, map);
|
|
|
+ //次症状
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.symptomSecPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 103, 502, map);
|
|
|
+ //体格检查结果
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.vitalPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 105, 503, map);
|
|
|
+ //实验室检查套餐
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.lisPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 107, 504, map);
|
|
|
+ //辅助检查项目
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.pacsPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 109, 505, map);
|
|
|
+ //药品通用名
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.drugPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 101, 506, map);
|
|
|
+ //手术和操作
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.operationPush();
|
|
|
+ import2MySqlR(exportRelations, 100, 106, 507, map);
|
|
|
+ //鉴别诊断
|
|
|
+ exportRelations.clear();
|
|
|
+ exportRelations = exportRelationRepository.diffDiagnosePush();
|
|
|
+ import2MySqlR(exportRelations, 100, 100, 508, map);
|
|
|
+ }
|
|
|
+
|
|
|
public Map<String, Object> importExcel(MultipartFile file) {
|
|
|
List<ImportDataVO> data = ExcelUtils.importExcel(file, 0, 1, ImportDataVO.class);
|
|
|
List<KlConcept> klConcepts
|