|
@@ -75,6 +75,7 @@ public class CommonFacade {
|
|
}
|
|
}
|
|
aiAnalyze.aiProcess(searchData, wordCrfDTO);
|
|
aiAnalyze.aiProcess(searchData, wordCrfDTO);
|
|
|
|
|
|
|
|
+ // 处理现病史中的化验和辅检,放入结构化
|
|
processPresentLisPacs(wordCrfDTO);
|
|
processPresentLisPacs(wordCrfDTO);
|
|
return wordCrfDTO;
|
|
return wordCrfDTO;
|
|
}
|
|
}
|
|
@@ -133,6 +134,8 @@ public class CommonFacade {
|
|
.map(x -> x.getName()).collect(Collectors.toList());
|
|
.map(x -> x.getName()).collect(Collectors.toList());
|
|
allPacs.addAll(pacss_unique);
|
|
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()));
|
|
allPacs.addAll(wordCrfDTO.getPacsOrder().stream().filter(z -> StringUtils.isBlank(z.getUniqueName())).map(x -> x.getName()).collect(Collectors.toList()));
|
|
standConvert.setPacsList(allPacs);
|
|
standConvert.setPacsList(allPacs);
|
|
@@ -140,6 +143,7 @@ public class CommonFacade {
|
|
List<String> drugList = new ArrayList<>();
|
|
List<String> drugList = new ArrayList<>();
|
|
//1、现病史中的药品
|
|
//1、现病史中的药品
|
|
drugList.addAll(CoreUtil.getPropertyList(presentLabel.getMedicines()));
|
|
drugList.addAll(CoreUtil.getPropertyList(presentLabel.getMedicines()));
|
|
|
|
+ drugList.addAll(CoreUtil.getPropertyList(presentLabel.getTakeMedicine()));
|
|
//2、既往史(药物过敏)
|
|
//2、既往史(药物过敏)
|
|
drugList.addAll(CoreUtil.getPropertyList(pastLabel.getAllergyMedicines()));
|
|
drugList.addAll(CoreUtil.getPropertyList(pastLabel.getAllergyMedicines()));
|
|
//3、开单药品
|
|
//3、开单药品
|
|
@@ -191,6 +195,7 @@ public class CommonFacade {
|
|
CoreUtil.setPropertyList(wordCrfDTO.getDiag(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
|
|
CoreUtil.setPropertyList(wordCrfDTO.getDiag(),"name", "uniqueName", map.get(StandConvertEnum.disease.getName()));
|
|
//药品回填
|
|
//药品回填
|
|
CoreUtil.setPropertyList(presentLabel.getMedicines(), map.get(StandConvertEnum.drug.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(pastLabel.getAllergyMedicines(), map.get(StandConvertEnum.drug.getName()));
|
|
CoreUtil.setPropertyList(wordCrfDTO.getDrugOrder(),"name", "uniqueName", map.get(StandConvertEnum.drug.getName()));
|
|
CoreUtil.setPropertyList(wordCrfDTO.getDrugOrder(),"name", "uniqueName", map.get(StandConvertEnum.drug.getName()));
|
|
//化验回填
|
|
//化验回填
|
|
@@ -198,6 +203,7 @@ public class CommonFacade {
|
|
CoreUtil.setPropertyList(wordCrfDTO.getLisOrder(), "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
|
|
CoreUtil.setPropertyList(wordCrfDTO.getLisOrder(), "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
|
|
//辅助检查回填
|
|
//辅助检查回填
|
|
CoreUtil.setPropertyList(pacsNews, "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
|
|
CoreUtil.setPropertyList(pacsNews, "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(wordCrfDTO.getPacsOrder(), "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
|
|
//体征回填
|
|
//体征回填
|
|
CoreUtil.setPropertyList(vitalLabel.getVitals(), map.get(StandConvertEnum.vital.getName()));
|
|
CoreUtil.setPropertyList(vitalLabel.getVitals(), map.get(StandConvertEnum.vital.getName()));
|
|
@@ -297,7 +303,6 @@ public class CommonFacade {
|
|
Map<String, Map<String, Map<String, Long>>> configMap = lisConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), lisNames, null);
|
|
Map<String, Map<String, Map<String, Long>>> configMap = lisConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), lisNames, null);
|
|
if(configMap.size() > 0){
|
|
if(configMap.size() > 0){
|
|
lises.stream().forEach(x ->{
|
|
lises.stream().forEach(x ->{
|
|
-
|
|
|
|
String bigName = x.getBigItem().getName();//大项名
|
|
String bigName = x.getBigItem().getName();//大项名
|
|
String detailName = x.getName();//小项名
|
|
String detailName = x.getName();//小项名
|
|
String value = x.getPd().getValue();
|
|
String value = x.getPd().getValue();
|
|
@@ -305,38 +310,31 @@ public class CommonFacade {
|
|
if(configMap.containsKey(bigName)){
|
|
if(configMap.containsKey(bigName)){
|
|
Map<String, Map<String, Long>> uniqueDetailMap = configMap.get(bigName);
|
|
Map<String, Map<String, Long>> uniqueDetailMap = configMap.get(bigName);
|
|
if(uniqueDetailMap.containsKey(detailName)){
|
|
if(uniqueDetailMap.containsKey(detailName)){
|
|
-
|
|
|
|
List<String> uniques = uniqueDetailMap.get(detailName).keySet().stream().collect(Collectors.toList());//所有的公表项
|
|
List<String> uniques = uniqueDetailMap.get(detailName).keySet().stream().collect(Collectors.toList());//所有的公表项
|
|
if(ListUtil.isNotEmpty(uniques)){
|
|
if(ListUtil.isNotEmpty(uniques)){
|
|
List<Lis> lisStream = uniques.stream().map(z -> {
|
|
List<Lis> lisStream = uniques.stream().map(z -> {
|
|
- Lis lis = new Lis();
|
|
|
|
- lis.setDetailName(detailName);
|
|
|
|
- lis.setName(bigName);
|
|
|
|
- lis.setUniqueName(z);
|
|
|
|
- lis.setValue(Double.parseDouble(value));
|
|
|
|
- lis.setUnits(unit);
|
|
|
|
- return lis;
|
|
|
|
|
|
+ return getLis(bigName, detailName, value, unit, z);
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
lisList.addAll(lisStream);
|
|
lisList.addAll(lisStream);
|
|
}
|
|
}
|
|
-
|
|
|
|
}else {
|
|
}else {
|
|
- Lis lis = getLis(bigName, detailName, value, unit);
|
|
|
|
|
|
+ Lis lis = getLis(bigName, detailName, value, unit, null);
|
|
lisList.add(lis);
|
|
lisList.add(lis);
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- Lis lis = getLis(bigName, detailName, value, unit);
|
|
|
|
|
|
+ Lis lis = getLis(bigName, detailName, value, unit, null);
|
|
lisList.add(lis);
|
|
lisList.add(lis);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}else {
|
|
}else {
|
|
lises.stream().forEach(x ->{
|
|
lises.stream().forEach(x ->{
|
|
- Lis lis = getLis(x.getBigItem().getName(), x.getName(), x.getPd().getValue(), x.getPd().getUnit());
|
|
|
|
|
|
+ Lis lis = getLis(x.getBigItem().getName(), x.getName(), x.getPd().getValue(), x.getPd().getUnit(), null);
|
|
lisList.add(lis);
|
|
lisList.add(lis);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//处理辅检
|
|
//处理辅检
|
|
|
|
+ List<com.diagbot.biz.push.entity.Pacs> pacs = new ArrayList<>();
|
|
List<PacsNew> packagePacs = new ArrayList<>();
|
|
List<PacsNew> packagePacs = new ArrayList<>();
|
|
List<PacsNew> pacsNewList = wordCrfDTO.getPresentLabel().getPacsNewList();
|
|
List<PacsNew> pacsNewList = wordCrfDTO.getPresentLabel().getPacsNewList();
|
|
if(ListUtil.isNotEmpty(pacsNewList)){
|
|
if(ListUtil.isNotEmpty(pacsNewList)){
|
|
@@ -358,26 +356,53 @@ public class CommonFacade {
|
|
return pan;
|
|
return pan;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
packagePacs.addAll(collect);
|
|
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 {
|
|
}else {
|
|
packagePacs.addAll(pacsNewList);
|
|
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);
|
|
|
|
+ }
|
|
|
|
+
|
|
wordCrfDTO.getLis().addAll(lisList);
|
|
wordCrfDTO.getLis().addAll(lisList);
|
|
- wordCrfDTO.setLis(wordCrfDTO.getLis());
|
|
|
|
|
|
|
|
PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
pacsLabel.getPacsNewList().addAll(packagePacs);
|
|
pacsLabel.getPacsNewList().addAll(packagePacs);
|
|
- wordCrfDTO.setPacsLabel(pacsLabel);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private Lis getLis(String bigName, String detailName, String value, String unit) {
|
|
|
|
|
|
+ private Lis getLis(String bigName, String detailName, String value, String unit, String uniqueName) {
|
|
Lis lis = new Lis();
|
|
Lis lis = new Lis();
|
|
lis.setUnits(unit);
|
|
lis.setUnits(unit);
|
|
- lis.setValue(Double.parseDouble(value));
|
|
|
|
|
|
+ if(StringUtils.isBlank(unit)){
|
|
|
|
+ lis.setOtherValue(value);
|
|
|
|
+ }else {
|
|
|
|
+ lis.setValue(Double.parseDouble(value));
|
|
|
|
+ }
|
|
lis.setDetailName(detailName);
|
|
lis.setDetailName(detailName);
|
|
lis.setName(bigName);
|
|
lis.setName(bigName);
|
|
|
|
+ lis.setUniqueName(uniqueName);
|
|
return lis;
|
|
return lis;
|
|
}
|
|
}
|
|
}
|
|
}
|