|
@@ -3,6 +3,9 @@ package com.diagbot.aggregate;
|
|
|
import com.diagbot.client.bean.AdverseReaction;
|
|
|
import com.diagbot.client.bean.Medicition;
|
|
|
import com.diagbot.client.bean.MedicitionClass;
|
|
|
+import com.diagbot.client.bean.MeditionDetail;
|
|
|
+import com.diagbot.client.bean.Treat;
|
|
|
+import com.diagbot.client.bean.TreatmentPlan;
|
|
|
import com.diagbot.dto.ConceptDetailDTO;
|
|
|
import com.diagbot.entity.Concept;
|
|
|
import com.diagbot.entity.ConceptDetail;
|
|
@@ -17,7 +20,6 @@ import io.github.lvyahui8.spring.annotation.InvokeParameter;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -31,20 +33,20 @@ import java.util.Map;
|
|
|
public class TreatmentAggregate {
|
|
|
|
|
|
@DataProvider("setTreatmentAll")
|
|
|
- public Map<String, Object> setTreatmentAll(@InvokeParameter("treatmentMap") Map<String, Object> treatmentMap,
|
|
|
- @DataConsumer("setCommonTreatment") ConceptDetailDTO commonTreatment,
|
|
|
- @DataConsumer("setSurgeryTreatment") ConceptDetailDTO surgeryTreatment,
|
|
|
- @DataConsumer("setDrugs") List<MedicitionClass> drugsList,
|
|
|
- @DataConsumer("setAdverseReactions") List<AdverseReaction> adverseReactionList) {
|
|
|
- if (treatmentMap == null) {
|
|
|
- treatmentMap = new LinkedHashMap<>();
|
|
|
+ public Treat setTreatmentAll(@InvokeParameter("treat") Treat treat,
|
|
|
+ @DataConsumer("setCommonTreatment") ConceptDetailDTO commonTreatment,
|
|
|
+ @DataConsumer("setSurgeryTreatment") ConceptDetailDTO surgeryTreatment,
|
|
|
+ @DataConsumer("setTreatmentPlan") List<TreatmentPlan> treatmentPlanList,
|
|
|
+ @DataConsumer("setAdverseReactions") List<AdverseReaction> adverseReactionList) {
|
|
|
+ if (treat == null) {
|
|
|
+ treat = new Treat();
|
|
|
}
|
|
|
- treatmentMap.put("commonTreatment", commonTreatment);
|
|
|
- treatmentMap.put("surgeryTreatment", surgeryTreatment);
|
|
|
- treatmentMap.put("treatment", drugsList);
|
|
|
- treatmentMap.put("adverseReactions", adverseReactionList);
|
|
|
+ treat.setCommonTreatment(commonTreatment);
|
|
|
+ treat.setSurgeryTreatment(surgeryTreatment);
|
|
|
+ treat.setTreatmentPlan(treatmentPlanList);
|
|
|
+ treat.setAdverseEvent(adverseReactionList);
|
|
|
|
|
|
- return treatmentMap;
|
|
|
+ return treat;
|
|
|
}
|
|
|
|
|
|
@DataProvider("setCommonTreatment")
|
|
@@ -91,76 +93,87 @@ public class TreatmentAggregate {
|
|
|
return conceptDetailDTO;
|
|
|
}
|
|
|
|
|
|
- @DataProvider("setDrugs")
|
|
|
- public List<MedicitionClass> setDrugs(@InvokeParameter("drugsList") List<MedicitionClass> drugsList,
|
|
|
- @InvokeParameter("conceptMap") Map<String, Map<Long, Concept>> conceptMap,
|
|
|
- @InvokeParameter("hasConDetailMap") Map<String, Map<Long, List<ConceptDetail>>> hasConDetailMap) {
|
|
|
- if (ListUtil.isNotEmpty(drugsList)) {
|
|
|
- for (MedicitionClass medicitionClass : drugsList) {
|
|
|
- if (conceptMap != null
|
|
|
- && conceptMap.get(medicitionClass.getBigdrugsName()) != null
|
|
|
- && conceptMap.get(medicitionClass
|
|
|
- .getBigdrugsName())
|
|
|
- .containsKey(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey()))) {
|
|
|
- Concept cateBigConcept = conceptMap
|
|
|
- .get(medicitionClass.getBigdrugsName())
|
|
|
- .get(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey()));
|
|
|
- if (cateBigConcept != null) {
|
|
|
- medicitionClass.setBigdrugsConceptId(cateBigConcept.getId());
|
|
|
- if (hasConDetailMap != null
|
|
|
- && hasConDetailMap.get(cateBigConcept.getLibName()) != null
|
|
|
- && hasConDetailMap.get(cateBigConcept.getLibName())
|
|
|
- .containsKey(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey()))) {
|
|
|
- medicitionClass.setShowInfo("1");
|
|
|
- } else {
|
|
|
- medicitionClass.setShowInfo("0");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- medicitionClass.setBigdrgusLibType(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey());
|
|
|
- medicitionClass.setBigdrugsType(ConceptTypeEnum.Drug_Category_Big.getKey());
|
|
|
- if (conceptMap != null
|
|
|
- && conceptMap.get(medicitionClass.getSubdrugsName()) != null
|
|
|
- && conceptMap.get(medicitionClass.getSubdrugsName())
|
|
|
- .containsKey(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey()))) {
|
|
|
- Concept cateSmallConcept = conceptMap
|
|
|
- .get(medicitionClass.getSubdrugsName())
|
|
|
- .get(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey()));
|
|
|
- if (cateSmallConcept != null) {
|
|
|
- medicitionClass.setSubdrugsConceptId(cateSmallConcept.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- medicitionClass.setSubdrugsLibType(LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey());
|
|
|
- medicitionClass.setSubdrugsType(ConceptTypeEnum.Drug_Category_Small.getKey());
|
|
|
+ @DataProvider("setTreatmentPlan")
|
|
|
+ public List<TreatmentPlan> setTreatmentPlan(@InvokeParameter("treatmentPlan") List<TreatmentPlan> treatmentPlanList,
|
|
|
+ @InvokeParameter("conceptMap") Map<String, Map<Long, Concept>> conceptMap,
|
|
|
+ @InvokeParameter("hasConDetailMap") Map<String, Map<Long, List<ConceptDetail>>> hasConDetailMap) {
|
|
|
+ if (ListUtil.isNotEmpty(treatmentPlanList)) {
|
|
|
+ for (TreatmentPlan treatmentPlan : treatmentPlanList) {
|
|
|
+ List<MeditionDetail> meditionDetailList = treatmentPlan.getMeditionDetails();
|
|
|
+ if (ListUtil.isNotEmpty(meditionDetailList)) {
|
|
|
+ for (MeditionDetail meditionDetail : meditionDetailList) {
|
|
|
+ //药品推荐
|
|
|
+ List<MedicitionClass> treatmentDrugList = meditionDetail.getTreatment();
|
|
|
+ if (ListUtil.isNotEmpty(treatmentDrugList)) {
|
|
|
+ for (MedicitionClass medicitionClass : treatmentDrugList) {
|
|
|
+ if (conceptMap != null
|
|
|
+ && conceptMap.get(medicitionClass.getBigdrugsName()) != null
|
|
|
+ && conceptMap.get(medicitionClass
|
|
|
+ .getBigdrugsName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey()))) {
|
|
|
+ Concept cateBigConcept = conceptMap
|
|
|
+ .get(medicitionClass.getBigdrugsName())
|
|
|
+ .get(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey()));
|
|
|
+ if (cateBigConcept != null) {
|
|
|
+ medicitionClass.setBigdrugsConceptId(cateBigConcept.getId());
|
|
|
+ if (hasConDetailMap != null
|
|
|
+ && hasConDetailMap.get(cateBigConcept.getLibName()) != null
|
|
|
+ && hasConDetailMap.get(cateBigConcept.getLibName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey()))) {
|
|
|
+ medicitionClass.setShowInfo("1");
|
|
|
+ } else {
|
|
|
+ medicitionClass.setShowInfo("0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ medicitionClass.setBigdrgusLibType(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey());
|
|
|
+ medicitionClass.setBigdrugsType(ConceptTypeEnum.Drug_Category_Big.getKey());
|
|
|
+ if (conceptMap != null
|
|
|
+ && conceptMap.get(medicitionClass.getSubdrugsName()) != null
|
|
|
+ && conceptMap.get(medicitionClass.getSubdrugsName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey()))) {
|
|
|
+ Concept cateSmallConcept = conceptMap
|
|
|
+ .get(medicitionClass.getSubdrugsName())
|
|
|
+ .get(Long.valueOf(LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey()));
|
|
|
+ if (cateSmallConcept != null) {
|
|
|
+ medicitionClass.setSubdrugsConceptId(cateSmallConcept.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ medicitionClass.setSubdrugsLibType(LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey());
|
|
|
+ medicitionClass.setSubdrugsType(ConceptTypeEnum.Drug_Category_Small.getKey());
|
|
|
|
|
|
- LinkedList<Medicition> medicitionList = medicitionClass.getMedicitionsList();
|
|
|
- for (Medicition medicition : medicitionList) {
|
|
|
- if (conceptMap != null
|
|
|
- && conceptMap.get(medicition.getMedicitionName()) != null
|
|
|
- && conceptMap.get(medicition.getMedicitionName())
|
|
|
- .containsKey(Long.valueOf(LexiconTypeEnum.DRUGS.getKey()))) {
|
|
|
- Concept drugConcept = conceptMap
|
|
|
- .get(medicition.getMedicitionName())
|
|
|
- .get(Long.valueOf(LexiconTypeEnum.DRUGS.getKey()));
|
|
|
- if (drugConcept != null) {
|
|
|
- medicition.setConceptId(drugConcept.getId());
|
|
|
+ LinkedList<Medicition> medicitionList = medicitionClass.getMedicitionsList();
|
|
|
+ for (Medicition medicition : medicitionList) {
|
|
|
+ if (conceptMap != null
|
|
|
+ && conceptMap.get(medicition.getMedicitionName()) != null
|
|
|
+ && conceptMap.get(medicition.getMedicitionName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.DRUGS.getKey()))) {
|
|
|
+ Concept drugConcept = conceptMap
|
|
|
+ .get(medicition.getMedicitionName())
|
|
|
+ .get(Long.valueOf(LexiconTypeEnum.DRUGS.getKey()));
|
|
|
+ if (drugConcept != null) {
|
|
|
+ medicition.setConceptId(drugConcept.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ medicition.setLibType(LexiconTypeEnum.DRUGS.getKey());
|
|
|
+ medicition.setType(ConceptTypeEnum.Drug.getKey());
|
|
|
+ if (hasConDetailMap != null
|
|
|
+ && hasConDetailMap.get(medicition.getMedicitionName()) != null
|
|
|
+ && hasConDetailMap.get(medicition.getMedicitionName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.DRUGS.getKey()))) {
|
|
|
+ medicition.setShowInfo("1");
|
|
|
+ } else {
|
|
|
+ medicition.setShowInfo("0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ medicitionClass.setMedicitionsList(medicitionList);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- medicition.setLibType(LexiconTypeEnum.DRUGS.getKey());
|
|
|
- medicition.setType(ConceptTypeEnum.Drug.getKey());
|
|
|
- if (hasConDetailMap != null
|
|
|
- && hasConDetailMap.get(medicition.getMedicitionName()) != null
|
|
|
- && hasConDetailMap.get(medicition.getMedicitionName())
|
|
|
- .containsKey(Long.valueOf(LexiconTypeEnum.DRUGS.getKey()))) {
|
|
|
- medicition.setShowInfo("1");
|
|
|
- } else {
|
|
|
- medicition.setShowInfo("0");
|
|
|
- }
|
|
|
}
|
|
|
- medicitionClass.setMedicitionsList(medicitionList);
|
|
|
}
|
|
|
}
|
|
|
- return drugsList;
|
|
|
+ return treatmentPlanList;
|
|
|
}
|
|
|
|
|
|
@DataProvider("setAdverseReactions")
|
|
@@ -196,4 +209,4 @@ public class TreatmentAggregate {
|
|
|
}
|
|
|
return adverseReactionList;
|
|
|
}
|
|
|
-}
|
|
|
+}
|