daiyi 3 лет назад
Родитель
Сommit
1082a051a8

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/firstpagerecord/FIRP03246.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+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.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : FIRP03246
+ * @Description : 联系人电话填写错误
+ * @Author : dy
+ * @Date: 2021-11-15 16:26
+ */
+@Component
+public class FIRP03246 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String phone = firstpageStructureMap.get(Content.contact_phone);
+            if (StringUtil.isNotBlank(phone)) {
+                status.set("0");
+            }
+            //匹配所有手机号码
+            String regex="^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$";
+            Pattern pattern=Pattern.compile(regex);
+            Matcher matcher = pattern.matcher(phone);
+            if (matcher.find() || !phone.equals("-")){
+                status.set("-1");
+            }
+        }
+    }
+
+}