|
@@ -73,6 +73,9 @@ public class PushTreat {
|
|
}else {
|
|
}else {
|
|
treatmentPlanList = treatDetailList_rule;
|
|
treatmentPlanList = treatDetailList_rule;
|
|
}
|
|
}
|
|
|
|
+ // TODO: 2019/11/28 匹配主症+其他+其他
|
|
|
|
+ List<TreatDetail> treatmentPlanList_otherrule = this.otherRuleMedicaton(disName, exculdDiagFilds, allFilds, driver);
|
|
|
|
+ treatmentPlanList.addAll(treatmentPlanList_otherrule);
|
|
// TODO: 2019/11/19 规则不满足的情况下,返回主诊断的用药情况
|
|
// TODO: 2019/11/19 规则不满足的情况下,返回主诊断的用药情况
|
|
if(treatmentPlanList.size() == 0){
|
|
if(treatmentPlanList.size() == 0){
|
|
treatmentPlanList = this.ordinaryMedicaton(disName,allFilds,driver);
|
|
treatmentPlanList = this.ordinaryMedicaton(disName,allFilds,driver);
|
|
@@ -182,16 +185,17 @@ public class PushTreat {
|
|
});
|
|
});
|
|
closeSession(session);
|
|
closeSession(session);
|
|
List<TreatDetail> treatDetailList =new ArrayList<>();
|
|
List<TreatDetail> treatDetailList =new ArrayList<>();
|
|
- if(!disSet.contains(disName)){
|
|
|
|
- //规则不匹配,返回主诊断治疗方案
|
|
|
|
- treatDetailList = this.ordinaryMedicaton(disName,allFilds,driver);
|
|
|
|
- }else {
|
|
|
|
- treatDetailList = this.processMedication(disName,disDrugs, conditionDesign, allFilds, driver);
|
|
|
|
|
|
+// if(!disSet.contains(disName)){
|
|
|
|
+// //规则不匹配,返回主诊断治疗方案
|
|
|
|
+// treatDetailList = this.ordinaryMedicaton(disName,allFilds,driver);
|
|
|
|
+// }else {
|
|
|
|
+ treatDetailList = this.processMedication_otherrule(disName,disDrugs, conditionDesign, allFilds, driver);
|
|
|
|
|
|
- }
|
|
|
|
|
|
+// }
|
|
|
|
|
|
return treatDetailList;
|
|
return treatDetailList;
|
|
}
|
|
}
|
|
|
|
+
|
|
//匹配规则,推荐用药
|
|
//匹配规则,推荐用药
|
|
private List<TreatDetail> ruleMedicaton(String disName,String webDiag,List<String> allFilds,Driver driver){
|
|
private List<TreatDetail> ruleMedicaton(String disName,String webDiag,List<String> allFilds,Driver driver){
|
|
Map<String,Integer> conditionDesign = new HashMap<>();
|
|
Map<String,Integer> conditionDesign = new HashMap<>();
|
|
@@ -322,7 +326,44 @@ public class PushTreat {
|
|
}
|
|
}
|
|
return treatDetailList;
|
|
return treatDetailList;
|
|
}
|
|
}
|
|
|
|
+ private List<TreatDetail> processMedication_otherrule(String disName,Map<String,Map<String,Object>> disDrugs,Map<String,Integer> conditionDesign,List<String> allFilds,Driver driver){
|
|
|
|
+ List<TreatDetail> treatDetailList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ if(disDrugs != null && disDrugs.size()>0){
|
|
|
|
+ for (Map.Entry<String,Map<String,Object>> ds:disDrugs.entrySet()) {
|
|
|
|
+ String key = ds.getKey();
|
|
|
|
+ if(Arrays.asList(key.split("\\+")).contains(disName)){
|
|
|
|
+ Map<String, Object> values = ds.getValue();
|
|
|
|
+ List<String> cateList = (List<String>) values.get("cate");
|
|
|
|
+ List<String> disList = (List<String>)values.get("dis");
|
|
|
|
+ List<Object> collList = (List<Object>)values.get("coll");
|
|
|
|
+ if(cateList.size()==1 && cateList.contains("主症")){
|
|
|
|
|
|
|
|
+ TreatDetail treatDetail = new TreatDetail();
|
|
|
|
+ List<MeditionDetail> meditionDetails = new ArrayList<>();
|
|
|
|
+ int main = cateList.indexOf("主症");
|
|
|
|
+ String mainDis = disList.get(main);
|
|
|
|
+ treatDetail.setTitle(mainDis+"治疗方案");//糖尿病及其2型糖尿病治疗方案
|
|
|
|
+ Integer da = conditionDesign.get(key);
|
|
|
|
+ String s = switchType(da);
|
|
|
|
+ MeditionDetail meditionDetail_main = new MeditionDetail();//主诊断的
|
|
|
|
+ List<String> o = (List<String>)collList.get(main);
|
|
|
|
+ List<String> yinhao = yinhao(o);
|
|
|
|
+ //根据类找药
|
|
|
|
+ List<Drugs> drugs = searchMedication(yinhao,allFilds,driver);
|
|
|
|
+ meditionDetail_main.setDescription(s+":"+String.join("、",o));//单药治疗:双胍类
|
|
|
|
+ meditionDetail_main.setTreatment(drugs);
|
|
|
|
+ meditionDetails.add(meditionDetail_main);
|
|
|
|
+ treatDetail.setMeditionDetails(meditionDetails);
|
|
|
|
+
|
|
|
|
+ treatDetailList.add(treatDetail);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return treatDetailList;
|
|
|
|
+ }
|
|
private List<TreatDetail> processMedication(String disName,Map<String,Map<String,Object>> disDrugs,Map<String,Integer> conditionDesign,List<String> allFilds,Driver driver){
|
|
private List<TreatDetail> processMedication(String disName,Map<String,Map<String,Object>> disDrugs,Map<String,Integer> conditionDesign,List<String> allFilds,Driver driver){
|
|
List<TreatDetail> treatDetailList = new ArrayList<>();
|
|
List<TreatDetail> treatDetailList = new ArrayList<>();
|
|
|
|
|
|
@@ -374,7 +415,7 @@ public class PushTreat {
|
|
treatDetailList.add(treatDetail);
|
|
treatDetailList.add(treatDetail);
|
|
|
|
|
|
}
|
|
}
|
|
- /*if(cateList.size()==1 && cateList.contains("主症")){
|
|
|
|
|
|
+ if(cateList.size()==1 && cateList.contains("主症")){
|
|
|
|
|
|
TreatDetail treatDetail = new TreatDetail();
|
|
TreatDetail treatDetail = new TreatDetail();
|
|
List<MeditionDetail> meditionDetails = new ArrayList<>();
|
|
List<MeditionDetail> meditionDetails = new ArrayList<>();
|
|
@@ -394,7 +435,7 @@ public class PushTreat {
|
|
treatDetail.setMeditionDetails(meditionDetails);
|
|
treatDetail.setMeditionDetails(meditionDetails);
|
|
|
|
|
|
treatDetailList.add(treatDetail);
|
|
treatDetailList.add(treatDetail);
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|