Browse Source

出院其他诊断不完全

chengyao 3 years ago
parent
commit
ffd2c5f192

+ 31 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/firstpagerecord/FIRP0178.java

@@ -9,6 +9,7 @@ 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.ThreeLevelWardDoc;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,7 +50,7 @@ public class FIRP0178 extends QCCatalogue {
             if (ListUtil.isEmpty(firstpageLeaveDiags)) {
                 return;
             }
-
+            List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             /*DiagLabel leaveDiagLabel = inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel();
             if (leaveDiagLabel == null) {
                 return;
@@ -87,6 +88,26 @@ public class FIRP0178 extends QCCatalogue {
                 status.set("-1");
                 info.set(infoStr);
             }
+            //补记病理
+            if(ListUtil.isNotEmpty(threeLevelWardDocs)){
+                for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+                    List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
+                    if(ListUtil.isNotEmpty(allDoctorWradDocs)){
+                        for (ThreeLevelWardDoc allDoctorWradDoc : allDoctorWradDocs) {
+                            String text = allDoctorWradDoc.getText();
+                            if(StringUtil.isBlank(text)){
+                                Map<String, String> structureMap = allDoctorWradDoc.getStructureMap();
+                                text = structureMap.get("病情记录");
+                            }
+                            if( isHavePathology(text)){
+                                status.set("0");
+                                info.remove();
+                                return;
+                            }
+                        }
+                    }
+                }
+            }
         }
     }
 
@@ -138,4 +159,13 @@ public class FIRP0178 extends QCCatalogue {
         }
         return diags;
     }
+
+    public boolean isHavePathology(String text){
+        String rex = "[\\s\\S]*(?=补)[\\s\\S].{0,5}(?=病理)[\\s\\S]*";
+        String rex2 = "[\\s\\S]*(?=病理)[\\s\\S].{0,5}(?=补)[\\s\\S]*";
+        if(StringUtil.isNotBlank(text) && (text.matches(rex) ||  text.matches(rex2))){
+            return true;
+        }
+        return false;
+    };
 }