|
@@ -50,11 +50,12 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
private ScaleRepository scaleRepository;
|
|
private ScaleRepository scaleRepository;
|
|
@Autowired
|
|
@Autowired
|
|
private KnowledgeMapper knowledgeMapper;
|
|
private KnowledgeMapper knowledgeMapper;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private BiRepository biRepository;
|
|
private List<BaseNode> baseNodes;
|
|
private List<BaseNode> baseNodes;
|
|
- private String user = "root";
|
|
|
|
- private String password = "lantone";
|
|
|
|
- private String url = "jdbc:mysql://192.168.2.236:3306/med?useUnicode=true&characterEncoding=UTF-8";
|
|
|
|
|
|
+ private String user = "teamdata";
|
|
|
|
+ private String password = "jiO2rfnYhg";
|
|
|
|
+ private String url = "jdbc:mysql://192.168.2.121:3306/med?useUnicode=true&characterEncoding=UTF-8";
|
|
private Pageable pageable;
|
|
private Pageable pageable;
|
|
/**
|
|
/**
|
|
* 处理症状节点相关的申请
|
|
* 处理症状节点相关的申请
|
|
@@ -1440,7 +1441,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
if(StringUtils.isNotEmpty(disName)){
|
|
if(StringUtils.isNotEmpty(disName)){
|
|
diseaseRepository.mergeDis(disName,disId,0);
|
|
diseaseRepository.mergeDis(disName,disId,0);
|
|
}else {
|
|
}else {
|
|
- respDTO = RespDTO.onError("在数据库中没有找到"+disId+"对应的疾病!!");
|
|
|
|
|
|
+ respDTO = RespDTO.onError("在数据库中没有找到这个疾病!!");
|
|
}
|
|
}
|
|
|
|
|
|
//获取每个诊断依据的全部数据
|
|
//获取每个诊断依据的全部数据
|
|
@@ -1568,9 +1569,9 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
ResultSet rs = null;
|
|
ResultSet rs = null;
|
|
try {
|
|
try {
|
|
String tongName, type, isConcept,stand;
|
|
String tongName, type, isConcept,stand;
|
|
- String sql = "SELECT a.name,a.type_id,a.is_concept, b.lib_name from kl_library_info a, kl_concept b\n" +
|
|
|
|
- " where a.is_deleted = 'N' and b.is_deleted = 'N' and a.concept_id = b.id\n" +
|
|
|
|
- " and a.type_id in (1,5,12,13,14,16,17,18,35,70)";
|
|
|
|
|
|
+ String sql = "SELECT name, type_id,is_concept,IF(is_concept=1,a.name,(select lib_name from kl_concept b where b.id = a.concept_id) ) lib_name \n" +
|
|
|
|
+ "from kl_library_info a where a.is_deleted = 'N'\n" +
|
|
|
|
+ "and type_id in (1,5,12,13,14,16,17,18,35,70)";
|
|
st = connection.createStatement();
|
|
st = connection.createStatement();
|
|
rs = st.executeQuery(sql);
|
|
rs = st.executeQuery(sql);
|
|
Map<String,String> detail =null;
|
|
Map<String,String> detail =null;
|
|
@@ -1966,37 +1967,13 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if("3".equals(type)){ //处理化验
|
|
} else if("3".equals(type)){ //处理化验
|
|
- String lis = "";//大项
|
|
|
|
|
|
+ String lis = "";
|
|
if(StringUtils.isNotEmpty(unique_name)){
|
|
if(StringUtils.isNotEmpty(unique_name)){
|
|
//创建化验公表项
|
|
//创建化验公表项
|
|
diseaseRepository.mergePublicLIS_1(unique_name);
|
|
diseaseRepository.mergePublicLIS_1(unique_name);
|
|
//疾病和化验公表项创建推荐关系
|
|
//疾病和化验公表项创建推荐关系
|
|
diseaseRepository.mergeRelationLIS_1(disId,unique_name);
|
|
diseaseRepository.mergeRelationLIS_1(disId,unique_name);
|
|
- if(StringUtils.isNotEmpty(result)){
|
|
|
|
- lis = standard;
|
|
|
|
-
|
|
|
|
- }else {
|
|
|
|
- lis = unique_name;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //查找化验大项的标准词
|
|
|
|
- /* standWord = searchStandWord(standard,type,ciKu);
|
|
|
|
- if(StringUtils.isNotEmpty(standWord)){
|
|
|
|
- if(StringUtils.isNotEmpty(relation) && standard.equals(relation)){
|
|
|
|
- lis = standWord;
|
|
|
|
- }else if(StringUtils.isNotEmpty(standard) && StringUtils.isEmpty(relation)){
|
|
|
|
- lis = standWord;
|
|
|
|
- }else if(StringUtils.isNotEmpty(standard)&& StringUtils.isNotEmpty(relation)&&!standard.equals(relation)){
|
|
|
|
- type = "subLis";
|
|
|
|
- if(StringUtils.isNotEmpty(searchStandWord(relation,type,ciKu))){
|
|
|
|
- //查找化验小项的标准词
|
|
|
|
- lis = standWord+"--"+searchStandWord(relation,type,ciKu);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ lis =standard;
|
|
//创建大项名
|
|
//创建大项名
|
|
diseaseRepository.mergePublicLIS(lis);
|
|
diseaseRepository.mergePublicLIS(lis);
|
|
//疾病推荐化验大项名
|
|
//疾病推荐化验大项名
|
|
@@ -2005,7 +1982,6 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
if(StringUtils.isNotEmpty(result) && StringUtils.isNotEmpty(unique_name)){
|
|
if(StringUtils.isNotEmpty(result) && StringUtils.isNotEmpty(unique_name)){
|
|
lisResultSplit = result.split("、");
|
|
lisResultSplit = result.split("、");
|
|
if(lisResultSplit != null && lisResultSplit.length>0){
|
|
if(lisResultSplit != null && lisResultSplit.length>0){
|
|
- //化验结果找标准词
|
|
|
|
for (String lisRs:lisResultSplit) {
|
|
for (String lisRs:lisResultSplit) {
|
|
if(StringUtils.isNotEmpty(lisRs)){
|
|
if(StringUtils.isNotEmpty(lisRs)){
|
|
//创建化验结果节点
|
|
//创建化验结果节点
|
|
@@ -2015,21 +1991,12 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
//化验结果和对应的codeCondition创建关系
|
|
//化验结果和对应的codeCondition创建关系
|
|
diseaseRepository.mergeRelationCondiLisRes(disName+code,lisRs);
|
|
diseaseRepository.mergeRelationCondiLisRes(disName+code,lisRs);
|
|
//化验大项和化验公表项创建关系
|
|
//化验大项和化验公表项创建关系
|
|
- diseaseRepository.mergeRelationPublicAndLIS(lis,unique_name);
|
|
|
|
- /*lisResult = searchStandWord(lisRs,"resultLis",ciKu);
|
|
|
|
- if(StringUtils.isNotEmpty(lisResult)){
|
|
|
|
- //创建化验结果节点
|
|
|
|
- diseaseRepository.mergeLISRESULT(lisResult);
|
|
|
|
- //公表名和化验结果创建关系
|
|
|
|
- diseaseRepository.mergeRelationPublicLIS(lis,lisResult);
|
|
|
|
- //化验结果和对应的codeCondition创建关系
|
|
|
|
- diseaseRepository.mergeRelationCondiLisRes(disName+code,lisResult);
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
|
|
+// diseaseRepository.mergeRelationPublicAndLIS(lis,unique_name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
}else if("4".equals(type)){ //辅检
|
|
}else if("4".equals(type)){ //辅检
|
|
//查找辅检的标准词
|
|
//查找辅检的标准词
|
|
standWord = searchStandWord(standard,type,ciKu);
|
|
standWord = searchStandWord(standard,type,ciKu);
|
|
@@ -2106,7 +2073,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
connect.close();
|
|
connect.close();
|
|
respDTO = RespDTO.onSuc(true);
|
|
respDTO = RespDTO.onSuc(true);
|
|
}else {
|
|
}else {
|
|
- respDTO = RespDTO.onError(disId +" 删除失败!!!");
|
|
|
|
|
|
+ respDTO = RespDTO.onError(" 删除失败!!!");
|
|
}
|
|
}
|
|
} catch (SQLException e) {
|
|
} catch (SQLException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -2155,6 +2122,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
for (Long disId:disList) {
|
|
for (Long disId:disList) {
|
|
respDTO = this.updateNeo(respDTO, disId, connect, ciKu);
|
|
respDTO = this.updateNeo(respDTO, disId, connect, ciKu);
|
|
this.updateDate(connect,disId);
|
|
this.updateDate(connect,disId);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
connect.close();
|
|
connect.close();
|
|
@@ -2164,15 +2132,45 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
|
|
|
return respDTO;
|
|
return respDTO;
|
|
}
|
|
}
|
|
- public void updateDate(Connection connection,Long disId) {
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<BiDetail> neoBi() {
|
|
|
|
+ List<BiDetail> biDetailList = new ArrayList<>();
|
|
|
|
+ Long disCount = biRepository.diagnoseCount();
|
|
|
|
+ Long childCount = biRepository.childCount();
|
|
|
|
+ Long scaleCount = biRepository.scaleCount();
|
|
|
|
+ BiDetail dis = new BiDetail();
|
|
|
|
+ dis.setModuleName("疾病");
|
|
|
|
+ dis.setItemName("图谱推送的疾病");
|
|
|
|
+ dis.setCount(disCount);
|
|
|
|
+ BiDetail child = new BiDetail();
|
|
|
|
+ child.setModuleName("疾病");
|
|
|
|
+ child.setItemName("图谱推送的儿科疾病");
|
|
|
|
+ child.setCount(childCount);
|
|
|
|
+ BiDetail scale = new BiDetail();
|
|
|
|
+ scale.setModuleName("量表");
|
|
|
|
+ scale.setItemName("量表总数");
|
|
|
|
+ scale.setCount(scaleCount);
|
|
|
|
+ biDetailList.add(dis);
|
|
|
|
+ biDetailList.add(child);
|
|
|
|
+ biDetailList.add(scale);
|
|
|
|
+ return biDetailList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void updateDate(Connection connection,Long disId) throws SQLException {
|
|
String sql = "UPDATE `kl_diagnose` set neo_update='1970-01-01 12:00:00' where id=?";
|
|
String sql = "UPDATE `kl_diagnose` set neo_update='1970-01-01 12:00:00' where id=?";
|
|
|
|
+ PreparedStatement preparedStatement =null;
|
|
try {
|
|
try {
|
|
- PreparedStatement preparedStatement = connection.prepareStatement(sql);
|
|
|
|
|
|
+ connection.setAutoCommit(false);
|
|
|
|
+ preparedStatement = connection.prepareStatement(sql);
|
|
preparedStatement.setLong(1,disId);
|
|
preparedStatement.setLong(1,disId);
|
|
int i = preparedStatement.executeUpdate();
|
|
int i = preparedStatement.executeUpdate();
|
|
- preparedStatement.close();
|
|
|
|
|
|
+ connection.commit();
|
|
} catch (SQLException e) {
|
|
} catch (SQLException e) {
|
|
|
|
+ connection.rollback();
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ }finally {
|
|
|
|
+ preparedStatement.close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public List<Long> getDisList(Connection connection){
|
|
public List<Long> getDisList(Connection connection){
|
|
@@ -2252,6 +2250,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
public Pageable getPageable(PageVo pageVo) {
|
|
public Pageable getPageable(PageVo pageVo) {
|
|
if (pageVo.getSize() > 0) {
|
|
if (pageVo.getSize() > 0) {
|
|
if (pageVo.getSort_key() != null && pageVo.getSort_direct() != null) {
|
|
if (pageVo.getSort_key() != null && pageVo.getSort_direct() != null) {
|