|
@@ -28,6 +28,7 @@ import org.springframework.stereotype.Component;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Collection;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -132,7 +133,7 @@ public class MedRuleConvertFacade {
|
|
|
|
|
|
Map<String, Map<String, Map<String, List<Long>>>> lisConfigMap = lisConfigFacade.getUniqueConfigMap(hospitalId, null, null);
|
|
|
Map<String, Map<String, List<Long>>> pacsConfigMap = pacsConfigFacade.getUniqueConfigMap(hospitalId, null, null);
|
|
|
- Map<String, Map<String, Map<String, List<Long>>>> drugConfigMap = drugConfigFacade.getUniqueConfigMap(hospitalId, null, null);
|
|
|
+ Map<String, Map<String, Map<String, List<Long>>>> drugConfigMap = drugConfigFacade.getUniqueFormConfigMap(hospitalId, null, null);
|
|
|
Map<String, Map<String, List<Long>>> diseaseConfigMap = diseaseConfigFacade.getUniqueConfigMap(hospitalId, null, null);
|
|
|
Map<String, Map<String, List<Long>>> operationConfigMap = operationConfigFacade.getUniqueConfigMap(hospitalId, null, null);
|
|
|
Map<String, Map<String, List<Long>>> transfusionConfigMap = transfusionConfigFacade.getUniqueConfigMap(hospitalId, null, null);
|
|
@@ -958,8 +959,9 @@ public class MedRuleConvertFacade {
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<ResultRule> getMappingResult_medicine(ResultRule result, Map<String, Map<String,
|
|
|
- Map<String, List<Long>>>> configMap, Integer type, Integer ruleType) {
|
|
|
+ public List<ResultRule> getMappingResult_medicine(ResultRule result,
|
|
|
+ Map<String, Map<String, Map<String, List<Long>>>> configMap,
|
|
|
+ Integer type, Integer ruleType) {
|
|
|
List<ResultRule> retList = Lists.newLinkedList();
|
|
|
if (configMap == null || configMap.size() == 0) {
|
|
|
result.setSuccess(0);
|
|
@@ -979,54 +981,36 @@ public class MedRuleConvertFacade {
|
|
|
}
|
|
|
|
|
|
if (ruleType.equals(RuleTypeEnum.HighRisk.getKey())) {
|
|
|
- Map<String, Map<String, List<Long>>> hisMap = configMap.containsKey(keyName)
|
|
|
+ Map<String, Map<String, List<Long>>> formMap = configMap.containsKey(keyName)
|
|
|
? configMap.get(keyName)
|
|
|
: new HashMap<>();
|
|
|
- if (hisMap.size() > 0) {
|
|
|
- for (Map.Entry<String, Map<String, List<Long>>> hisEntry : hisMap.entrySet()) {
|
|
|
- if (result.getRuleBaseLibType().equals(LexiconEnum.Form.getKey())
|
|
|
- && StringUtil.isNotBlank(result.getRuleBaseLibName())) {
|
|
|
- if (hisEntry.getValue() == null || hisEntry.getValue().size() == 0) {
|
|
|
- ResultRule bmResult = new ResultRule();
|
|
|
- BeanUtil.copyProperties(result, bmResult);
|
|
|
- bmResult.setSuccess(0);
|
|
|
- if (type.equals(1)) {
|
|
|
- bmResult.setMessage(result.getMessage() + result.getRuleLibName() + "(" + result.getRuleLibTypeName()
|
|
|
- + ")+" + result.getRuleBaseLibName() + "(" + result.getRuleBaseLibTypeName() + ")缺少医院端映射;");
|
|
|
- } else if (type.equals(2)) {
|
|
|
- bmResult.setMessage(result.getMessage() + result.getRuleBaseLibName() + "(" + result.getRuleBaseLibTypeName() + ")缺少医院端映射;");
|
|
|
- }
|
|
|
- retList.add(bmResult);
|
|
|
- } else {
|
|
|
- ResultRule bmResult = new ResultRule();
|
|
|
- BeanUtil.copyProperties(result, bmResult);
|
|
|
- if (hisEntry.getValue().containsKey(result.getRuleBaseLibName())) {
|
|
|
- if (type.equals(1)) {
|
|
|
- bmResult.setRuleHisName(hisEntry.getKey());
|
|
|
- } else if (type.equals(2)) {
|
|
|
- bmResult.setRuleBaseHisName(hisEntry.getKey());
|
|
|
- }
|
|
|
- } else {
|
|
|
- bmResult.setSuccess(0);
|
|
|
- if (type.equals(1)) {
|
|
|
- bmResult.setMessage(result.getMessage() + result.getRuleLibName() + "(" + result.getRuleLibTypeName()
|
|
|
- + ")+" + result.getRuleBaseLibName() + "(" + result.getRuleBaseLibTypeName() + ")缺少医院端映射;");
|
|
|
- } else if (type.equals(2)) {
|
|
|
- bmResult.setMessage(result.getMessage() + result.getRuleBaseLibName() + "(" + result.getRuleBaseLibTypeName() + ")缺少医院端映射;");
|
|
|
- }
|
|
|
- }
|
|
|
- retList.add(bmResult);
|
|
|
- }
|
|
|
- } else {
|
|
|
+ if (formMap.size() > 0) {
|
|
|
+ String form = "";
|
|
|
+ if (result.getRuleBaseLibType().equals(LexiconEnum.Form.getKey())
|
|
|
+ && StringUtil.isNotBlank(result.getRuleBaseLibName())) {
|
|
|
+ form = result.getRuleBaseLibName();
|
|
|
+ }
|
|
|
+ if (formMap.containsKey(form)) {
|
|
|
+ List<String> hisNames = formMap.get(form).keySet().stream().collect(Collectors.toList());
|
|
|
+ for (String hisName : hisNames) {
|
|
|
ResultRule bmResult = new ResultRule();
|
|
|
BeanUtil.copyProperties(result, bmResult);
|
|
|
if (type.equals(1)) {
|
|
|
- bmResult.setRuleHisName(hisEntry.getKey());
|
|
|
+ bmResult.setRuleHisName(hisName);
|
|
|
} else if (type.equals(2)) {
|
|
|
- bmResult.setRuleBaseHisName(hisEntry.getKey());
|
|
|
+ bmResult.setRuleBaseHisName(hisName);
|
|
|
}
|
|
|
retList.add(bmResult);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ result.setSuccess(0);
|
|
|
+ if (type.equals(1)) {
|
|
|
+ result.setMessage(result.getMessage() + result.getRuleLibName() + "(" + result.getRuleLibTypeName()
|
|
|
+ + ")+" + result.getRuleBaseLibName() + "(" + result.getRuleBaseLibTypeName() + ")缺少医院端映射;");
|
|
|
+ } else if (type.equals(2)) {
|
|
|
+ result.setMessage(result.getMessage() + result.getRuleBaseLibName() + "(" + result.getRuleBaseLibTypeName() + ")缺少医院端映射;");
|
|
|
+ }
|
|
|
+ retList.add(result);
|
|
|
}
|
|
|
} else {
|
|
|
result.setSuccess(0);
|
|
@@ -1039,8 +1023,7 @@ public class MedRuleConvertFacade {
|
|
|
}
|
|
|
} else {
|
|
|
List<String> hisNames = configMap.containsKey(keyName)
|
|
|
- //? configMap.get(keyName).values().stream().map(i -> i.keySet()).flatMap(Collection::stream).distinct().collect(Collectors.toList())
|
|
|
- ? new ArrayList<>(configMap.get(keyName).keySet())
|
|
|
+ ? configMap.get(keyName).values().stream().map(i -> i.keySet()).flatMap(Collection::stream).distinct().collect(Collectors.toList())
|
|
|
: new ArrayList<>();
|
|
|
if (ListUtil.isNotEmpty(hisNames)) {
|
|
|
for (String hisName : hisNames) {
|