|
@@ -28,6 +28,7 @@ import com.diagbot.vo.RetrievalVO;
|
|
|
import com.diagbot.vo.SearchData;
|
|
|
import com.diagbot.vo.StandConvertCrfVO;
|
|
|
import com.diagbot.vo.SymptomFeatureVO;
|
|
|
+import com.diagbot.vo.TestStandVO;
|
|
|
import com.diagbot.vo.TestwordInfoVO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -324,6 +325,96 @@ public class TestwordInfoFacade extends TestwordInfoServiceImpl {
|
|
|
stringList.removeAll(setList);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 同义词转换【新版】
|
|
|
+ */
|
|
|
+ public void wordConvertNew(TestStandVO testStandVO) {
|
|
|
+ QueryWrapper queryWrapper = new QueryWrapper<TestwordRes>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("is_deal", "0")
|
|
|
+ .in(ListUtil.isNotEmpty(testStandVO.getTypeList()), "type", testStandVO.getTypeList())
|
|
|
+ .orderByAsc("id");
|
|
|
+ List<TestwordRes> testwordInfoList = testwordResService.page(new Page<>(1, 1), queryWrapper).getRecords();
|
|
|
+
|
|
|
+ while(ListUtil.isNotEmpty(testwordInfoList)) {
|
|
|
+ List<StandConvertCrfVO> convertCrfVOList = new ArrayList<>();
|
|
|
+ for (TestwordRes testwordRes : testwordInfoList) {
|
|
|
+ StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
+ standConvertCrfVO.setWord(testwordRes.getWord());
|
|
|
+ standConvertCrfVO.setNumber(3);
|
|
|
+ switch (testwordRes.getType()) {
|
|
|
+ case "症状":
|
|
|
+ standConvertCrfVO.setWord_type("symptom");
|
|
|
+ convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ break;
|
|
|
+ // case "诊断":
|
|
|
+ // standConvertCrfVO.setWord_type("disease");
|
|
|
+ // convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ // break;
|
|
|
+ // case "药品":
|
|
|
+ // standConvertCrfVO.setWord_type("drug");
|
|
|
+ // convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ // break;
|
|
|
+ // case "手术":
|
|
|
+ // standConvertCrfVO.setWord_type("operation");
|
|
|
+ // convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ // break;
|
|
|
+ // case "查体":
|
|
|
+ // standConvertCrfVO.setWord_type("vital");
|
|
|
+ // convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ // break;
|
|
|
+ // // case "辅检结果":
|
|
|
+ // // standConvertCrfVO.setWord_type("pacs");
|
|
|
+ // // convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ // // break;
|
|
|
+ // case "化验":
|
|
|
+ // standConvertCrfVO.setWord_type("lis");
|
|
|
+ // convertCrfVOList.add(standConvertCrfVO);
|
|
|
+ // break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ long t1 = System.currentTimeMillis();
|
|
|
+ StandConvertCrfBatchDTO standConvertCrfBatchDTO = testFacade.testStandConvertBatchNew(convertCrfVOList);
|
|
|
+ String dealTime = String.valueOf((System.currentTimeMillis() - t1)/ 1000.0);
|
|
|
+ Date date = DateUtil.now();
|
|
|
+ for (TestwordRes testwordRes : testwordInfoList) {
|
|
|
+ testwordRes.setDealTime(dealTime);
|
|
|
+ switch (testwordRes.getType()) {
|
|
|
+ case "症状":
|
|
|
+ wordStandConvertNew(standConvertCrfBatchDTO, testwordRes, "symptom");
|
|
|
+ break;
|
|
|
+ // case "诊断":
|
|
|
+ // wordStandConvertNew(standConvertCrfBatchDTO, testwordRes, "disease");
|
|
|
+ // break;
|
|
|
+ // case "药品":
|
|
|
+ // wordStandConvertNew(standConvertCrfBatchDTO, testwordRes, "drug");
|
|
|
+ // break;
|
|
|
+ // case "手术":
|
|
|
+ // wordStandConvertNew(standConvertCrfBatchDTO, testwordRes, "operation");
|
|
|
+ // break;
|
|
|
+ // case "查体":
|
|
|
+ // wordStandConvertNew(standConvertCrfBatchDTO, testwordRes, "vital");
|
|
|
+ // break;
|
|
|
+ // // case "辅检结果":
|
|
|
+ // // wordStandConvert(standConvertCrfBatchDTO, testwordRes, "pacs");
|
|
|
+ // // break;
|
|
|
+ // case "化验":
|
|
|
+ // wordStandConvertNew(standConvertCrfBatchDTO, testwordRes, "lis");
|
|
|
+ // break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ testwordRes.setIsDeal(1);
|
|
|
+ testwordRes.setGmtModified(date);
|
|
|
+ }
|
|
|
+ testwordResService.saveOrUpdateBatch(testwordInfoList);
|
|
|
+
|
|
|
+ testwordInfoList = testwordResService.page(new Page<>(1, 1), queryWrapper).getRecords();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 同义词转换
|
|
|
*/
|
|
@@ -426,6 +517,22 @@ public class TestwordInfoFacade extends TestwordInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void wordStandConvertNew(StandConvertCrfBatchDTO standConvertCrfBatchDTO, TestwordRes testwordRes, String type) {
|
|
|
+ Set<String> typeList = new LinkedHashSet<>();
|
|
|
+ Map<String, StandConvertCrfDTO> convertCrfDTOMap = standConvertCrfBatchDTO.getData().get(type);
|
|
|
+ if (convertCrfDTOMap != null && convertCrfDTOMap.get(testwordRes.getWord()) != null) {
|
|
|
+ List<Map<String,String>> listMap = convertCrfDTOMap.get(testwordRes.getWord()).getStandard_words();
|
|
|
+ int size = 0;
|
|
|
+ for (Map<String,String> map : listMap) {
|
|
|
+ if (size < 3 && StringUtil.isNotBlank(map.get("standard_words"))) {
|
|
|
+ typeList.add(map.get("standard_words"));
|
|
|
+ }
|
|
|
+ size++;
|
|
|
+ }
|
|
|
+ testwordRes.setNewConvertWord(StringUtils.join(typeList, ";"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 筛选对象列表中“uniqueName”字段为空的数据,返回targetProperty字段列表
|
|
|
*
|