|
@@ -1,15 +1,20 @@
|
|
|
package com.diagbot.aggregate;
|
|
|
|
|
|
-import com.diagbot.dto.ConceptInfoDTO;
|
|
|
import com.diagbot.dto.PushBaseDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
+import com.diagbot.dto.TreatDTO;
|
|
|
+import com.diagbot.dto.TreatDetailDTO;
|
|
|
+import com.diagbot.entity.ConceptDetail;
|
|
|
+import com.diagbot.enums.ConceptTypeEnum;
|
|
|
+import com.diagbot.facade.ConceptInfoFacade;
|
|
|
import com.diagbot.facade.DiseaseConfigFacade;
|
|
|
import com.diagbot.facade.DrugConfigFacade;
|
|
|
import com.diagbot.facade.LisConfigFacade;
|
|
|
import com.diagbot.facade.OperationConfigFacade;
|
|
|
import com.diagbot.facade.PacsConfigFacade;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
-import com.diagbot.vo.PushVO;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import io.github.lvyahui8.spring.annotation.DataConsumer;
|
|
|
import io.github.lvyahui8.spring.annotation.DataProvider;
|
|
@@ -19,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -42,6 +48,8 @@ public class AssemblePushAggregate {
|
|
|
private DrugConfigFacade drugConfigFacade;
|
|
|
@Autowired
|
|
|
private OperationConfigFacade operationConfigFacade;
|
|
|
+ @Autowired
|
|
|
+ private ConceptInfoFacade conceptInfoFacade;
|
|
|
|
|
|
@DataProvider("assemblePushAll")
|
|
|
public PushDTO assemblePushAll(
|
|
@@ -52,7 +60,7 @@ public class AssemblePushAggregate {
|
|
|
@DataConsumer("retDiagMap") Map<String, List<PushBaseDTO>> retDiagMap,
|
|
|
@DataConsumer("retOperation") List<PushBaseDTO> retOperation,
|
|
|
@DataConsumer("retDrug") List<PushBaseDTO> retDrug,
|
|
|
- @DataConsumer("retGeneraTreat") List<ConceptInfoDTO> retGeneraTreat) {
|
|
|
+ @DataConsumer("retGeneraTreat") List<TreatDTO> retGeneraTreat) {
|
|
|
//检验
|
|
|
if (ListUtil.isNotEmpty(retLis)) {
|
|
|
data.setLis(retLis);
|
|
@@ -73,6 +81,10 @@ public class AssemblePushAggregate {
|
|
|
if (ListUtil.isNotEmpty(retDrug)) {
|
|
|
data.setMedicines(retDrug);
|
|
|
}
|
|
|
+ //一般治疗
|
|
|
+ if (ListUtil.isNotEmpty(retGeneraTreat)) {
|
|
|
+ data.setGeneraTreat(retGeneraTreat);
|
|
|
+ }
|
|
|
|
|
|
return data;
|
|
|
}
|
|
@@ -202,10 +214,35 @@ public class AssemblePushAggregate {
|
|
|
}
|
|
|
|
|
|
@DataProvider("retGeneraTreat")
|
|
|
- public List<ConceptInfoDTO> retGeneraTreat(@InvokeParameter("pushVO") PushVO pushVO,
|
|
|
- @InvokeParameter("hospitalId") Long hospitalId) {
|
|
|
- List<ConceptInfoDTO> retGeneraTreat = Lists.newLinkedList();
|
|
|
-
|
|
|
+ public List<TreatDTO> retGeneraTreat(@InvokeParameter("pushDTO") PushDTO pushDTO,
|
|
|
+ @InvokeParameter("hospitalId") Long hospitalId) {
|
|
|
+ List<TreatDTO> retGeneraTreat = pushDTO.getGeneraTreat();
|
|
|
+ /*TreatDTO record = new TreatDTO();
|
|
|
+ record.setUniqueName("无晶状体眼");
|
|
|
+ retGeneraTreat.add(record);*/
|
|
|
+ if (ListUtil.isNotEmpty(retGeneraTreat)) {
|
|
|
+ List<String> conceptNameList = retGeneraTreat.stream()
|
|
|
+ .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
|
|
|
+ .map(i -> i.getUniqueName())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList);
|
|
|
+ if (conceptDetailMap == null || conceptDetailMap.size() == 0) {
|
|
|
+ return retGeneraTreat;
|
|
|
+ }
|
|
|
+ for (TreatDTO treatDTO : retGeneraTreat) {
|
|
|
+ if (StringUtil.isNotBlank(treatDTO.getUniqueName())) {
|
|
|
+ String key = treatDTO.getUniqueName() + "_" + ConceptTypeEnum.getName(1);
|
|
|
+ if (conceptDetailMap.containsKey(key)) {
|
|
|
+ List<ConceptDetail> conceptDetailList = conceptDetailMap.get(key);
|
|
|
+ List<TreatDetailDTO> treatDetails = BeanUtil.listCopyTo(conceptDetailList
|
|
|
+ .stream()
|
|
|
+ .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("4"))
|
|
|
+ .collect(Collectors.toList()), TreatDetailDTO.class);
|
|
|
+ treatDTO.setDetails(treatDetails);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return retGeneraTreat;
|
|
|
}
|
|
|
-}
|
|
|
+}
|