Browse Source

新增温附一规则 FIRP0199 新生儿出生体重未填写

hecc 3 years ago
parent
commit
8e47eb879b

+ 52 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/firstpagerecord/FIRP0199.java

@@ -0,0 +1,52 @@
+package com.lantone.qc.kernel.catalogue.hospital.wenfuyi.firstpagerecord;
+
+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.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : FIRP0199
+ * @Description : 新生儿出生体重未填写
+ * @Author : 贺聪聪
+ * @Date: 2022-07-20 16:30
+ */
+@Component
+public class FIRP0199 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+
+            if (firstpageStructureMap.get(Content.age) == null || firstpageStructureMap.get(Content.age) == ""){
+                status.set("0");
+            }
+            if (firstpageStructureMap.get(Content.age) != null || firstpageStructureMap.get(Content.age) != ""){
+                String newbornAge = firstpageStructureMap.get(Content.age);
+                if (newbornAge.contains("周") || newbornAge.contains("天")){
+                    String regEx = "[^0-9]";
+                    Pattern pattern = Pattern.compile(regEx);
+                    Matcher matcher = pattern.matcher(newbornAge);
+                    int ageNum = Integer.valueOf(matcher.replaceAll("").trim());
+                    if (ageNum <= 28){
+                        String newbornAdmisWeight = firstpageStructureMap.get(Content.newbornWeight);
+                        if (CatalogueUtil.isEmpty(newbornAdmisWeight)){
+                            status.set("-1");
+                        }
+                    }else {
+                        status.set("0");
+                    }
+                }else {
+                    status.set("0");
+                }
+            }
+        }
+    }
+}