Procházet zdrojové kódy

北仑:病案首页需求更新

wangsy před 4 roky
rodič
revize
3e0d855e70

+ 31 - 7
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/firstpagerecord/FIRP0184.java

@@ -5,8 +5,13 @@ 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.entity.AllergyMedicine;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -18,16 +23,35 @@ import java.util.Map;
 @Component
 public class FIRP0184 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if (inputInfo.getFirstPageRecordDoc() == null){
-            status.set("0");
+        status.set("0");
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (inputInfo.getFirstPageRecordDoc() == null || beHospitalizedDoc == null) {
             return;
         }
-        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
-            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        List<AllergyMedicine> allergyMedicines = pastLabel.getAllergyMedicines();
+        if (allergyMedicines == null) {
+            return;
+        }
+
+        long count = allergyMedicines.stream().filter(allergyMedicine -> {
+            boolean flag = false;
+            if (allergyMedicine.getNegative() == null
+                    && StringUtil.isNotBlank(allergyMedicine.getName())) {
+                flag = true;
+            }
+            return flag;
+        }).count();
+
+        if (count > 0 && firstpageStructureMap != null) {
             String drugAllergy = firstpageStructureMap.get(Content.drugAllergy);
-//            String allergyDrug = firstpageStructureMap.get(Content.allergyDrug);
-            if (!CatalogueUtil.isEmpty(drugAllergy)) {
-                status.set("0");
+            if (CatalogueUtil.isEmpty(drugAllergy)) {
+                status.set("-1");
+                return;
             }
         }
     }

+ 15 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/firstpagerecord/FIRP0209.java

@@ -7,6 +7,8 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -17,15 +19,26 @@ import java.util.Map;
  */
 @Component
 public class FIRP0209 extends QCCatalogue {
+
+    private List<String> containList = Arrays.asList("农民", "家务", "自由职业者", "个体经营者", "无业人员", "儿童");
+
     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();
             String dischargeTime = firstpageStructureMap.get(Content.work_unit);
-            if(StringUtil.isBlank(dischargeTime)){
+            String job = firstpageStructureMap.get(Content.job);
+            if (StringUtil.isBlank(job)) {
+                return;
+            }
+            for (String str : containList) {
+                if (str.contains(job)) {
+                    return;
+                }
+            }
+            if (StringUtil.isBlank(dischargeTime) || "—".equals(dischargeTime)) {
                 status.set("-1");
             }
-
         }
     }
 }