|
@@ -79,6 +79,7 @@ public class PushTreat {
|
|
|
Map<String,Map<String,Object>> disDrugs = new HashMap<>();
|
|
|
Map<String, String> medicaton_ji = new HashMap<>();
|
|
|
Map<String, List<String>> medicatonMap = new HashMap<>();
|
|
|
+ Set<String> disSet = new HashSet<>();
|
|
|
List<String> filds = new ArrayList<>();
|
|
|
if(inputList.length>0){
|
|
|
for (String fild:inputList) {
|
|
@@ -96,7 +97,7 @@ public class PushTreat {
|
|
|
logger.info("规则用药,查询语句为:\n" + query);
|
|
|
StatementResult result = tx.run(query);
|
|
|
while (result.hasNext()) {
|
|
|
- searchDrugs(result, conditionDesign, disDrugs);
|
|
|
+ searchDrugs(result, conditionDesign, disDrugs,disSet);
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
@@ -153,6 +154,7 @@ public class PushTreat {
|
|
|
private List<TreatDetail> ruleMedicaton(String disName,String webDiag,List<String> allFilds,Driver driver){
|
|
|
Map<String,Integer> conditionDesign = new HashMap<>();
|
|
|
Map<String,Map<String,Object>> disDrugs = new HashMap<>();
|
|
|
+ Set<String> disSet = new HashSet<>();
|
|
|
List<String> webDiagList = processWebDiag(disName,webDiag);
|
|
|
Session session = driver.session(AccessMode.WRITE);
|
|
|
session.writeTransaction(new TransactionWork<Integer>() {
|
|
@@ -162,17 +164,23 @@ public class PushTreat {
|
|
|
logger.info("规则用药,查询语句为:\n" + query);
|
|
|
StatementResult result = tx.run(query);
|
|
|
while (result.hasNext()) {
|
|
|
- searchDrugs(result, conditionDesign, disDrugs);
|
|
|
+ searchDrugs(result, conditionDesign, disDrugs,disSet);
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
});
|
|
|
closeSession(session);
|
|
|
- List<TreatDetail> treatDetailList = this.processMedication(disDrugs, conditionDesign, allFilds, driver);
|
|
|
+ List<TreatDetail> treatDetailList =new ArrayList<>();
|
|
|
+ if(!disSet.contains(disName)){
|
|
|
+ treatDetailList = this.ordinaryMedicaton(disName,allFilds,driver);
|
|
|
+ }else {
|
|
|
+ treatDetailList = this.processMedication(disDrugs, conditionDesign, allFilds, driver);
|
|
|
+ }
|
|
|
+
|
|
|
return treatDetailList;
|
|
|
}
|
|
|
|
|
|
- private void searchDrugs(StatementResult result, Map<String, Integer> conditionDesign, Map<String, Map<String, Object>> disDrugs) {
|
|
|
+ private void searchDrugs(StatementResult result, Map<String, Integer> conditionDesign, Map<String, Map<String, Object>> disDrugs,Set<String> disSet) {
|
|
|
List<String> collection =null;
|
|
|
int i=0;
|
|
|
Record next = result.next();
|
|
@@ -181,6 +189,7 @@ public class PushTreat {
|
|
|
String p = next.get("p").toString();
|
|
|
String category = next.get("category").toString().replace("\"","");
|
|
|
String disName = next.get("disName").toString().replace("\"","");
|
|
|
+ disSet.add(disName);
|
|
|
if(design >= i){
|
|
|
i = design;
|
|
|
collection = (List) next.get("collection").asList();
|