|
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
+import com.lantone.qc.kernel.util.SimilarityUtil;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
@@ -13,7 +14,10 @@ import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.entity.Drug;
|
|
|
+import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Date;
|
|
@@ -32,6 +36,9 @@ import java.util.regex.Pattern;
|
|
|
*/
|
|
|
@Component
|
|
|
public class THR02985 extends QCCatalogue {
|
|
|
+ @Autowired
|
|
|
+ SimilarityUtil similarityUtil;
|
|
|
+
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
|
|
@@ -141,19 +148,37 @@ public class THR02985 extends QCCatalogue {
|
|
|
if (StringUtil.isBlank(missDrug)) {
|
|
|
continue;
|
|
|
}
|
|
|
+ boolean modelFind = false;
|
|
|
for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
|
|
|
+ /*****************纯文本匹配******************/
|
|
|
Map<String, String> wardDocStructureMap = threeLevelWardDoc.getStructureMap();
|
|
|
String wardDateStr = wardDocStructureMap.get("查房日期");
|
|
|
String content = wardDocStructureMap.get("病情记录") + wardDocStructureMap.get("治疗计划和措施");
|
|
|
Date wardDate = StringUtil.parseDateTime(wardDateStr);
|
|
|
missDrug = getMissDrug(content, wardDate, doctorAdviceDate, drugArr, 2, missDrug);
|
|
|
//当前抗生素药(drugs)在查房记录中已找到,直接跳出当前查房记录的循环
|
|
|
- if (StringUtil.isBlank(missDrug)) {
|
|
|
+ /*****************药品相似度模型******************/
|
|
|
+ List<ThreeLevelWardLabel> label = threeLevelWardDoc.getThreeLevelWardLabel();
|
|
|
+ if (label.size() > 0) {
|
|
|
+ List<Drug> drugList = label.get(0).getDrugs();
|
|
|
+ for (Drug drug : drugList) {
|
|
|
+ for (String adDrug : drugArr) {
|
|
|
+ if (compareStandard(drug.getName(), adDrug)) {
|
|
|
+ modelFind = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (modelFind) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(missDrug) || modelFind) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (StringUtil.isNotBlank(missDrug) && !"时间不匹配".equals(missDrug)) {
|
|
|
+ if (StringUtil.isNotBlank(missDrug) && !"时间不匹配".equals(missDrug) && !modelFind) {
|
|
|
infoStr = CatalogueUtil.concatInfo(infoStr, missDrug);
|
|
|
}
|
|
|
}
|
|
@@ -225,4 +250,23 @@ public class THR02985 extends QCCatalogue {
|
|
|
Matcher m = p.matcher(content);
|
|
|
return m.find();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 比较两个抗生素标准词是否一致
|
|
|
+ *
|
|
|
+ * @param firstWord
|
|
|
+ * @param secordWord
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private boolean compareStandard(String firstWord, String secordWord) {
|
|
|
+ if (StringUtil.isBlank(firstWord) || StringUtil.isBlank(secordWord)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ String drugStandardWord1 = similarityUtil.getDrugStandardWord(firstWord);
|
|
|
+ String drugStandardWord2 = similarityUtil.getDrugStandardWord(secordWord);
|
|
|
+ if (drugStandardWord1 == null || drugStandardWord2 == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return drugStandardWord1.equals(drugStandardWord2);
|
|
|
+ }
|
|
|
}
|