|
@@ -2,10 +2,14 @@ package com.diagbot.facade;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.diagbot.biz.push.entity.Lis;
|
|
import com.diagbot.dto.RegularValueDTO;
|
|
import com.diagbot.dto.RegularValueDTO;
|
|
|
|
+import com.diagbot.dto.WordCrfDTO;
|
|
import com.diagbot.entity.SysRegularConfig;
|
|
import com.diagbot.entity.SysRegularConfig;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.RegularConfigEnum;
|
|
import com.diagbot.enums.RegularConfigEnum;
|
|
|
|
+import com.diagbot.model.entity.Allergy;
|
|
|
|
+import com.diagbot.model.label.PastLabel;
|
|
import com.diagbot.service.impl.SysRegularConfigServiceImpl;
|
|
import com.diagbot.service.impl.SysRegularConfigServiceImpl;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.vo.RegularConfigDataVO;
|
|
import com.diagbot.vo.RegularConfigDataVO;
|
|
@@ -35,16 +39,15 @@ public class SysRegularConfigFacade extends SysRegularConfigServiceImpl {
|
|
for (SysRegularConfig data : regularConfigs) {
|
|
for (SysRegularConfig data : regularConfigs) {
|
|
String pattern = data.getRulesValue();
|
|
String pattern = data.getRulesValue();
|
|
// 创建 Pattern 对象
|
|
// 创建 Pattern 对象
|
|
- Pattern r = Pattern.compile(pattern);
|
|
|
|
|
|
+ Pattern r = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
|
|
// 现在创建 matcher 对象
|
|
// 现在创建 matcher 对象
|
|
Matcher m = r.matcher(regularConfigDataVO.getText());
|
|
Matcher m = r.matcher(regularConfigDataVO.getText());
|
|
while (m.find()) {
|
|
while (m.find()) {
|
|
//System.out.println(m.group());
|
|
//System.out.println(m.group());
|
|
String steing = m.group();
|
|
String steing = m.group();
|
|
- String key ="";
|
|
|
|
String value = "";
|
|
String value = "";
|
|
Integer type = data.getRulesTepy();
|
|
Integer type = data.getRulesTepy();
|
|
- if(data.getRulesTepy().equals(RegularConfigEnum.lis.getKey())){
|
|
|
|
|
|
+ if (data.getRulesTepy().equals(RegularConfigEnum.lis.getKey())) {
|
|
value = steing.replaceAll("([^\\d\\.]|\\.(?=[^\\.]*\\.))", "");
|
|
value = steing.replaceAll("([^\\d\\.]|\\.(?=[^\\.]*\\.))", "");
|
|
}
|
|
}
|
|
RegularValueDTO regularValueDTO = new RegularValueDTO();
|
|
RegularValueDTO regularValueDTO = new RegularValueDTO();
|
|
@@ -59,4 +62,39 @@ public class SysRegularConfigFacade extends SysRegularConfigServiceImpl {
|
|
return listData;
|
|
return listData;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param wordCrfDTO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public WordCrfDTO getRegularConfigs(WordCrfDTO wordCrfDTO) {
|
|
|
|
+ String symptom = wordCrfDTO.getSymptom();
|
|
|
|
+ RegularConfigDataVO regularConfigData = new RegularConfigDataVO();
|
|
|
|
+ regularConfigData.setText(symptom);
|
|
|
|
+ List<RegularValueDTO> regularConfigDatas = getRegularConfigDatas(regularConfigData);
|
|
|
|
+ List<Lis> lisData = wordCrfDTO.getLis();
|
|
|
|
+ PastLabel pastLabel = wordCrfDTO.getPastLabel();//获取过敏史数据
|
|
|
|
+ List<Allergy> allergies = pastLabel.getAllergies();
|
|
|
|
+ if (ListUtil.isNotEmpty(regularConfigDatas)) {
|
|
|
|
+ for (RegularValueDTO data : regularConfigDatas) {
|
|
|
|
+ if (data.getType().equals(RegularConfigEnum.lis.getKey())) {
|
|
|
|
+ Lis lis = new Lis();
|
|
|
|
+ lis.setUniqueName(data.getKey());
|
|
|
|
+ lis.setDetailName(data.getKey());
|
|
|
|
+ lis.setName(data.getKey());
|
|
|
|
+ lis.setValue(Double.valueOf(data.getValue()));
|
|
|
|
+ lisData.add(lis);
|
|
|
|
+ }else if(data.getType().equals(RegularConfigEnum.allergy.getKey())){
|
|
|
|
+ Allergy allergy = new Allergy();
|
|
|
|
+ allergy.setName(data.getKey());
|
|
|
|
+ allergy.setStandName(data.getKey());
|
|
|
|
+ allergies.add(allergy);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pastLabel.setAllergies(allergies);
|
|
|
|
+ wordCrfDTO.setPastLabel(pastLabel);
|
|
|
|
+ wordCrfDTO.setLis(lisData);
|
|
|
|
+ return wordCrfDTO;
|
|
|
|
+ }
|
|
}
|
|
}
|