|
@@ -1,7 +1,5 @@
|
|
package com.diagbot.util;
|
|
package com.diagbot.util;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
-import com.diagbot.dto.NodeNeoDTO;
|
|
|
|
import com.diagbot.dto.PushBaseDTO;
|
|
import com.diagbot.dto.PushBaseDTO;
|
|
import com.diagbot.model.entity.PD;
|
|
import com.diagbot.model.entity.PD;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -14,48 +12,6 @@ public class NeoUtil {
|
|
|
|
|
|
private static String regex = "(.*)\\([a-zA-Z0-9]+\\)";
|
|
private static String regex = "(.*)\\([a-zA-Z0-9]+\\)";
|
|
|
|
|
|
-// public static NodeNeoDTO updateNodeInfo(NodeInfo nodeInfo) {
|
|
|
|
-// NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
-//
|
|
|
|
-// String name = nodeInfo.getName();
|
|
|
|
-// name = (null==name)?"":name;
|
|
|
|
-//// name = datautil.removekey(name, Constants.conflict);
|
|
|
|
-// nodeNeoDTO.setName(name);
|
|
|
|
-//
|
|
|
|
-// nodeNeoDTO.setRegex(nodeInfo.getRegex());
|
|
|
|
-//
|
|
|
|
-// BigDecimal min = nodeInfo.getMinval();
|
|
|
|
-// if (null!=min) {
|
|
|
|
-// nodeNeoDTO.setMin(min);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// BigDecimal max = nodeInfo.getMaxval();
|
|
|
|
-// if (null!=max) {
|
|
|
|
-// nodeNeoDTO.setMax(max);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// String unit = nodeInfo.getUnit();
|
|
|
|
-// unit = (null==unit)?"":unit;
|
|
|
|
-// nodeNeoDTO.setUnit(unit);
|
|
|
|
-//
|
|
|
|
-// Integer range = nodeInfo.getRange();
|
|
|
|
-// range = (null==range)?0:range;
|
|
|
|
-// nodeNeoDTO.setValType(range);
|
|
|
|
-//
|
|
|
|
-// String type = nodeInfo.getTypeval();
|
|
|
|
-// type = (null==type)?"":type;
|
|
|
|
-// nodeNeoDTO.setTermtype(type);
|
|
|
|
-//
|
|
|
|
-// if (nodeInfo.getMatchtype()!=null && nodeInfo.getMatchtype()==1) {
|
|
|
|
-// nodeNeoDTO.setExactMatch(1);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// return nodeNeoDTO;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
public static PushBaseDTO updatePushInfo(String name) {
|
|
public static PushBaseDTO updatePushInfo(String name) {
|
|
PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
|
|
@@ -83,71 +39,6 @@ public class NeoUtil {
|
|
return bd;
|
|
return bd;
|
|
}
|
|
}
|
|
|
|
|
|
- public static NodeNeoDTO jsontoNodeNeoDTO(String name, JSONObject jobj) {
|
|
|
|
-
|
|
|
|
- NodeNeoDTO nodeNeoDTO = null;
|
|
|
|
- try {
|
|
|
|
- nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
- nodeNeoDTO.setName(name.trim());
|
|
|
|
- if (null!=jobj) {
|
|
|
|
- for (String key : jobj.keySet()) {
|
|
|
|
- switch (key) {
|
|
|
|
- case "最大值":
|
|
|
|
- nodeNeoDTO.setMax(new BigDecimal(jobj.getString(key)));
|
|
|
|
- break;
|
|
|
|
- case "最小值":
|
|
|
|
- nodeNeoDTO.setMin(new BigDecimal(jobj.getString(key)));
|
|
|
|
- break;
|
|
|
|
- case "单位":
|
|
|
|
- nodeNeoDTO.setUnit(jobj.getString(key));
|
|
|
|
- break;
|
|
|
|
- case "范围":
|
|
|
|
- nodeNeoDTO.setValType(jobj.getIntValue(key));
|
|
|
|
- break;
|
|
|
|
- case "结果":
|
|
|
|
- nodeNeoDTO.setVal(jobj.getString(key));
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch (Exception ex) {
|
|
|
|
- ex.printStackTrace();
|
|
|
|
- }
|
|
|
|
- finally {
|
|
|
|
- return nodeNeoDTO;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// public static String getMedType(String medname) {
|
|
|
|
-// String medtype = Constants.yaoping;
|
|
|
|
-// if (medname.matches(regex)) {
|
|
|
|
-// medtype = Constants.yaopingleibie;
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// return medtype;
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// public static boolean matchBasic(YiBaoDiseaseName disease, int gender_code, double age){
|
|
|
|
-// boolean match = true;
|
|
|
|
-// if(disease != null){
|
|
|
|
-// String gender_neo4j = disease.getGender();
|
|
|
|
-// String age_neo4j = disease.getAge();
|
|
|
|
-// if((gender_neo4j != null && gender_neo4j.equals("男") && gender_code != 1) ||
|
|
|
|
-// (gender_neo4j != null && gender_neo4j.equals("女") && gender_code != 2)){
|
|
|
|
-// match = false;
|
|
|
|
-// }else if(age_neo4j != null ){
|
|
|
|
-// String[] betweenAge = age_neo4j.split("-");
|
|
|
|
-// if(betweenAge.length == 2 && (age < Double.parseDouble(betweenAge[0])
|
|
|
|
-// || age > Double.parseDouble(betweenAge[1]))){
|
|
|
|
-// match = false;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// return match;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 性别、年龄匹配
|
|
* 性别、年龄匹配
|
|
* @param disease
|
|
* @param disease
|
|
@@ -211,111 +102,9 @@ public class NeoUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return match;
|
|
return match;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- public static NodeNeoDTO fillNodeNeoDTO(Vital vital) {
|
|
|
|
- NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
- Integer range;
|
|
|
|
- BigDecimal max, min;
|
|
|
|
-
|
|
|
|
- String name = (vital.getVitalidx()==null)?vital.getName():vital.getVitalidx();
|
|
|
|
- nodeNeoDTO.setName(name);
|
|
|
|
-
|
|
|
|
- max = (vital.getMaxval()==null)?null:new BigDecimal(vital.getMaxval());
|
|
|
|
- nodeNeoDTO.setMax(max);
|
|
|
|
-
|
|
|
|
- min = (vital.getMinval()==null)?null:new BigDecimal(vital.getMinval());
|
|
|
|
- nodeNeoDTO.setMin(min);
|
|
|
|
-
|
|
|
|
- range = (vital.getRange()==null)?0:vital.getRange();
|
|
|
|
- nodeNeoDTO.setValType(range);
|
|
|
|
-
|
|
|
|
- nodeNeoDTO.setUnit(vital.getUnit());
|
|
|
|
-
|
|
|
|
- nodeNeoDTO.setTermtype(vital.getVitalidx());
|
|
|
|
-
|
|
|
|
- return nodeNeoDTO;
|
|
|
|
- }
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- public static boolean inlist(String name, List<NodeNeoDTO> NodeNeoDTOs) {
|
|
|
|
- boolean isin = false;
|
|
|
|
-
|
|
|
|
- for (NodeNeoDTO node : NodeNeoDTOs) {
|
|
|
|
- if (node.getName().equals(name)) {
|
|
|
|
- isin = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return isin;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// public static boolean isExist(BaseRelation relationship) {
|
|
|
|
- //
|
|
|
|
- // if (null==relationship) {
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // else if (null==relationship.getStatus() ||
|
|
|
|
- // (null!=relationship.getStatus() && relationship.getStatus()==1)) {
|
|
|
|
- // return true;
|
|
|
|
- // }
|
|
|
|
- // else {
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- //
|
|
|
|
- //
|
|
|
|
- // public static boolean isExist(BaseNode node) {
|
|
|
|
- //
|
|
|
|
- // if (null==node) {
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // else if (null==node.getStatus() ||
|
|
|
|
- // (null!=node.getStatus() && node.getStatus()==1)) {
|
|
|
|
- // return true;
|
|
|
|
- // }
|
|
|
|
- // else {
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- //
|
|
|
|
- // public static YiBaoDiseaseName extract_node(YiBaoDiseaseName yiBaoDiseaseName) {
|
|
|
|
- // for (YiBaoDiseaseNameSymptom symptom : yiBaoDiseaseName.getYiBaoDiseaseNameSymptoms()) {
|
|
|
|
- // if (isExist(symptom)) {
|
|
|
|
- // yiBaoDiseaseName.getSymptoms().add(symptom.getSymptom());
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // for (YiBaoDiseaseNameVital vital : yiBaoDiseaseName.getYiBaoDiseaseNameVitals()) {
|
|
|
|
- // if (isExist(vital)) {
|
|
|
|
- // yiBaoDiseaseName.getVitals().add(vital.getVital());
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // for (YiBaoDiseaseNameLisBigName lis : yiBaoDiseaseName.getYiBaoDiseaseNameLisnames()) {
|
|
|
|
- // if (isExist(lis)) {
|
|
|
|
- // yiBaoDiseaseName.getLisnames().add(lis.getLisBigName());
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // for (YiBaoDiseaseNamePacsName pacs : yiBaoDiseaseName.getYiBaoDiseaseNamePacsnames()) {
|
|
|
|
- // if (isExist(pacs)) {
|
|
|
|
- // yiBaoDiseaseName.getPacsnames().add(pacs.getPacsName());
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // return yiBaoDiseaseName;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
PD pd = new PD();
|
|
PD pd = new PD();
|
|
pd.setValue("两月");
|
|
pd.setValue("两月");
|