|
@@ -9,6 +9,7 @@ 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.entity.Allergy;
|
|
|
|
+import com.diagbot.model.entity.AllergyMedicine;
|
|
import com.diagbot.model.label.PastLabel;
|
|
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;
|
|
@@ -37,11 +38,19 @@ public class SysRegularConfigFacade extends SysRegularConfigServiceImpl {
|
|
List<SysRegularConfig> regularConfigs = list(regularQuery);
|
|
List<SysRegularConfig> regularConfigs = list(regularQuery);
|
|
if (ListUtil.isNotEmpty(regularConfigs)) {
|
|
if (ListUtil.isNotEmpty(regularConfigs)) {
|
|
for (SysRegularConfig data : regularConfigs) {
|
|
for (SysRegularConfig data : regularConfigs) {
|
|
- String pattern = data.getRulesValue();
|
|
|
|
|
|
+ String pattern = "";
|
|
|
|
+ String patternMax = "";
|
|
|
|
+ if (data.getRulesTepy().equals(RegularConfigEnum.allergy.getKey())) {
|
|
|
|
+ pattern = data.getRulesValue().split("¥")[0];
|
|
|
|
+ patternMax = data.getRulesValue().split("¥")[1];
|
|
|
|
+ } else {
|
|
|
|
+ pattern = data.getRulesValue();
|
|
|
|
+ }
|
|
// 创建 Pattern 对象
|
|
// 创建 Pattern 对象
|
|
Pattern r = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
|
|
Pattern r = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
|
|
// 现在创建 matcher 对象
|
|
// 现在创建 matcher 对象
|
|
Matcher m = r.matcher(regularConfigDataVO.getText());
|
|
Matcher m = r.matcher(regularConfigDataVO.getText());
|
|
|
|
+ int trueMin = 0;
|
|
while (m.find()) {
|
|
while (m.find()) {
|
|
//System.out.println(m.group());
|
|
//System.out.println(m.group());
|
|
String steing = m.group();
|
|
String steing = m.group();
|
|
@@ -49,32 +58,57 @@ public class SysRegularConfigFacade extends SysRegularConfigServiceImpl {
|
|
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.setKey(data.getRulesName());
|
|
|
|
+ regularValueDTO.setType(type);
|
|
|
|
+ regularValueDTO.setValue(value);
|
|
|
|
+ listData.add(regularValueDTO);
|
|
|
|
+ } else if (data.getRulesTepy().equals(RegularConfigEnum.allergy.getKey())) {
|
|
|
|
+ //取否认的数
|
|
|
|
+ trueMin++;
|
|
}
|
|
}
|
|
- RegularValueDTO regularValueDTO = new RegularValueDTO();
|
|
|
|
- regularValueDTO.setKey(data.getRulesName());
|
|
|
|
- regularValueDTO.setType(type);
|
|
|
|
- regularValueDTO.setValue(value);
|
|
|
|
- listData.add(regularValueDTO);
|
|
|
|
- System.out.println(listData.toString());
|
|
|
|
}
|
|
}
|
|
|
|
+ int trueMax = 0;
|
|
|
|
+ //取所有符合的
|
|
|
|
+ if (data.getRulesTepy().equals(RegularConfigEnum.allergy.getKey())) {
|
|
|
|
+ Pattern rMax = Pattern.compile(patternMax, Pattern.CASE_INSENSITIVE);
|
|
|
|
+ // 现在创建 matcher 对象
|
|
|
|
+ Matcher mMax = rMax.matcher(regularConfigDataVO.getText());
|
|
|
|
+ while (mMax.find()) {
|
|
|
|
+ if (data.getRulesTepy().equals(RegularConfigEnum.allergy.getKey())) {
|
|
|
|
+ trueMax++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ int mun = trueMax - trueMin;
|
|
|
|
+ if (mun > 0) {
|
|
|
|
+ RegularValueDTO regularValueDTO = new RegularValueDTO();
|
|
|
|
+ regularValueDTO.setKey(data.getRulesName());
|
|
|
|
+ regularValueDTO.setType(data.getRulesTepy()
|
|
|
|
+ );
|
|
|
|
+ listData.add(regularValueDTO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
return listData;
|
|
return listData;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @param wordCrfDTO
|
|
* @param wordCrfDTO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public WordCrfDTO getRegularConfigs(WordCrfDTO wordCrfDTO) {
|
|
public WordCrfDTO getRegularConfigs(WordCrfDTO wordCrfDTO) {
|
|
- String symptom = wordCrfDTO.getSymptom();
|
|
|
|
|
|
+ String symptom = wordCrfDTO.getSymptom();//现病史
|
|
RegularConfigDataVO regularConfigData = new RegularConfigDataVO();
|
|
RegularConfigDataVO regularConfigData = new RegularConfigDataVO();
|
|
regularConfigData.setText(symptom);
|
|
regularConfigData.setText(symptom);
|
|
List<RegularValueDTO> regularConfigDatas = getRegularConfigDatas(regularConfigData);
|
|
List<RegularValueDTO> regularConfigDatas = getRegularConfigDatas(regularConfigData);
|
|
List<Lis> lisData = wordCrfDTO.getLis();
|
|
List<Lis> lisData = wordCrfDTO.getLis();
|
|
PastLabel pastLabel = wordCrfDTO.getPastLabel();//获取过敏史数据
|
|
PastLabel pastLabel = wordCrfDTO.getPastLabel();//获取过敏史数据
|
|
- List<Allergy> allergies = pastLabel.getAllergies();
|
|
|
|
|
|
+ List<AllergyMedicine> allergies = pastLabel.getAllergyMedicines();
|
|
if (ListUtil.isNotEmpty(regularConfigDatas)) {
|
|
if (ListUtil.isNotEmpty(regularConfigDatas)) {
|
|
for (RegularValueDTO data : regularConfigDatas) {
|
|
for (RegularValueDTO data : regularConfigDatas) {
|
|
if (data.getType().equals(RegularConfigEnum.lis.getKey())) {
|
|
if (data.getType().equals(RegularConfigEnum.lis.getKey())) {
|
|
@@ -84,15 +118,28 @@ public class SysRegularConfigFacade extends SysRegularConfigServiceImpl {
|
|
lis.setName(data.getKey());
|
|
lis.setName(data.getKey());
|
|
lis.setValue(Double.valueOf(data.getValue()));
|
|
lis.setValue(Double.valueOf(data.getValue()));
|
|
lisData.add(lis);
|
|
lisData.add(lis);
|
|
- }else if(data.getType().equals(RegularConfigEnum.allergy.getKey())){
|
|
|
|
- Allergy allergy = new Allergy();
|
|
|
|
|
|
+ } else if (data.getType().equals(RegularConfigEnum.allergy.getKey())) {
|
|
|
|
+ AllergyMedicine allergy = new AllergyMedicine();
|
|
allergy.setName(data.getKey());
|
|
allergy.setName(data.getKey());
|
|
allergy.setStandName(data.getKey());
|
|
allergy.setStandName(data.getKey());
|
|
allergies.add(allergy);
|
|
allergies.add(allergy);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- pastLabel.setAllergies(allergies);
|
|
|
|
|
|
+ String pasts = wordCrfDTO.getPasts();//既往史
|
|
|
|
+ RegularConfigDataVO regularConfigPasts = new RegularConfigDataVO();
|
|
|
|
+ regularConfigData.setText(pasts);
|
|
|
|
+ regularConfigData.setRulesTepy(RegularConfigEnum.allergy.getKey());
|
|
|
|
+ List<RegularValueDTO> regularConfigPastss = getRegularConfigDatas(regularConfigData);
|
|
|
|
+ if (ListUtil.isNotEmpty(regularConfigPastss)) {
|
|
|
|
+ for(RegularValueDTO dataPasts : regularConfigPastss){
|
|
|
|
+ AllergyMedicine allergy = new AllergyMedicine();
|
|
|
|
+ allergy.setName(dataPasts.getKey());
|
|
|
|
+ allergy.setStandName(dataPasts.getKey());
|
|
|
|
+ allergies.add(allergy);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pastLabel.setAllergyMedicines(allergies);
|
|
wordCrfDTO.setPastLabel(pastLabel);
|
|
wordCrfDTO.setPastLabel(pastLabel);
|
|
wordCrfDTO.setLis(lisData);
|
|
wordCrfDTO.setLis(lisData);
|
|
return wordCrfDTO;
|
|
return wordCrfDTO;
|