|
@@ -28,10 +28,7 @@ import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.sql.Connection;
|
|
|
-import java.sql.ResultSet;
|
|
|
-import java.sql.SQLException;
|
|
|
-import java.sql.Statement;
|
|
|
+import java.sql.*;
|
|
|
import java.text.NumberFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -56,9 +53,9 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
@Autowired
|
|
|
private BiRepository biRepository;
|
|
|
private List<BaseNode> baseNodes;
|
|
|
- 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 String user = "root";
|
|
|
+ private String password = "lantone";
|
|
|
+ private String url = "jdbc:mysql://192.168.2.236:3306/med?useUnicode=true&characterEncoding=UTF-8";
|
|
|
private Pageable pageable;
|
|
|
/**
|
|
|
* 处理症状节点相关的申请
|
|
@@ -1466,8 +1463,8 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
Statement st = null;
|
|
|
ResultSet rs = null;
|
|
|
try {
|
|
|
- String type, code ,standard,relation,result,formula,name;
|
|
|
- String sql = "SELECT diagnose_id,dis_name,`type`,`code`,standard,relation,result,formula FROM `kl_diagnose_detail` where diagnose_id = "+disId+" and is_deleted = 'N'";
|
|
|
+ String type, code ,standard,relation,unique_name,result,formula,name;
|
|
|
+ String sql = "SELECT diagnose_id,dis_name,`type`,`code`,standard,relation,unique_name,result,formula FROM `kl_diagnose_detail` where diagnose_id = "+disId+" and is_deleted = 'N'";
|
|
|
st = connection.createStatement();
|
|
|
rs = st.executeQuery(sql);
|
|
|
while (rs.next()){
|
|
@@ -1476,6 +1473,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
code = rs.getString("code");
|
|
|
standard = rs.getString("standard");
|
|
|
relation = rs.getString("relation");
|
|
|
+ unique_name = rs.getString("unique_name");
|
|
|
result = rs.getString("result");
|
|
|
formula = rs.getString("formula");
|
|
|
name = Type.getName(Integer.parseInt(type));
|
|
@@ -1484,6 +1482,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
content.put("code",code);
|
|
|
content.put("standard",standard);
|
|
|
content.put("relation",relation);
|
|
|
+ content.put("unique_name",unique_name);
|
|
|
content.put("result",result);
|
|
|
content.put("formula",formula);
|
|
|
contentList.add(content);
|
|
@@ -1791,6 +1790,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
String typeName = row.get("typeName");//类型对应的中文名
|
|
|
String standard = row.get("standard");//标准词
|
|
|
String relation = row.get("relation");//关联词
|
|
|
+ String unique_name = row.get("unique_name");//公表项
|
|
|
String result = row.get("result");//结果
|
|
|
if(StringUtils.isNotEmpty(type)){
|
|
|
String[] split =null;
|
|
@@ -1959,48 +1959,35 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
}
|
|
|
} else if("3".equals(type)){ //处理化验
|
|
|
String lis = "";
|
|
|
- //查找化验大项的标准词
|
|
|
- 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);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //创建公表名
|
|
|
+ if(StringUtils.isNotEmpty(unique_name)){
|
|
|
+ //创建化验公表项
|
|
|
+ diseaseRepository.mergePublicLIS_1(unique_name);
|
|
|
+ //疾病和化验公表项创建推荐关系
|
|
|
+ diseaseRepository.mergeRelationLIS_1(disId,unique_name);
|
|
|
+ lis =standard;
|
|
|
+ //创建大项名
|
|
|
diseaseRepository.mergePublicLIS(lis);
|
|
|
- //疾病推荐化验公表名
|
|
|
+ //疾病推荐化验大项名
|
|
|
diseaseRepository.mergeRelationLIS(disId,lis);
|
|
|
//处理化验结果
|
|
|
- if(StringUtils.isNotEmpty(result)){
|
|
|
+ if(StringUtils.isNotEmpty(result) && StringUtils.isNotEmpty(unique_name)){
|
|
|
lisResultSplit = result.split("、");
|
|
|
if(lisResultSplit != null && lisResultSplit.length>0){
|
|
|
- //化验结果找标准词
|
|
|
for (String lisRs:lisResultSplit) {
|
|
|
if(StringUtils.isNotEmpty(lisRs)){
|
|
|
- lisResult = searchStandWord(lisRs,"resultLis",ciKu);
|
|
|
- if(StringUtils.isNotEmpty(lisResult)){
|
|
|
- //创建化验结果节点
|
|
|
- diseaseRepository.mergeLISRESULT(lisResult);
|
|
|
- //公表名和化验结果创建关系
|
|
|
- diseaseRepository.mergeRelationPublicLIS(lis,lisResult);
|
|
|
- //化验结果和对应的codeCondition创建关系
|
|
|
- diseaseRepository.mergeRelationCondiLisRes(disName+code,lisResult);
|
|
|
- }
|
|
|
-
|
|
|
+ //创建化验结果节点
|
|
|
+ diseaseRepository.mergeLISRESULT(lisRs);
|
|
|
+ //大项和化验结果创建关系
|
|
|
+ diseaseRepository.mergeRelationPublicLIS(lis,lisRs);
|
|
|
+ //化验结果和对应的codeCondition创建关系
|
|
|
+ diseaseRepository.mergeRelationCondiLisRes(disName+code,lisRs);
|
|
|
+ //化验大项和化验公表项创建关系
|
|
|
+// diseaseRepository.mergeRelationPublicAndLIS(lis,unique_name);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}else if("4".equals(type)){ //辅检
|
|
|
//查找辅检的标准词
|
|
|
standWord = searchStandWord(standard,type,ciKu);
|
|
@@ -2125,6 +2112,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
if(disList != null && disList.size()>0){
|
|
|
for (Long disId:disList) {
|
|
|
respDTO = this.updateNeo(respDTO, disId, connect, ciKu);
|
|
|
+ this.updateDate(connect,disId);
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -2160,8 +2148,21 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
return biDetailList;
|
|
|
}
|
|
|
|
|
|
- public void updateDate(Connection connection,Long disId){
|
|
|
- String sql = "UPDATE `kl_diagnose` set neo_update='1970-01-01 12:00:00' where id="+disId+";";
|
|
|
+ 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=?";
|
|
|
+ PreparedStatement preparedStatement =null;
|
|
|
+ try {
|
|
|
+ connection.setAutoCommit(false);
|
|
|
+ preparedStatement = connection.prepareStatement(sql);
|
|
|
+ preparedStatement.setLong(1,disId);
|
|
|
+ int i = preparedStatement.executeUpdate();
|
|
|
+ connection.commit();
|
|
|
+ } catch (SQLException e) {
|
|
|
+ connection.rollback();
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
+ preparedStatement.close();
|
|
|
+ }
|
|
|
}
|
|
|
public List<Long> getDisList(Connection connection){
|
|
|
List<Long> disIds = new ArrayList<>();
|