|
@@ -25,6 +25,7 @@ import com.diagbot.vo.BillSaveVO;
|
|
|
import com.diagbot.vo.ConceptIndexVO;
|
|
|
import com.diagbot.vo.ConditionIndexVO;
|
|
|
import com.diagbot.vo.RelationIdVO;
|
|
|
+import com.diagbot.vo.RelationStatusVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -47,6 +48,8 @@ public class BillManFacade {
|
|
|
BillManRepository billManRepository;
|
|
|
@Autowired
|
|
|
DictionaryFacade dictionaryFacade;
|
|
|
+ @Autowired
|
|
|
+ BaseNodeRepository baseNodeRepository;
|
|
|
|
|
|
@Autowired
|
|
|
PacsNameRepository pacsNameRepository;
|
|
@@ -178,6 +181,14 @@ public class BillManFacade {
|
|
|
conditionIndexVO.getConditionName(),
|
|
|
100);
|
|
|
|
|
|
+ for (BillCondition condition : conditions) {
|
|
|
+ if (condition.getRange() != null && condition.getRange().equals(1)) {
|
|
|
+ Double minValue = condition.getMinValue();
|
|
|
+ condition.setMinValue(condition.getMaxValue());
|
|
|
+ condition.setMaxValue(minValue);
|
|
|
+ condition.setRange(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
return conditions;
|
|
|
}
|
|
|
|
|
@@ -242,6 +253,14 @@ public class BillManFacade {
|
|
|
billCondition.setRange(billItem.getConditionRange());
|
|
|
billCondition.setStatus(billItem.getConditionStatus());
|
|
|
|
|
|
+ //如果数值范围取区间外,大小值交换
|
|
|
+ if (billCondition.getRange() != null && billCondition.getRange().equals(1)) {
|
|
|
+ Double minValue = billCondition.getMinValue();
|
|
|
+ billCondition.setMinValue(billCondition.getMaxValue());
|
|
|
+ billCondition.setMaxValue(minValue);
|
|
|
+ billCondition.setRange(0);
|
|
|
+ }
|
|
|
+
|
|
|
if (dicTypeConvertMap.containsKey(billItem.getConceptLabel())
|
|
|
&& dicIndicationManTypeMap.containsKey(dicTypeConvertMap.get(billItem.getConceptLabel()))) {
|
|
|
billSaveVO.setType(Integer.valueOf(dicIndicationManTypeMap.get(dicTypeConvertMap.get(billItem.getConceptLabel()))));
|
|
@@ -257,6 +276,12 @@ public class BillManFacade {
|
|
|
return billSaveVO;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存
|
|
|
+ *
|
|
|
+ * @param billSaveVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public Boolean saveRecord(BillSaveVO billSaveVO) {
|
|
|
//文本类型: 开单项-[]->条件明细
|
|
|
//数值类型: 开单项-[]->开单项+禁忌+条件明细
|
|
@@ -286,7 +311,7 @@ public class BillManFacade {
|
|
|
|
|
|
//数值类型特殊处理
|
|
|
if (billSaveVO.getRuleType() != null
|
|
|
- && billSaveVO.getRuleType().equals("2")) {
|
|
|
+ && billSaveVO.getRuleType().equals(2)) {
|
|
|
BillCondition tempCondition = billSaveVO.getCondition();
|
|
|
if (tempCondition.getMinValue() != null
|
|
|
&& tempCondition.getMaxValue() != null
|
|
@@ -350,7 +375,7 @@ public class BillManFacade {
|
|
|
case "手术":
|
|
|
break;
|
|
|
case "禁忌人群":
|
|
|
- Group group=groupRepository.createOrUpdate(conditionName,
|
|
|
+ Group group = groupRepository.createOrUpdate(conditionName,
|
|
|
0,
|
|
|
Cn2SpellUtil.converterToFirstSpell(conditionName),
|
|
|
1,
|
|
@@ -376,7 +401,7 @@ public class BillManFacade {
|
|
|
case "禁忌医疗器械及物品":
|
|
|
break;
|
|
|
case "年龄":
|
|
|
- Age age=ageRepository.createOrUpdate(conditionName,
|
|
|
+ Age age = ageRepository.createOrUpdate(conditionName,
|
|
|
0,
|
|
|
Cn2SpellUtil.converterToFirstSpell(conditionName),
|
|
|
1,
|
|
@@ -420,4 +445,18 @@ public class BillManFacade {
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 启用禁用
|
|
|
+ *
|
|
|
+ * @param relationStatusVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean updateStatus(RelationStatusVO relationStatusVO) {
|
|
|
+ if (relationStatusVO.getStatus() == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入启用禁用状态");
|
|
|
+ }
|
|
|
+ baseNodeRepository.updateRelationStatusById(relationStatusVO.getRelationId(), relationStatusVO.getStatus());
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|