|
@@ -1,89 +0,0 @@
|
|
|
-package com.lantone.qc.kernel.catalogue.behospitalized;
|
|
|
-
|
|
|
-import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
-import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
-import com.lantone.qc.pub.Content;
|
|
|
-import com.lantone.qc.pub.model.InputInfo;
|
|
|
-import com.lantone.qc.pub.model.OutputInfo;
|
|
|
-import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
|
-import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
|
|
|
-import com.lantone.qc.pub.model.label.ChiefLabel;
|
|
|
-import com.lantone.qc.pub.util.ListUtil;
|
|
|
-import com.lantone.qc.pub.util.StringUtil;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.regex.Matcher;
|
|
|
-import java.util.regex.Pattern;
|
|
|
-
|
|
|
-/**
|
|
|
- * @ClassName : BEH03332
|
|
|
- * @Description : 入院主诉时间与疑难病例讨论中主诉时间不一致
|
|
|
- * @Author : zhanghang
|
|
|
- * @Date: 2022-04-13 13:54
|
|
|
- */
|
|
|
-@Component
|
|
|
-public class BEH03332 extends QCCatalogue {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- status.set("0");
|
|
|
- String sjzz = Content.SJZZ;
|
|
|
- List<String> timeZZ = new ArrayList<>();
|
|
|
- //获取主诉
|
|
|
- BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
|
- //入院记录为空则返回
|
|
|
- if (beHospitalizedDoc == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
|
|
|
- if(chiefLabel==null){
|
|
|
- return;
|
|
|
- }
|
|
|
- String chiefLabelText = chiefLabel.getText();
|
|
|
- if (StringUtil.isEmpty(chiefLabelText)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- String rex=Content.SJZZ_TIME;
|
|
|
- String rex2=Content.SJZZ_UNIT;
|
|
|
- Pattern pattern = Pattern.compile(sjzz);
|
|
|
- Pattern patternTwo = Pattern.compile(rex2);
|
|
|
- Matcher ma = pattern.matcher(chiefLabelText);
|
|
|
- while (ma.find()) {
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
- String group = ma.group();
|
|
|
- Matcher maTwo = patternTwo.matcher(group);
|
|
|
- boolean two = maTwo.find();
|
|
|
- String groupTwo = maTwo.group();
|
|
|
- String groupOne = group.replace(groupTwo, "").replace("+","");
|
|
|
- String toString = sb.append(".*(").append(groupOne).append("[^。,;。,;]{0,3}").append(groupTwo).append(").*").toString();
|
|
|
- timeZZ.add(toString);
|
|
|
- }
|
|
|
- if(ListUtil.isEmpty(timeZZ)){
|
|
|
- return;
|
|
|
- }
|
|
|
- //获取疑难病历讨论记录
|
|
|
- List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = inputInfo.getDifficultCaseDiscussDocs();
|
|
|
- if (ListUtil.isEmpty(difficultCaseDiscussDocs)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for (DifficultCaseDiscussDoc difficultCaseDiscussDoc : difficultCaseDiscussDocs) {
|
|
|
- if(difficultCaseDiscussDoc==null){
|
|
|
- continue;
|
|
|
- }
|
|
|
- String discussDoc = difficultCaseDiscussDoc.getStructureMap().get("原始文本");
|
|
|
- if(StringUtil.isEmpty(discussDoc)){
|
|
|
- continue;
|
|
|
- }
|
|
|
- String aChar = CatalogueUtil.removeSpecialChar(discussDoc);
|
|
|
- for (String zz : timeZZ) {
|
|
|
- if(!aChar.matches(zz)){
|
|
|
- status.set("-1");
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
-}
|