|
@@ -1,11 +1,16 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.diagbot.dto.BillMsg;
|
|
|
import com.diagbot.dto.MedClassMedDTO;
|
|
|
import com.diagbot.dto.RuleDTO;
|
|
|
import com.diagbot.entity.ResultBill;
|
|
|
+import com.diagbot.enums.GraphLabelEnum;
|
|
|
import com.diagbot.enums.LexiconEnum;
|
|
|
+import com.diagbot.enums.RuleBaseTypeEnum;
|
|
|
+import com.diagbot.enums.TypeEnum;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.MsgUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.RuleVO;
|
|
|
import com.google.common.collect.Lists;
|
|
@@ -15,7 +20,6 @@ import org.springframework.stereotype.Component;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
-import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -47,7 +51,13 @@ public class MedRuleConvertFacade {
|
|
|
@Autowired
|
|
|
private TransfusionConfigFacade transfusionConfigFacade;
|
|
|
|
|
|
- public List<ResultBill> billCommonConvert(Long hospitalId) {
|
|
|
+ /**
|
|
|
+ * 开单规则处理
|
|
|
+ * @param hospitalId
|
|
|
+ * @param billType 1:通用开单,2:输血开单
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ResultBill> billConvert(Long hospitalId,Integer billType) {
|
|
|
List<ResultBill> retList = Lists.newLinkedList();
|
|
|
List<ResultBill> inputList = Lists.newLinkedList();
|
|
|
List<ResultBill> medicineList = Lists.newLinkedList();
|
|
@@ -56,12 +66,17 @@ public class MedRuleConvertFacade {
|
|
|
|
|
|
RuleVO ruleVO = new RuleVO();
|
|
|
ruleVO.setRuleType(1);
|
|
|
- ruleVO.setLibTypes(Arrays.asList(new Integer[] { LexiconEnum.Medicine.getKey(),
|
|
|
- LexiconEnum.Operation.getKey(),
|
|
|
- LexiconEnum.LisName.getKey(),
|
|
|
- LexiconEnum.PacsName.getKey(),
|
|
|
- LexiconEnum.PacsSubName.getKey() }));
|
|
|
-
|
|
|
+ if (billType != null) {
|
|
|
+ if (billType.equals(1)) {
|
|
|
+ ruleVO.setLibTypes(Arrays.asList(new Integer[] { LexiconEnum.Medicine.getKey(),
|
|
|
+ LexiconEnum.Operation.getKey(),
|
|
|
+ LexiconEnum.LisName.getKey(),
|
|
|
+ LexiconEnum.PacsName.getKey(),
|
|
|
+ LexiconEnum.PacsSubName.getKey() }));
|
|
|
+ } else if (billType.equals(2)) {
|
|
|
+ ruleVO.setLibTypes(Arrays.asList(new Integer[] { LexiconEnum.Transfusion.getKey() }));
|
|
|
+ }
|
|
|
+ }
|
|
|
List<RuleDTO> list = klRuleFacade.getRules(ruleVO);
|
|
|
|
|
|
if (ListUtil.isEmpty(list)) {
|
|
@@ -73,6 +88,7 @@ public class MedRuleConvertFacade {
|
|
|
Map<String, Map<String, Map<String, List<Long>>>> drugConfigMap = drugConfigFacade.getUniqueConfigMap(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);
|
|
|
|
|
|
for (RuleDTO record : list) {
|
|
|
ResultBill resultBill = new ResultBill();
|
|
@@ -101,6 +117,8 @@ public class MedRuleConvertFacade {
|
|
|
if (record.getRuleBaseMaxValue() >= record.getRuleBaseMinValue()) {
|
|
|
ResultBill valResult = new ResultBill();
|
|
|
BeanUtil.copyProperties(resultBill, valResult);
|
|
|
+ valResult.setMinValue(new BigDecimal(record.getRuleBaseMinValue()));
|
|
|
+ valResult.setMaxValue(new BigDecimal(record.getRuleBaseMaxValue()));
|
|
|
valResult.setInputValue(random(new BigDecimal(record.getRuleBaseMinValue()),
|
|
|
new BigDecimal(record.getRuleBaseMaxValue()),
|
|
|
(record.getRuleBaseMaxOperator().equals("<=") ? true : false),
|
|
@@ -109,47 +127,54 @@ public class MedRuleConvertFacade {
|
|
|
: (StringUtil.isNotBlank(record.getRuleBaseMaxUnit()) ? record.getRuleBaseMaxUnit() : ""));
|
|
|
inputList.add(valResult);
|
|
|
} else {
|
|
|
- ResultBill minResult = new ResultBill();
|
|
|
- BeanUtil.copyProperties(resultBill, minResult);
|
|
|
- minResult.setConflictItemRange(1);
|
|
|
- minResult.setInputValue(random(null,
|
|
|
- new BigDecimal(record.getRuleBaseMinValue()),
|
|
|
- false,
|
|
|
- (record.getRuleBaseMinOperator().equals(">=") ? true : false)).toString());
|
|
|
- minResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMinUnit()) ? record.getRuleBaseMinUnit() : "");
|
|
|
- inputList.add(minResult);
|
|
|
-
|
|
|
- ResultBill maxResult = new ResultBill();
|
|
|
- BeanUtil.copyProperties(resultBill, maxResult);
|
|
|
- maxResult.setConflictItemRange(1);
|
|
|
- maxResult.setInputValue(random(new BigDecimal(record.getRuleBaseMaxValue()),
|
|
|
+ //大于最小值inputValue>minValue
|
|
|
+ ResultBill gtResult = new ResultBill();
|
|
|
+ BeanUtil.copyProperties(resultBill, gtResult);
|
|
|
+ gtResult.setMinValue(new BigDecimal(record.getRuleBaseMinValue()));
|
|
|
+ gtResult.setInputValue(random(new BigDecimal(record.getRuleBaseMinValue()),
|
|
|
null,
|
|
|
- (record.getRuleBaseMaxOperator().equals("<=") ? true : false),
|
|
|
+ (record.getRuleBaseMinOperator().equals(">=") ? true : false),
|
|
|
false).toString());
|
|
|
- maxResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMaxUnit()) ? record.getRuleBaseMaxUnit() : "");
|
|
|
- inputList.add(maxResult);
|
|
|
+ gtResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMinUnit()) ? record.getRuleBaseMinUnit() : "");
|
|
|
+ inputList.add(gtResult);
|
|
|
+
|
|
|
+ //小于最大值inputValue<maxValue
|
|
|
+ ResultBill ltResult = new ResultBill();
|
|
|
+ BeanUtil.copyProperties(resultBill, ltResult);
|
|
|
+ //inputValue>minValue
|
|
|
+ ltResult.setMaxValue(new BigDecimal(record.getRuleBaseMaxValue()));
|
|
|
+ ltResult.setInputValue(random(null,
|
|
|
+ new BigDecimal(record.getRuleBaseMaxValue()),
|
|
|
+ false,
|
|
|
+ (record.getRuleBaseMaxOperator().equals("<=") ? true : false)).toString());
|
|
|
+ ltResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMaxUnit()) ? record.getRuleBaseMaxUnit() : "");
|
|
|
+ inputList.add(ltResult);
|
|
|
}
|
|
|
} else if (StringUtil.isNotBlank(record.getRuleBaseMinOperator())
|
|
|
&& StringUtil.isBlank(record.getRuleBaseMaxOperator())) {
|
|
|
- ResultBill minResult = new ResultBill();
|
|
|
- BeanUtil.copyProperties(resultBill, minResult);
|
|
|
- minResult.setInputValue(random(null,
|
|
|
- new BigDecimal(record.getRuleBaseMinValue()),
|
|
|
- false,
|
|
|
- (record.getRuleBaseMinOperator().equals(">=") ? true : false)).toString());
|
|
|
- minResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMinUnit()) ? record.getRuleBaseMinUnit() : "");
|
|
|
- inputList.add(minResult);
|
|
|
- } else if (StringUtil.isBlank(record.getRuleBaseMinOperator())
|
|
|
- && StringUtil.isNotBlank(record.getRuleBaseMaxOperator())) {
|
|
|
- ResultBill maxResult = new ResultBill();
|
|
|
- BeanUtil.copyProperties(resultBill, maxResult);
|
|
|
- maxResult.setInputValue(random(new BigDecimal(record.getRuleBaseMaxValue()),
|
|
|
+ ResultBill gtResult = new ResultBill();
|
|
|
+ BeanUtil.copyProperties(resultBill, gtResult);
|
|
|
+ gtResult.setMinValue(new BigDecimal(record.getRuleBaseMinValue()));
|
|
|
+ gtResult.setInputValue(random(new BigDecimal(record.getRuleBaseMinValue()),
|
|
|
null,
|
|
|
- (record.getRuleBaseMaxOperator().equals("<=") ? true : false),
|
|
|
+ (record.getRuleBaseMinOperator().equals(">=") ? true : false),
|
|
|
false).toString());
|
|
|
- maxResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMaxUnit()) ? record.getRuleBaseMaxUnit() : "");
|
|
|
- inputList.add(maxResult);
|
|
|
+ gtResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMinUnit()) ? record.getRuleBaseMinUnit() : "");
|
|
|
+ inputList.add(gtResult);
|
|
|
+ } else if (StringUtil.isBlank(record.getRuleBaseMinOperator())
|
|
|
+ && StringUtil.isNotBlank(record.getRuleBaseMaxOperator())) {
|
|
|
+ ResultBill ltResult = new ResultBill();
|
|
|
+ BeanUtil.copyProperties(resultBill, ltResult);
|
|
|
+ //inputValue>minValue
|
|
|
+ ltResult.setMaxValue(new BigDecimal(record.getRuleBaseMaxValue()));
|
|
|
+ ltResult.setInputValue(random(null,
|
|
|
+ new BigDecimal(record.getRuleBaseMaxValue()),
|
|
|
+ false,
|
|
|
+ (record.getRuleBaseMaxOperator().equals("<=") ? true : false)).toString());
|
|
|
+ ltResult.setUnit(StringUtil.isNotBlank(record.getRuleBaseMaxUnit()) ? record.getRuleBaseMaxUnit() : "");
|
|
|
+ inputList.add(ltResult);
|
|
|
} else if (StringUtil.isNotBlank(record.getRuleBaseEqOperator())) {
|
|
|
+ resultBill.setReferenceValue(record.getRuleBaseEqValue().toString());
|
|
|
resultBill.setInputValue(new BigDecimal(record.getRuleBaseEqValue()).toString());
|
|
|
resultBill.setUnit(StringUtil.isNotBlank(record.getRuleBaseEqUnit()) ? record.getRuleBaseEqUnit() : "");
|
|
|
inputList.add(resultBill);
|
|
@@ -201,6 +226,8 @@ public class MedRuleConvertFacade {
|
|
|
billMappingList.addAll(getMappingResult(result, pacsConfigMap, 1));
|
|
|
} else if (result.getBillItemTypeCode().equals(LexiconEnum.PacsSubName.getKey())) {
|
|
|
billMappingList.addAll(getMappingResult(result, pacsConfigMap, 1));
|
|
|
+ } else if (result.getBillItemTypeCode().equals(LexiconEnum.Transfusion.getKey())) {
|
|
|
+ billMappingList.addAll(getMappingResult(result, transfusionConfigMap, 1));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -210,24 +237,31 @@ public class MedRuleConvertFacade {
|
|
|
conflictMappingList.addAll(getMappingResult(result, diseaseConfigMap, 2));
|
|
|
} else if (result.getConflictItemTypeCode().equals(LexiconEnum.Medicine.getKey())) {
|
|
|
conflictMappingList.addAll(getMappingResult_medicine(result, drugConfigMap, 2));
|
|
|
- } else if (result.getConflictItemTypeCode().equals(LexiconEnum.LisName.getKey())) {
|
|
|
+ } else if (result.getConflictItemTypeCode().equals(LexiconEnum.LisSubName.getKey())) {
|
|
|
conflictMappingList.addAll(getMappingResult_lis(result, lisConfigMap, 2));
|
|
|
} else if (result.getConflictItemTypeCode().equals(LexiconEnum.PacsName.getKey())) {
|
|
|
conflictMappingList.addAll(getMappingResult(result, pacsConfigMap, 2));
|
|
|
+ } else if (result.getConflictItemTypeCode().equals(LexiconEnum.Operation.getKey())) {
|
|
|
+ conflictMappingList.addAll(getMappingResult(result, operationConfigMap, 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- retList = BeanUtil.listCopyTo(conflictMappingList, ResultBill.class);
|
|
|
+ //生成预期结果
|
|
|
+ for (ResultBill result : conflictMappingList) {
|
|
|
+ if (result.getSuccess() != null && result.getSuccess() == 0) {
|
|
|
+ retList.add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ BillMsg billMsg = getBillMsg(result);
|
|
|
+ if (billMsg != null) {
|
|
|
+ result.setExpectedOutput(billMsg.getMsg());
|
|
|
+ }
|
|
|
+ retList.add(result);
|
|
|
+ }
|
|
|
+
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
- public void billTransfusionConvert() {
|
|
|
- RuleVO ruleVO = new RuleVO();
|
|
|
- ruleVO.setRuleType(1);
|
|
|
- ruleVO.setLibTypes(Arrays.asList(new Integer[] { LexiconEnum.Transfusion.getKey() }));
|
|
|
-
|
|
|
- List<RuleDTO> list = klRuleFacade.getRules(ruleVO);
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -390,6 +424,152 @@ public class MedRuleConvertFacade {
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 模拟提示信息
|
|
|
+ *
|
|
|
+ * @param resultBill
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public BillMsg getBillMsg(ResultBill resultBill) {
|
|
|
+ BillMsg billMsg = new BillMsg();
|
|
|
+ String orderType = getOrderType(resultBill.getBillItemType());
|
|
|
+ //输血开单
|
|
|
+ if (resultBill.getBillItemTypeCode().equals(LexiconEnum.Transfusion.getKey())) {
|
|
|
+ if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.LisSubName.getKey())) {
|
|
|
+ String content = resultBill.getConflictItemHisName();
|
|
|
+ if (StringUtil.isNotBlank(resultBill.getConflictItemHisDetailName())
|
|
|
+ && !resultBill.getConflictItemHisName().equals(resultBill.getConflictItemHisDetailName())) {
|
|
|
+ content += resultBill.getConflictItemHisDetailName();
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(resultBill.getInputValue())) {
|
|
|
+ content += trimZero(resultBill.getInputValue());
|
|
|
+ }
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ content,
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType
|
|
|
+ );
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Operation.getKey())) {
|
|
|
+ billMsg = MsgUtil.getCommonSurgeryMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemHisName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType
|
|
|
+ );
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Disease.getKey())) {
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemHisName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.PacsName.getKey())) {
|
|
|
+ //互斥项
|
|
|
+ if(resultBill.getConflictType().equals(RuleBaseTypeEnum.BillItem.getKey())) {
|
|
|
+ billMsg = MsgUtil.getBillExclusionMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getConflictItemHisName(),
|
|
|
+ resultBill.getConflictItemHisName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType());
|
|
|
+ }
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Device.getKey())) {
|
|
|
+ //禁忌医疗器械及物品提示信息
|
|
|
+ billMsg = MsgUtil.getBillMedEquMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Operation.getKey())) {
|
|
|
+ //禁忌手术
|
|
|
+ billMsg = MsgUtil.getCommonSurgeryMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemHisName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Medicine.getKey())) {
|
|
|
+ //禁忌服用药品
|
|
|
+ if(resultBill.getConflictType().equals(RuleBaseTypeEnum.Eq.getKey())) {
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ "可能正在用药" + resultBill.getConflictItemHisName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ }else if(resultBill.getConflictType().equals(RuleBaseTypeEnum.Allergen.getKey())){
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ (StringUtil.isNotBlank(resultBill.getConflictItemHisName())
|
|
|
+ ? resultBill.getConflictItemHisName()
|
|
|
+ : resultBill.getConflictItemName())
|
|
|
+ + "过敏",
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ }
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Allergen.getKey())) {
|
|
|
+ //禁忌药物过敏原/食物过敏原/过敏原
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ (StringUtil.isNotBlank(resultBill.getConflictItemHisName())
|
|
|
+ ? resultBill.getConflictItemHisName()
|
|
|
+ : resultBill.getConflictItemName())
|
|
|
+ + "过敏",
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.Group.getName())) {
|
|
|
+ //禁忌禁忌人群
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ } else if (resultBill.getConflictItemTypeCode().equals(LexiconEnum.LisSubName.getName())) {
|
|
|
+ //禁忌实验室检查
|
|
|
+ String content = "";
|
|
|
+ if (StringUtil.isNotBlank(resultBill.getConflictItemHisName())) {
|
|
|
+ content = resultBill.getConflictItemHisName();
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(resultBill.getConflictItemHisDetailName())
|
|
|
+ && !resultBill.getConflictItemHisName().equals(resultBill.getConflictItemHisDetailName())) {
|
|
|
+ content += resultBill.getConflictItemHisDetailName();
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(resultBill.getInputValue())) {
|
|
|
+ content += trimZero(resultBill.getInputValue());
|
|
|
+ }
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ content,
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ } else if (resultBill.getConflictItemType().equals(GraphLabelEnum.Disease.getName())) {
|
|
|
+ //禁忌疾病
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ resultBill.getConflictItemHisName(),
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ } else {
|
|
|
+ //通用
|
|
|
+ String content = resultBill.getConflictItemName();
|
|
|
+ if (StringUtil.isNotBlank(resultBill.getInputValue())) {
|
|
|
+ content += trimZero(resultBill.getInputValue());
|
|
|
+ }
|
|
|
+ billMsg = MsgUtil.getCommonBillMsg(resultBill.getBillItemHisName(),
|
|
|
+ resultBill.getBillItemName(),
|
|
|
+ content,
|
|
|
+ "禁忌" + resultBill.getConflictItemType(),
|
|
|
+ orderType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return billMsg;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 生成随机数
|
|
@@ -440,4 +620,55 @@ public class MedRuleConvertFacade {
|
|
|
}
|
|
|
return random_int;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 开单类型转换
|
|
|
+ *
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getOrderType(String type) {
|
|
|
+ String orderType = "";
|
|
|
+ if (type.equals(LexiconEnum.LisName.getName())) {
|
|
|
+ orderType = TypeEnum.lis.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.PacsName.getName())
|
|
|
+ || type.equals(LexiconEnum.PacsSubName.getName())) {
|
|
|
+ orderType = TypeEnum.pacs.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.Disease.getName())) {
|
|
|
+ orderType = TypeEnum.disease.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.Medicine.getName())) {
|
|
|
+ orderType = TypeEnum.drug.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.Operation.getName())) {
|
|
|
+ orderType = TypeEnum.operation.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.Vital.getName())) {
|
|
|
+ orderType = TypeEnum.vital.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.Transfusion.getName())) {
|
|
|
+ orderType = TypeEnum.transfusion.getName();
|
|
|
+ }
|
|
|
+ if (type.equals(LexiconEnum.Age.getName())) {
|
|
|
+ orderType = TypeEnum.age.getName();
|
|
|
+ }
|
|
|
+ return orderType;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 去除小数点末位的0,如果都是0同时去除小数点
|
|
|
+ *
|
|
|
+ * @param s
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String trimZero(String s) {
|
|
|
+ if (s.indexOf(".") > 0) {
|
|
|
+ //正则表达
|
|
|
+ s = s.replaceAll("0+?$", "");//去掉后面无用的零
|
|
|
+ s = s.replaceAll("[.]$", "");//如小数点后面全是零则去掉小数点
|
|
|
+ }
|
|
|
+ return s;
|
|
|
+ }
|
|
|
}
|