|
@@ -73,15 +73,21 @@ public class TreatmentFacade {
|
|
|
return retMap;
|
|
|
}
|
|
|
//推荐药物
|
|
|
- List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
|
|
|
+ List<MedicitionClass> drugsList
|
|
|
+ = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
|
|
|
//不良反应
|
|
|
- List<AdverseReaction> adverseReactionList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "adverseEvent", AdverseReaction.class);
|
|
|
+ List<AdverseReaction> adverseReactionList
|
|
|
+ = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "adverseEvent", AdverseReaction.class);
|
|
|
if (ListUtil.isNotEmpty(drugsList)) {
|
|
|
//药品大类
|
|
|
- List<String> cateBigNameList = drugsList.stream().map(drugs -> drugs.getBigdrugsName()).collect(Collectors.toList());
|
|
|
+ List<String> cateBigNameList = drugsList
|
|
|
+ .stream()
|
|
|
+ .map(drugs -> drugs.getBigdrugsName()).collect(Collectors.toList());
|
|
|
conceptNameList.addAll(cateBigNameList);
|
|
|
//药品小类
|
|
|
- List<String> cateSmallNameList = drugsList.stream().map(drugs -> drugs.getSubdrugsName()).collect(Collectors.toList());
|
|
|
+ List<String> cateSmallNameList = drugsList
|
|
|
+ .stream()
|
|
|
+ .map(drugs -> drugs.getSubdrugsName()).collect(Collectors.toList());
|
|
|
conceptNameList.addAll(cateSmallNameList);
|
|
|
//药品
|
|
|
List<Medicition> medicitionTotalList = Lists.newLinkedList();
|
|
@@ -90,11 +96,15 @@ public class TreatmentFacade {
|
|
|
medicitionTotalList.addAll(medicitionClass.getMedicitionsList());
|
|
|
}
|
|
|
}
|
|
|
- List<String> drugNameList = medicitionTotalList.stream().map(m -> m.getMedicitionName()).collect(Collectors.toList());
|
|
|
+ List<String> drugNameList = medicitionTotalList
|
|
|
+ .stream()
|
|
|
+ .map(m -> m.getMedicitionName()).collect(Collectors.toList());
|
|
|
conceptNameList.addAll(drugNameList);
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(adverseReactionList)) {
|
|
|
- List<String> adNameList = adverseReactionList.stream().map(a -> a.getName()).collect(Collectors.toList());
|
|
|
+ List<String> adNameList = adverseReactionList
|
|
|
+ .stream()
|
|
|
+ .map(a -> a.getName()).collect(Collectors.toList());
|
|
|
conceptNameList.addAll(adNameList);
|
|
|
}
|
|
|
//概念
|
|
@@ -105,16 +115,22 @@ public class TreatmentFacade {
|
|
|
Map<String, Map<Long, List<ConceptDetail>>> hasConDetailMap = conceptDetailFacade.hasConDetail(conceptList);
|
|
|
|
|
|
//一般治疗&&手术治疗
|
|
|
- if (hasConDetailMap != null && hasConDetailMap.get(diseaseName) != null && ListUtil.isNotEmpty(hasConDetailMap.get(diseaseName).get(Long.valueOf(LexiconTypeEnum.DIAGNOSIS.getKey())))) {
|
|
|
- List<ConceptDetail> diseaseConDetailList = hasConDetailMap.get(diseaseName).get(Long.valueOf(LexiconTypeEnum.DIAGNOSIS.getKey()));
|
|
|
+ if (hasConDetailMap != null && hasConDetailMap.get(diseaseName) != null
|
|
|
+ && ListUtil.isNotEmpty(hasConDetailMap
|
|
|
+ .get(diseaseName)
|
|
|
+ .get(Long.valueOf(LexiconTypeEnum.DIAGNOSIS.getKey())))) {
|
|
|
+ List<ConceptDetail> diseaseConDetailList
|
|
|
+ = hasConDetailMap.get(diseaseName).get(Long.valueOf(LexiconTypeEnum.DIAGNOSIS.getKey()));
|
|
|
for (ConceptDetail conceptDetail : diseaseConDetailList) {
|
|
|
ConceptDetailDTO conceptDetailDTO = new ConceptDetailDTO();
|
|
|
List<String> positionList = Arrays.asList(conceptDetail.getPosition().split(",|,"));
|
|
|
- if (positionList.contains(String.valueOf(PositionTypeEnum.T3.getKey())) && retMap.get("commonTreatment") == null) {
|
|
|
+ if (positionList.contains(String.valueOf(PositionTypeEnum.T3.getKey()))
|
|
|
+ && retMap.get("commonTreatment") == null) {
|
|
|
BeanUtil.copyProperties(conceptDetail, conceptDetailDTO);
|
|
|
retMap.put("commonTreatment", conceptDetailDTO);
|
|
|
}
|
|
|
- if (positionList.contains(String.valueOf(PositionTypeEnum.T4.getKey())) && retMap.get("surgeryTreatment") == null) {
|
|
|
+ if (positionList.contains(String.valueOf(PositionTypeEnum.T4.getKey()))
|
|
|
+ && retMap.get("surgeryTreatment") == null) {
|
|
|
BeanUtil.copyProperties(conceptDetail, conceptDetailDTO);
|
|
|
retMap.put("surgeryTreatment", conceptDetailDTO);
|
|
|
}
|
|
@@ -126,11 +142,20 @@ public class TreatmentFacade {
|
|
|
|
|
|
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 (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()))) {
|
|
|
+ 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");
|
|
@@ -139,8 +164,13 @@ public class TreatmentFacade {
|
|
|
}
|
|
|
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 (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());
|
|
|
}
|
|
@@ -150,15 +180,23 @@ public class TreatmentFacade {
|
|
|
|
|
|
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 (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()))) {
|
|
|
+ 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");
|
|
@@ -192,15 +230,23 @@ public class TreatmentFacade {
|
|
|
retMap.put("drugHistory", null);
|
|
|
//不良反应
|
|
|
for (AdverseReaction adverseReaction : adverseReactionList) {
|
|
|
- if (conceptMap != null && conceptMap.get(adverseReaction.getName()) != null && conceptMap.get(adverseReaction.getName()).containsKey(Long.valueOf(LexiconTypeEnum.SIDE_EFFECTS.getKey()))) {
|
|
|
- Concept adConcept = conceptMap.get(adverseReaction.getName()).get(Long.valueOf(LexiconTypeEnum.SIDE_EFFECTS.getKey()));
|
|
|
+ if (conceptMap != null
|
|
|
+ && conceptMap.get(adverseReaction.getName()) != null
|
|
|
+ && conceptMap.get(adverseReaction.getName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.SIDE_EFFECTS.getKey()))) {
|
|
|
+ Concept adConcept = conceptMap
|
|
|
+ .get(adverseReaction.getName())
|
|
|
+ .get(Long.valueOf(LexiconTypeEnum.SIDE_EFFECTS.getKey()));
|
|
|
if (adConcept != null) {
|
|
|
adverseReaction.setConceptId(adConcept.getId());
|
|
|
}
|
|
|
}
|
|
|
adverseReaction.setLibType(LexiconTypeEnum.SIDE_EFFECTS.getKey());
|
|
|
adverseReaction.setType(ConceptTypeEnum.SIDE_EFFECTS.getKey());
|
|
|
- if (hasConDetailMap != null && hasConDetailMap.get(adverseReaction.getName()) != null && hasConDetailMap.get(adverseReaction.getName()).containsKey(Long.valueOf(LexiconTypeEnum.SIDE_EFFECTS.getKey()))) {
|
|
|
+ if (hasConDetailMap != null
|
|
|
+ && hasConDetailMap.get(adverseReaction.getName()) != null
|
|
|
+ && hasConDetailMap.get(adverseReaction.getName())
|
|
|
+ .containsKey(Long.valueOf(LexiconTypeEnum.SIDE_EFFECTS.getKey()))) {
|
|
|
adverseReaction.setShowInfo("1");
|
|
|
} else {
|
|
|
adverseReaction.setShowInfo("0");
|