|
@@ -0,0 +1,61 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.behospitalized;
|
|
|
+
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+import com.lantone.qc.pub.model.InputInfo;
|
|
|
+import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.entity.MaritalStatus;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.regex.Pattern;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 婚姻状况前后不一致
|
|
|
+ * @author: rengb
|
|
|
+ * @time: 2020/3/10 14:02
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class BEH0372 extends QCCatalogue {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ String basicInfoStatus = inputInfo.getBeHospitalizedDoc().getStructureMap().get("婚姻");
|
|
|
+ basicInfoStatus = StringUtil.isNotBlank(basicInfoStatus) ? basicInfoStatus : "";
|
|
|
+
|
|
|
+ String maritalStatus = "";
|
|
|
+ MaritalStatus mts = inputInfo.getBeHospitalizedDoc().getMaritalLabel().getMaritalStatus();
|
|
|
+ if (mts != null && StringUtil.isNotBlank(mts.getName())) {
|
|
|
+ maritalStatus = mts.getName();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (chcekMaritalStatus(basicInfoStatus, maritalStatus)) {
|
|
|
+ status = "0";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean chcekMaritalStatus(String basicInfoStatus, String maritalStatus) {
|
|
|
+ if (basicInfoStatus.equals(maritalStatus)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ boolean flag = false;
|
|
|
+ List<String> regxs = Lists.newArrayList(
|
|
|
+ "([\\s\\S]*离[\\s\\S]*婚[\\s\\S]*)|([\\s\\S]*离[\\s\\S]*异[\\s\\S]*)",
|
|
|
+ "[\\s\\S]*已[\\s\\S]*婚[\\s\\S]*",
|
|
|
+ "[\\s\\S]*未[\\s\\S]*婚[\\s\\S]*",
|
|
|
+ "[\\s\\S]*丧[\\s\\S]*偶[\\s\\S]*",
|
|
|
+ "[\\s\\S]*其[\\s\\S]*他[\\s\\S]*"
|
|
|
+ );
|
|
|
+ Pattern pt = null;
|
|
|
+ for (String regx : regxs) {
|
|
|
+ pt = Pattern.compile(regx);
|
|
|
+ if (pt.matcher(basicInfoStatus).find() && pt.matcher(maritalStatus).find()) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|