|
@@ -8,12 +8,16 @@ import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.entity.SysRegularConfig;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.RegularConfigEnum;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.model.entity.Allergy;
|
|
|
import com.diagbot.model.entity.AllergyMedicine;
|
|
|
import com.diagbot.model.label.PastLabel;
|
|
|
import com.diagbot.service.impl.SysRegularConfigServiceImpl;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.RegularConfigDataVO;
|
|
|
+import com.diagbot.vo.RegularConfigSaveVO;
|
|
|
+import org.neo4j.driver.summary.Plan;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -144,4 +148,32 @@ public class SysRegularConfigFacade extends SysRegularConfigServiceImpl {
|
|
|
wordCrfDTO.setLis(lisData);
|
|
|
return wordCrfDTO;
|
|
|
}
|
|
|
+
|
|
|
+ public boolean saverRegularConfigDatas(RegularConfigSaveVO regularConfigSaveVO) {
|
|
|
+ boolean res = false;
|
|
|
+ List<String> name = regularConfigSaveVO.getName();
|
|
|
+ for (String str:name) {
|
|
|
+ int countTow = this.count(new QueryWrapper<SysRegularConfig>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq(str != null, "rules_name", str)
|
|
|
+ .eq(regularConfigSaveVO.getRulesTepy() != null, "rules_tepy", regularConfigSaveVO.getRulesTepy()));
|
|
|
+ if (countTow > 0) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, str+"该方案编码已存在");
|
|
|
+ }else {
|
|
|
+ SysRegularConfig regularConfig = new SysRegularConfig();
|
|
|
+ regularConfig.setRulesName(str);
|
|
|
+ regularConfig.setRulesTepy(regularConfigSaveVO.getRulesTepy());
|
|
|
+ String rulesValue = "";
|
|
|
+ if(regularConfigSaveVO.getRulesTepy().equals(RegularConfigEnum.allergy.getKey())){
|
|
|
+ int num = str.length();
|
|
|
+ rulesValue = "[\\、"+str+"过敏]{"+(num+3)+"}|[无"+str+"过敏]{"+(num+3)+"}|[否认"+str+"过敏]{"+(num+4)+"}¥["+str+"过敏]{"+(num+2)+"}";
|
|
|
+ }else if(regularConfigSaveVO.getRulesTepy().equals(RegularConfigEnum.lis.getKey())){
|
|
|
+ rulesValue ="("+str+")\\s*[(\\-|\\+)?\\d+(\\.\\d+)?$]+";
|
|
|
+ }
|
|
|
+ regularConfig.setRulesValue(rulesValue);
|
|
|
+ res = save(regularConfig);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|