123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509 |
- package com.diagbot.facade;
- import com.diagbot.biz.push.entity.Item;
- import com.diagbot.biz.push.entity.Lis;
- import com.diagbot.client.CRFServiceClient;
- import com.diagbot.dto.WordCrfDTO;
- import com.diagbot.enums.StandConvertEnum;
- import com.diagbot.model.ai.AIAnalyze;
- import com.diagbot.model.entity.BodyPart;
- import com.diagbot.model.entity.Modification;
- import com.diagbot.model.entity.Pacs;
- import com.diagbot.model.label.ChiefLabel;
- import com.diagbot.model.label.DiagLabel;
- import com.diagbot.model.label.PacsLabel;
- import com.diagbot.model.label.PastLabel;
- import com.diagbot.model.label.PresentLabel;
- import com.diagbot.model.label.VitalLabel;
- import com.diagbot.util.CoreUtil;
- import com.diagbot.util.ListUtil;
- import com.diagbot.vo.NeoPushVO;
- import com.diagbot.vo.SearchData;
- import com.diagbot.vo.StandConvert;
- import com.diagbot.vo.neoPushEntity.ChiefPushVo;
- import com.diagbot.vo.neoPushEntity.Diag;
- import com.diagbot.vo.neoPushEntity.DiagVo;
- import com.diagbot.vo.neoPushEntity.Drug;
- import com.diagbot.vo.neoPushEntity.LisPushVo;
- import com.diagbot.vo.neoPushEntity.PresentPushVo;
- import com.diagbot.vo.neoPushEntity.Symptom;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Map;
- import java.util.stream.Collectors;
- /**
- * @Description: 通过业务facade
- * @author: zhoutg
- * @time: 2018/8/6 9:11
- */
- @Component
- public class CommonFacade {
- @Autowired
- CRFServiceClient crfServiceClient;
- @Autowired
- LisConfigFacade lisConfigFacade;
- @Autowired
- PacsConfigFacade pacsConfigFacade;
- //组装好的label
- public WordCrfDTO crf_process(SearchData searchData) {
- AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient);
- WordCrfDTO wordCrfDTO = new WordCrfDTO();
- wordCrfDTO.setHospitalId(searchData.getHospitalId());
- wordCrfDTO.setAge(searchData.getAge());
- wordCrfDTO.setSex(searchData.getSex());
- if (searchData.getDiseaseName() != null && StringUtils.isNotBlank(searchData.getDiseaseName().getName())) {
- wordCrfDTO.setDiseaseName(searchData.getDiseaseName());
- }
- if (ListUtil.isNotEmpty(searchData.getLis())) {
- wordCrfDTO.setLis(searchData.getLis());
- }
- if (ListUtil.isNotEmpty(searchData.getPacs())) {
- wordCrfDTO.setPacs(searchData.getPacs());
- }
- if (ListUtil.isNotEmpty(searchData.getDrug())) {
- wordCrfDTO.setDrug(searchData.getDrug());
- }
- if (ListUtil.isNotEmpty(searchData.getOperation())) {
- wordCrfDTO.setOperation(searchData.getOperation());
- }
- if (ListUtil.isNotEmpty(searchData.getLisOrder())) {
- wordCrfDTO.setLisOrder(searchData.getLisOrder());
- }
- if (ListUtil.isNotEmpty(searchData.getPacsOrder())) {
- wordCrfDTO.setPacsOrder(searchData.getPacsOrder());
- }
- if (ListUtil.isNotEmpty(searchData.getDrugOrder())) {
- wordCrfDTO.setDrugOrder(searchData.getDrugOrder());
- }
- if (ListUtil.isNotEmpty(searchData.getOperationOrder())) {
- wordCrfDTO.setOperationOrder(searchData.getOperationOrder());
- }
- if (ListUtil.isNotEmpty(searchData.getDiagOrder())) {
- wordCrfDTO.setDiagOrder(searchData.getDiagOrder());
- }
- if (ListUtil.isNotEmpty(searchData.getDiag())) {
- wordCrfDTO.setDiag(searchData.getDiag());
- }
- if (ListUtil.isNotEmpty(searchData.getTransfusionOrder())) {
- wordCrfDTO.setTransfusionOrder(searchData.getTransfusionOrder());
- }
- //模型处理数据
- aiAnalyze.aiProcess(searchData, wordCrfDTO);
- // 处理现病史中的化验和辅检,放入结构化
- processPresentLisPacs(wordCrfDTO);
- return wordCrfDTO;
- }
- //返回给图谱的词,这些词需要转换成标准词
- public StandConvert dataTypeGet(WordCrfDTO wordCrfDTO) {
- StandConvert standConvert = new StandConvert();
- //所有的症状(主诉、现病史)
- List<String> clinicalList = new ArrayList<>();
- ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
- clinicalList.addAll(CoreUtil.getPropertyList(chiefLabel.getClinicals()));
- PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
- clinicalList.addAll(CoreUtil.getPropertyList(presentLabel.getClinicals()));
- standConvert.setClinicalList(clinicalList);
- //所有的疾病(主诉、现病史,诊断,既往史,下的诊断)
- DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
- PastLabel pastLabel = wordCrfDTO.getPastLabel();
- List<String> diagList = new ArrayList<>();
- diagList.addAll(CoreUtil.getPropertyList(chiefLabel.getDiags()));
- diagList.addAll(CoreUtil.getPropertyList(presentLabel.getDiags()));
- diagList.addAll(CoreUtil.getPropertyList(diagLabel.getDiags()));
- diagList.addAll(CoreUtil.getPropertyList(pastLabel.getDiags()));
- //下的诊断
- diagList.addAll(wordCrfDTO.getDiagOrder().stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
- .map(x -> x.getName()).collect(Collectors.toList()));
- //传的诊断
- diagList.addAll(wordCrfDTO.getDiag().stream().filter(x ->
- StringUtils.isBlank(x.getUniqueName()))
- .map(x -> x.getName()).collect(Collectors.toList()));
- //选中的诊断
- if(wordCrfDTO.getDiseaseName() != null && StringUtils.isBlank(wordCrfDTO.getDiseaseName().getUniqueName())){
- diagList.add(wordCrfDTO.getDiseaseName().getName());
- }
- standConvert.setDiaglList(diagList);
- //所有化验(结构化数据)
- List<String> allLis = new ArrayList<>();
- //普通化验
- List<Lis> lis = wordCrfDTO.getLis();
- if (ListUtil.isNotEmpty(lis)) {
- List<String> lis_unique = lis.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
- .map(x -> x.getName() + x.getDetailName()).collect(Collectors.toList());
- allLis.addAll(lis_unique);
- }
- //开单化验
- List<Lis> lisOrder = wordCrfDTO.getLisOrder();
- if (ListUtil.isNotEmpty(lisOrder)) {
- List<String> lis_unique = lisOrder.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
- .map(x -> x.getName() + x.getDetailName()).collect(Collectors.toList());
- allLis.addAll(lis_unique);
- }
- standConvert.setLisList(allLis);
- //所有辅助项目(结构化数据)
- List<String> allPacs = new ArrayList<>();
- List<Item> pacsList = wordCrfDTO.getPacsLabel().getItem();
- if (ListUtil.isNotEmpty(pacsList)) {
- List<String> pacss_unique = pacsList.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
- .map(x -> x.getName()).collect(Collectors.toList());
- allPacs.addAll(pacss_unique);
- }
- // List<PacsNew> pacsNews = wordCrfDTO.getPacsLabel().getPacsNewList();
- // if (ListUtil.isNotEmpty(pacsNews)) {
- // List<String> pacss_unique = pacsNews.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
- // .map(x -> x.getName()).collect(Collectors.toList());
- // allPacs.addAll(pacss_unique);
- // }
- allPacs.addAll(wordCrfDTO.getPacs().stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
- .map(x -> x.getName()).collect(Collectors.toList()));
- //开单检查
- allPacs.addAll(wordCrfDTO.getPacsOrder().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x -> x.getName()).collect(Collectors.toList()));
- standConvert.setPacsList(allPacs);
- //所有药品(现病史、既往史)
- List<String> drugList = new ArrayList<>();
- //1、现病史中的药品
- drugList.addAll(CoreUtil.getPropertyList(presentLabel.getMedicines()));
- drugList.addAll(CoreUtil.getPropertyList(presentLabel.getTakeMedicine()));
- //2、既往史(药物过敏)
- drugList.addAll(CoreUtil.getPropertyList(pastLabel.getAllergyMedicines()));
- //3、开单药品
- drugList.addAll(wordCrfDTO.getDrugOrder().stream().filter(z ->StringUtils.isBlank(z.getUniqueName())).map(x ->x.getName()).collect(Collectors.toList()));
- standConvert.setDrugList(drugList);
- //4、医嘱药品
- drugList.addAll(wordCrfDTO.getDrug().stream().filter(z ->StringUtils.isBlank(z.getUniqueName())).map(x ->x.getName()).collect(Collectors.toList()));
- standConvert.setDrugList(drugList);
- //所有手术(现病史、既往史)
- List<String> operationList = new ArrayList<>();
- //1、现病史中的手术
- operationList.addAll(CoreUtil.getPropertyList(presentLabel.getOperations()));
- //2、既往史中的手术
- operationList.addAll(CoreUtil.getPropertyList(pastLabel.getOperations()));
- //3.开单手术
- operationList.addAll(wordCrfDTO.getOperationOrder().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x ->x.getName()).collect(Collectors.toList()));
- standConvert.setOperationList(operationList);
- //4.手术及操作
- operationList.addAll(wordCrfDTO.getOperation().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x ->x.getName()).collect(Collectors.toList()));
- standConvert.setOperationList(operationList);
- //所有体征
- List<String> vitalList = new ArrayList<>();
- VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
- vitalList.addAll(CoreUtil.getPropertyList(vitalLabel.getVitals()));
- standConvert.setVitalList(vitalList);
- // 输血
- List<String> transfusionList = new ArrayList<>();
- if (ListUtil.isNotEmpty(wordCrfDTO.getTransfusionOrder())) {
- transfusionList.addAll(wordCrfDTO.getTransfusionOrder().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x -> x.getName()).collect(Collectors.toList()));
- }
- standConvert.setTransfusionList(transfusionList);
- return standConvert;
- }
- //把图谱返回的标准词set到label中
- public void dataTypeSet(WordCrfDTO wordCrfDTO, Map<String, Map<String, String>> map) {
- ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
- PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
- PastLabel pastLabel = wordCrfDTO.getPastLabel();
- DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
- List<Lis> lis = wordCrfDTO.getLis();
- List<Item> pacsList = wordCrfDTO.getPacsLabel().getItem();
- VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
- //症状回填
- CoreUtil.setPropertyList(chiefLabel.getClinicals(), map.get(StandConvertEnum.symptom.getName()));
- CoreUtil.setPropertyList(presentLabel.getClinicals(), map.get(StandConvertEnum.symptom.getName()));
- //诊断回填
- CoreUtil.setPropertyList(diagLabel.getDiags(), map.get(StandConvertEnum.disease.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getDiagOrder(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getDiag(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getDiseaseName(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
- //药品回填
- CoreUtil.setPropertyList(presentLabel.getMedicines(), map.get(StandConvertEnum.drug.getName()));
- CoreUtil.setPropertyList(presentLabel.getTakeMedicine(), map.get(StandConvertEnum.drug.getName()));
- CoreUtil.setPropertyList(pastLabel.getAllergyMedicines(), map.get(StandConvertEnum.drug.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getDrugOrder(),"name", "uniqueName", map.get(StandConvertEnum.drug.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getDrug(),"name", "uniqueName", map.get(StandConvertEnum.drug.getName()));
- //化验回填
- CoreUtil.setPropertyList(lis, "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getLisOrder(), "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
- //辅助检查回填
- CoreUtil.setPropertyList(pacsList, "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getPacs(), "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getPacsOrder(), "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
- //体征回填
- CoreUtil.setPropertyList(vitalLabel.getVitals(), map.get(StandConvertEnum.vital.getName()));
- //手术回填
- CoreUtil.setPropertyList(presentLabel.getOperations(), map.get(StandConvertEnum.operation.getName()));
- CoreUtil.setPropertyList(pastLabel.getOperations(), map.get(StandConvertEnum.operation.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getOperationOrder(), "name", "uniqueName",map.get(StandConvertEnum.operation.getName()));
- CoreUtil.setPropertyList(wordCrfDTO.getOperation(), "name", "uniqueName",map.get(StandConvertEnum.operation.getName()));
- //输血回填
- CoreUtil.setPropertyList(wordCrfDTO.getTransfusionOrder(), "name", "uniqueName",map.get(StandConvertEnum.transfusion.getName()));
- }
- /**
- * 生成给图谱的入参(推送)
- */
- public NeoPushVO generatePushInput(WordCrfDTO wordCrfDTO) {
- NeoPushVO pushVO = new NeoPushVO();
- ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
- PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
- List<Item> diags = wordCrfDTO.getDiag();
- Item diseaseName = wordCrfDTO.getDiseaseName();
- PastLabel pastLabel = wordCrfDTO.getPastLabel();
- List<Lis> lis = wordCrfDTO.getLis();
- // List<Pacs> pacs = wordCrfDTO.getPacs();
- // TODO 辅检
- // List<PacsNew> pacsNewList = wordCrfDTO.getPacsLabel().getPacsNewList();
- pushVO.setAge(wordCrfDTO.getAge());
- pushVO.setSex(wordCrfDTO.getSex());
- pushVO.setDiaeaseName(diseaseName);
- if (chiefLabel != null) {
- if(ListUtil.isNotEmpty(chiefLabel.getClinicals())){
- List<Symptom> cjiefClinicals = chiefLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
- {
- Symptom symptom = new Symptom();
- symptom.setName(z.getStandName());
- return symptom;
- }).collect(Collectors.toList());
- if (ListUtil.isNotEmpty(cjiefClinicals)) {
- ChiefPushVo chiefPushVo = new ChiefPushVo();
- chiefPushVo.setSymptoms(cjiefClinicals);
- pushVO.setChiefPushVo(chiefPushVo);
- }
- }
- }
- if(presentLabel != null){
- PresentPushVo presentPushVo = new PresentPushVo();
- if(ListUtil.isNotEmpty(presentLabel.getClinicals())){
- List<Symptom> presentClinicals = presentLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
- {
- Symptom symptom = new Symptom();
- symptom.setName(z.getStandName());
- return symptom;
- }).collect(Collectors.toList());
- presentPushVo.setSymptoms(presentClinicals);
- }
- if(ListUtil.isNotEmpty(presentLabel.getDiags())){
- List<Diag> presentdiags = presentLabel.getDiags().stream().filter(x -> x.getNegative() == null).map(z ->
- {
- Diag diag = new Diag();
- diag.setName(z.getStandName());
- return diag;
- }).collect(Collectors.toList());
- presentPushVo.setDiags(presentdiags);
- }
- if(ListUtil.isNotEmpty(presentLabel.getMedicines())){
- List<Drug> presentdrugs = presentLabel.getMedicines().stream().filter(x -> x.getNegative() == null).map(z ->
- {
- Drug drug = new Drug();
- drug.setName(z.getStandName());
- return drug;
- }).collect(Collectors.toList());
- presentPushVo.setDrugs(presentdrugs);
- }
- pushVO.setPresentPushVo(presentPushVo);
- }
- if(ListUtil.isNotEmpty(lis)){
- LisPushVo lisPushVo = new LisPushVo();
- lisPushVo.setLises(lis);
- pushVO.setLisPushVo(lisPushVo);
- }
- // TODO 辅检
- // if(ListUtil.isNotEmpty(pacsNewList)){
- // PacsPushVo pacsPushVo = new PacsPushVo();
- // pacsPushVo.setPacs(pacsNewList);
- // pushVO.setPacsPushVo(pacsPushVo);
- // }
- if(ListUtil.isNotEmpty(diags)){
- DiagVo diagVo = new DiagVo();
- List<Diag> diseases = diags.stream().map(x -> {
- Diag diag = new Diag();
- diag.setName(x.getUniqueName());
- return diag;
- }).collect(Collectors.toList());
- diagVo.setDiags(diseases);
- pushVO.setDiagVo(diagVo);
- }
- return pushVO;
- }
- public void processPresentLisPacs(WordCrfDTO wordCrfDTO){
- PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
- List<com.diagbot.model.entity.Lis> lises = presentLabel.getLises();
- List<Lis> lisList = new ArrayList<>();
- if(ListUtil.isNotEmpty(lises)){
- List<String> lisNames = lises.stream().map(x -> x.getBigItem().getName()).distinct().collect(Collectors.toList());
- Map<String, Map<String, Map<String, Long>>> configMap = lisConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), lisNames, null);
- if(configMap.size() > 0){
- lises.stream().forEach(x ->{
- String bigName = x.getBigItem().getName();//大项名
- String detailName = x.getName();//小项名
- String value = x.getPd().getValue();
- String unit = x.getPd().getUnit();
- if(configMap.containsKey(bigName)){
- Map<String, Map<String, Long>> uniqueDetailMap = configMap.get(bigName);
- if(uniqueDetailMap.containsKey(detailName)){
- List<String> uniques = uniqueDetailMap.get(detailName).keySet().stream().collect(Collectors.toList());//所有的公表项
- if(ListUtil.isNotEmpty(uniques)){
- List<Lis> lisStream = uniques.stream().map(z -> {
- return getLis(bigName, detailName, value, unit, z);
- }).collect(Collectors.toList());
- lisList.addAll(lisStream);
- }
- }else {
- Lis lis = getLis(bigName, detailName, value, unit, null);
- lisList.add(lis);
- }
- }else {
- Lis lis = getLis(bigName, detailName, value, unit, null);
- lisList.add(lis);
- }
- });
- }else {
- lises.stream().forEach(x ->{
- Lis lis = getLis(x.getBigItem().getName(), x.getName(), x.getPd().getValue(), x.getPd().getUnit(), null);
- lisList.add(lis);
- });
- }
- }
- wordCrfDTO.getLis().addAll(lisList);
- // 处理辅检信息,将现病史和结构化辅检统一放到pacsLable中
- PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
- List<Item> pacsResList = pacsLabel.getRes();
- PacsLabel pacsPresentLabel = wordCrfDTO.getPresentLabel().getPacsLabel();
- if (pacsPresentLabel != null) {
- // 添加辅检项目名称
- if (ListUtil.isNotEmpty(pacsPresentLabel.getItem())) {
- pacsLabel.getItem().addAll(pacsPresentLabel.getItem());
- }
- // 添加辅检的诊断
- if (ListUtil.isNotEmpty(pacsPresentLabel.getDisease())) {
- pacsLabel.getDisease().addAll(pacsPresentLabel.getDisease());
- }
- // 添加辅检的描述
- if (ListUtil.isNotEmpty(pacsPresentLabel.getPacsResults())) {
- pacsLabel.getPacsResults().addAll(pacsPresentLabel.getPacsResults());
- }
- }
- if (ListUtil.isNotEmpty(pacsLabel.getDisease())) {
- for (Pacs pacs : pacsLabel.getDisease()) {
- Item item = new Item();
- item.setName(pacs.getName());
- item.setUniqueName(pacs.getStandName());
- pacsResList.add(item);
- }
- }
- // 添加辅检的描述
- if (ListUtil.isNotEmpty(pacsLabel.getPacsResults())) {
- for (Pacs pacs : pacsLabel.getPacsResults()) {
- Item item = new Item();
- item.setName(pacs.getName());
- item.setUniqueName(pacs.getStandName());
- pacsResList.add(item);
- // 部位 + 描述循环放入
- for (BodyPart bodyPart : pacs.getBodyPartList()) {
- Item itemPart = new Item();
- itemPart.setName(bodyPart.getName() + pacs.getName());
- itemPart.setUniqueName(bodyPart.getStandName() + pacs.getStandName());
- pacsResList.add(itemPart);
- }
- // 描述 + 修饰循环放入
- for (Modification modification : pacs.getModification()) {
- Item itemModification = new Item();
- itemModification.setName(pacs.getName() + modification.getName());
- itemModification.setUniqueName(pacs.getStandName() + modification.getStandName());
- pacsResList.add(itemModification);
- }
- }
- }
- //处理辅检
- // List<com.diagbot.biz.push.entity.Pacs> pacs = new ArrayList<>();
- // List<PacsNew> packagePacs = new ArrayList<>();
- // List<PacsNew> pacsNewList = wordCrfDTO.getPresentLabel().getPacsNewList();
- // if(ListUtil.isNotEmpty(pacsNewList)){
- // List<String> pacsNames = pacsNewList.stream().map(x -> x.getName()).collect(Collectors.toList());
- // Map<String, Map<String, Long>> configMap = pacsConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), pacsNames, null);
- // if(configMap.size() > 0){
- // pacsNewList.stream().forEach(pacsNew ->{
- // String name = pacsNew.getName();
- // List<Pacs> disease = pacsNew.getDisease();
- // List<Pacs> pacsResults = pacsNew.getPacsResults();
- // if(configMap.containsKey(name)){
- // Map<String, Long> uinqueNameMap = configMap.get(name);
- // List<PacsNew> collect = uinqueNameMap.keySet().stream().map(x -> {
- // PacsNew pan = new PacsNew();
- // pan.setName(name);
- // pan.setUniqueName(x);
- // pan.setPacsResults(pacsResults);
- // pan.setDisease(disease);
- // return pan;
- // }).collect(Collectors.toList());
- // packagePacs.addAll(collect);
- // collect.forEach(x ->{
- // com.diagbot.biz.push.entity.Pacs p = new com.diagbot.biz.push.entity.Pacs();
- // p.setName(x.getName());
- // p.setUniqueName(x.getUniqueName());
- // pacs.add(p);
- // });
- // }else {
- // PacsNew pan = new PacsNew();
- // pan.setName(name);
- // pan.setPacsResults(pacsResults);
- // pan.setDisease(disease);
- // packagePacs.add(pan);
- // com.diagbot.biz.push.entity.Pacs p = new com.diagbot.biz.push.entity.Pacs();
- // p.setName(name);
- // pacs.add(p);
- // }
- // });
- // }else {
- // packagePacs.addAll(pacsNewList);
- // pacsNewList.forEach(x ->{
- // com.diagbot.biz.push.entity.Pacs p = new com.diagbot.biz.push.entity.Pacs();
- // p.setName(x.getName());
- // pacs.add(p);
- // });
- // }
- // }
- // if(ListUtil.isNotEmpty(pacs)){
- // wordCrfDTO.getPacs().addAll(pacs);
- // }
- // pacsLabel.getPacsNewList().addAll(packagePacs);
- }
- private Lis getLis(String bigName, String detailName, String value, String unit, String uniqueName) {
- Lis lis = new Lis();
- lis.setUnits(unit);
- if(StringUtils.isBlank(unit)){
- lis.setOtherValue(value);
- }else {
- lis.setValue(Double.parseDouble(value));
- }
- lis.setDetailName(detailName);
- lis.setName(bigName);
- lis.setUniqueName(uniqueName);
- return lis;
- }
- }
|