|
@@ -27,8 +27,6 @@ import java.util.List;
|
|
|
*/
|
|
|
@Component
|
|
|
public class CRI0382 extends QCCatalogue {
|
|
|
- @Autowired
|
|
|
- SimilarityServiceClient similarityServiceClient;
|
|
|
@Override
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
@@ -87,16 +85,12 @@ public class CRI0382 extends QCCatalogue {
|
|
|
for (CrisisValueReportDoc crisisValueReportDoc : crisisValueReportDocs) {
|
|
|
String recordTimeStr = crisisValueReportDoc.getStructureMap().get("病历日期");
|
|
|
String docReptContent = crisisValueReportDoc.getStructureMap().get("病情分析及处理");
|
|
|
- //添加文本相似度去比较病情分析及处理
|
|
|
- boolean flag = getLikeRate(submitContent(StringUtil.removeBlank(docReptContent))
|
|
|
- ,StringUtil.removeBlank(crisisName));
|
|
|
if ((StringUtil.parseDateTime(recordTimeStr, dateFormats).getTime() - StringUtil.parseDateTime(reptTime, dateFormats).getTime()) < timeCha
|
|
|
&& (StringUtil.removeBlank(docReptContent).contains(StringUtil.removeBlank(crisisName)) ||
|
|
|
(StringUtil.isNotBlank(crisisNm) && StringUtil.isNotBlank(companyNum)
|
|
|
&& StringUtil.removeBlank(docReptContent).contains(StringUtil.removeBlank(crisisNm))
|
|
|
&& StringUtil.removeBlank(docReptContent).contains(StringUtil.removeBlank(companyNum))
|
|
|
- ))
|
|
|
- ||flag) {
|
|
|
+ ))) {
|
|
|
findCrisises.add(reptTime);
|
|
|
break;
|
|
|
}
|
|
@@ -125,69 +119,4 @@ public class CRI0382 extends QCCatalogue {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- /**
|
|
|
- * @Author songxl
|
|
|
- * @Description 内容截取
|
|
|
- * @Date 2021/3/29
|
|
|
- * @Param [content]
|
|
|
- * @Return java.lang.String
|
|
|
- * @MethodName submitContent
|
|
|
- */
|
|
|
- private String submitContent(String content) {
|
|
|
- if(StringUtil.isNotBlank(content))
|
|
|
- {
|
|
|
- if(content.contains("具体为"))
|
|
|
- {
|
|
|
- content = content.split("具体为")[1];
|
|
|
- }
|
|
|
- if(content.contains("处理意见"))
|
|
|
- {
|
|
|
- content = content.split("处理意见")[0];
|
|
|
- }
|
|
|
- }
|
|
|
- return content;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @Author songxl
|
|
|
- * @Description 获取文本相似度
|
|
|
- * @Date 2021/3/29
|
|
|
- * @Param [text_1, text_2]
|
|
|
- * @Return boolean
|
|
|
- * @MethodName getFlag
|
|
|
- */
|
|
|
- private boolean getLikeRate(String text_1, String text_2) {
|
|
|
- JSONArray similarContent = new JSONArray();
|
|
|
- JSONObject detailContent = new JSONObject();
|
|
|
- detailContent.put("text_1", text_1);
|
|
|
- detailContent.put("text_2", text_2);
|
|
|
- similarContent.add(detailContent);
|
|
|
- //存储CRF完整所需结构数据
|
|
|
- SimilarityVo similarityVo = new SimilarityVo();
|
|
|
- similarityVo.setData(similarContent);
|
|
|
- //获取CRF模型返回数据
|
|
|
- JSONArray data = getAnnotation(similarityServiceClient, similarityVo).getData();
|
|
|
- double likeRate = 0d;
|
|
|
- if (data.size() > 0) {
|
|
|
- JSONObject dataContent = data.getJSONObject(0);
|
|
|
- likeRate = dataContent.getDoubleValue("like_rate");
|
|
|
- }
|
|
|
- if(likeRate>0.8)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
- private Annotation getAnnotation(SimilarityServiceClient similarityServiceClient, SimilarityVo similarityVo) {
|
|
|
- Annotation annotation = new Annotation();
|
|
|
- try {
|
|
|
- String annotation_str = similarityServiceClient.getAnnotation(similarityVo);
|
|
|
- annotation = JSON.parseObject(annotation_str, Annotation.class);
|
|
|
- } catch (Exception ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- } finally {
|
|
|
- return annotation;
|
|
|
- }
|
|
|
- }
|
|
|
}
|