From 565244093e398d5ee6276978b0b60d8f1c13ccb5 Mon Sep 17 00:00:00 2001
From: linzhijie <19970921lzj>
Date: 星期一, 02 八月 2021 18:19:35 +0800
Subject: [PATCH] PAQ有效性诊断

---
 src/main/java/com/ots/project/tool/report/PAQ/PAQReport.java                |    6 +
 src/main/java/com/ots/common/utils/poi/WordUtil.java                        |   11 ++
 src/main/java/com/ots/project/tool/report/PAQ/condition/Diagnosis.java      |   94 +++++++++++++++++++++++
 src/main/java/com/ots/project/tool/report/PAQ/condition/DiagnosisTitle.java |   86 +++++++++++++++++++++
 4 files changed, 196 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ots/common/utils/poi/WordUtil.java b/src/main/java/com/ots/common/utils/poi/WordUtil.java
index dcd4fac..961d8e8 100644
--- a/src/main/java/com/ots/common/utils/poi/WordUtil.java
+++ b/src/main/java/com/ots/common/utils/poi/WordUtil.java
@@ -427,8 +427,10 @@
             }
         }
     }
-    
+
+    //鏍¢獙鏂囨湰鏄惁闇�瑕佹浛鎹�
     public static boolean checkText(String text) {
+        //鏇挎崲鏂囨湰鍖呭惈%
         if (text.indexOf("%") != -1 || StringUtils.equals(text, "N/A NONE")) {
             return true;
         }
@@ -1297,4 +1299,11 @@
         }
         return result.size();
     }
+
+
+    public static void main(String[] args) {
+        if (!checkText("浜烘墠閫夋嫈鐨勭洰鐨勫氨鏄壘鍒拌兘澶熻儨浠诲伐浣溿�佹効鎰忔壙鎷呭伐浣滐紝涓斾笌缁勭粐鐨勯渶姹傘�佹枃鍖栥�佷环鍊艰鐩稿尮閰嶇殑浜恒�侾AQ鎶ュ憡鏄牴鎹�欓�変汉瀵筆AQ闂嵎涓鐩殑浣滅瓟淇℃伅鑰岀敓鎴愮殑锛屾祴閲忕殑鏄�欓�変汉鍦ㄥ伐浣滀腑鍋忓ソ鐨勮涓洪鏍笺�侾AQ涔熷寘鎷簡瀵逛綔绛旂湡瀹炴�х殑娴嬮噺锛屽悓鏃朵篃瑁呭叆浜員AI涓撴湁鐨勪綔鍋囬槻鑼冪▼搴忥紝鍙互鏈夋晥闄嶄綆鍊欓�変汉鐨勪吉瑁呭ソ鍊惧悜锛堝叏鐞�30%鐨勮嚜璇勯棶鍗蜂腑閮藉嚭鐜颁簡浼濂界幇璞★級銆�")) {
+            System.out.println("11");
+        }
+    }
 }
diff --git a/src/main/java/com/ots/project/tool/report/PAQ/PAQReport.java b/src/main/java/com/ots/project/tool/report/PAQ/PAQReport.java
index 40b7df9..a874d1c 100644
--- a/src/main/java/com/ots/project/tool/report/PAQ/PAQReport.java
+++ b/src/main/java/com/ots/project/tool/report/PAQ/PAQReport.java
@@ -8,6 +8,8 @@
 import com.ots.project.tool.report.MAQNEW.base.MAQConditionVO_V2;
 import com.ots.project.tool.report.MAQNEW.base.MAQSummaryCondition_V2;
 import com.ots.project.tool.report.MAQNEW.condition.*;
+import com.ots.project.tool.report.PAQ.condition.Diagnosis;
+import com.ots.project.tool.report.PAQ.condition.DiagnosisTitle;
 import com.ots.project.tool.report.ReportResultData;
 import lombok.Data;
 import lombok.Getter;
@@ -64,6 +66,10 @@
             return scoreCharacteristics;
         }).collect(Collectors.toList()));
 
+        //鏈夋晥鎬х粨鏋滆瘖鏂�
+        paramList.add(new DiagnosisTitle());
+        paramList.add(new Diagnosis());
+
         return paramList;
     }
 
diff --git a/src/main/java/com/ots/project/tool/report/PAQ/condition/Diagnosis.java b/src/main/java/com/ots/project/tool/report/PAQ/condition/Diagnosis.java
new file mode 100644
index 0000000..3b36a55
--- /dev/null
+++ b/src/main/java/com/ots/project/tool/report/PAQ/condition/Diagnosis.java
@@ -0,0 +1,94 @@
+package com.ots.project.tool.report.PAQ.condition;
+
+import com.ots.common.enums.LangTypeEnum;
+import com.ots.project.exam.domain.TLibraryCode;
+import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2;
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.*;
+
+/**
+ * 娴嬭瘯缁撴灉鏈夋晥鎬ц瘖鏂�
+ */
+@Data
+@Slf4j
+public class Diagnosis extends BaseCondition_V2 {
+    private String name = "Diagnosis";
+    private Double P_SDE23;
+    private Double P_IM24;
+    private Double P_INCON25;
+
+    @Override
+    public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) {
+        return null;
+    }
+
+    @Override
+    public Map<String, String> getMAQwaterDropsImages() {
+        return null;
+    }
+
+    @Override
+    public List<TLibraryCode> calculateList(Map<String, String> map, LangTypeEnum langType) {
+        try {
+            String p_sde_t1 = map.get("P_SDE_T1");
+            String p_im_t1 = map.get("P_IM_T1");
+            String p_incon_t1 = map.get("P_INCON_T1");
+            String p_sde23 = map.get("P_SDE23");
+            String p_im24 = map.get("P_IM24");
+            String p_incon25 = map.get("P_INCON25");
+            if (checkParamsIsNull(p_sde_t1, p_im_t1, p_incon_t1, p_sde23, p_im24, p_incon25)) {
+                return null;
+            }
+            Double P_SDE_T1 = Double.valueOf(p_sde_t1);
+            Double P_IM_T1 = Double.valueOf(p_im_t1);
+            Double P_INCON_T1 = Double.valueOf(p_incon_t1);
+            P_SDE23 = Double.valueOf(p_sde23);
+            P_IM24 = Double.valueOf(p_im24);
+            P_INCON25 = Double.valueOf(p_incon25);
+            //鍒嗘暟鍖洪棿璁$畻浠g爜
+            boolean LIBPAQGS8801_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95);
+            boolean LIBPAQGS8802_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95);
+            boolean LIBPAQGS8803_3 = false;
+            boolean LIBPAQGS8803_3_1 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 && 5 < P_IM24 && P_IM24 < 95) && (P_INCON25 < 95);
+            boolean LIBPAQGS8803_3_2 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (5 < P_SDE23 && P_SDE23 < 95 && P_IM24 <= 5) && (P_INCON25 < 95);
+            boolean LIBPAQGS8803_3_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 && P_IM24 <= 5) && (P_INCON25 < 95);
+            //涓変釜鏉′欢 鍏朵腑涓�涓鍚堝氨杩斿洖true
+            if(LIBPAQGS8803_3_1 || LIBPAQGS8803_3_2 || LIBPAQGS8803_3_3){
+                LIBPAQGS8803_3 = true;
+            }
+            boolean LIBPAQGS8804_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95);
+            boolean LIBPAQGS8805_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95);
+            boolean LIBPAQGS8806_3 = false;
+            boolean LIBPAQGS8806_3_1 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 && 5 < P_IM24 && P_IM24 < 95) && (P_INCON25 < 95);
+            boolean LIBPAQGS8806_3_2 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (5 < P_SDE23 && P_SDE23 < 95 && P_IM24 <= 5) && (P_INCON25 < 95);
+            boolean LIBPAQGS8806_3_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 && P_IM24 <= 5) && (P_INCON25 < 95);
+            //涓変釜鏉′欢 鍏朵腑涓�涓鍚堝氨杩斿洖true
+            if(LIBPAQGS8806_3_1 || LIBPAQGS8806_3_2 || LIBPAQGS8806_3_3){
+                LIBPAQGS8806_3 = true;
+            }
+
+
+            Map calculateMap = new HashMap();
+            calculateMap.put(LIBPAQGS8801_3, "LIBPAQGS88011,LIBPAQGS88012,LIBPAQGS88013");
+            calculateMap.put(LIBPAQGS8802_3, "LIBPAQGS88021,LIBPAQGS88022,LIBPAQGS88023");
+            calculateMap.put(LIBPAQGS8803_3, "LIBPAQGS88031,LIBPAQGS88032,LIBPAQGS88033");
+            calculateMap.put(LIBPAQGS8804_3, "LIBPAQGS88041,LIBPAQGS88042,LIBPAQGS88043");
+            calculateMap.put(LIBPAQGS8805_3, "LIBPAQGS88051,LIBPAQGS88052,LIBPAQGS88053");
+            calculateMap.put(LIBPAQGS8806_3, "LIBPAQGS88061,LIBPAQGS88062,LIBPAQGS88063");
+            String codeId = selectTrueObject(calculateMap);
+            String[] split = codeId.split(",");
+            List<TLibraryCode> libcodes = new ArrayList<>();
+            Arrays.stream(split).forEach(item -> {
+                libcodes.add(getMaqReportLibrary(map, item, langType));
+            });
+            return libcodes;
+        } catch (Exception ex) {
+            log.error("Diagnosis error:{}", ex.getMessage(), ex);
+            return null;
+        }
+    }
+}
diff --git a/src/main/java/com/ots/project/tool/report/PAQ/condition/DiagnosisTitle.java b/src/main/java/com/ots/project/tool/report/PAQ/condition/DiagnosisTitle.java
new file mode 100644
index 0000000..3532bc5
--- /dev/null
+++ b/src/main/java/com/ots/project/tool/report/PAQ/condition/DiagnosisTitle.java
@@ -0,0 +1,86 @@
+package com.ots.project.tool.report.PAQ.condition;
+
+import com.ots.common.enums.LangTypeEnum;
+import com.ots.project.exam.domain.TLibraryCode;
+import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 娴嬭瘯缁撴灉鏈夋晥鎬ц瘖鏂爣棰�
+ */
+@Data
+@Slf4j
+public class DiagnosisTitle extends BaseCondition_V2 {
+
+    private String name = "DiagnosisTitle";
+    private Double P_SDE_T1;
+    private Double P_IM_T1;
+    private Double P_INCON_T1;
+
+    @Override
+    public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) {
+        try {
+            String p_sde_t1 = map.get("P_SDE_T1");
+            String p_im_t1 = map.get("P_IM_T1");
+            String p_incon_t1 = map.get("P_INCON_T1");
+            String p_sde23 = map.get("P_SDE23");
+            String p_im24 = map.get("P_IM24");
+            String p_incon25 = map.get("P_INCON25");
+            if (checkParamsIsNull(p_sde_t1, p_im_t1, p_incon_t1, p_sde23, p_im24, p_incon25)) {
+                return null;
+            }
+            P_SDE_T1 = Double.valueOf(p_sde_t1);
+            P_IM_T1 = Double.valueOf(p_im_t1);
+            P_INCON_T1 = Double.valueOf(p_incon_t1);
+            Double P_SDE23 = Double.valueOf(p_sde23);
+            Double P_IM24 = Double.valueOf(p_im24);
+            Double P_INCON25 = Double.valueOf(p_incon25);
+            //鍒嗘暟鍖洪棿璁$畻浠g爜
+            boolean LIBPAQGS8801 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95);
+            boolean LIBPAQGS8802 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95);
+            boolean LIBPAQGS8803 = false;
+            boolean LIBPAQGS8803_1 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 && 5 < P_IM24 && P_IM24 < 95) && (P_INCON25 < 95);
+            boolean LIBPAQGS8803_2 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (5 < P_SDE23 && P_SDE23 < 95 && P_IM24 <= 5) && (P_INCON25 < 95);
+            boolean LIBPAQGS8803_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 && P_IM24 <= 5) && (P_INCON25 < 95);
+            //涓変釜鏉′欢 鍏朵腑涓�涓鍚堝氨杩斿洖true
+            if(LIBPAQGS8803_1 || LIBPAQGS8803_2 || LIBPAQGS8803_3){
+                LIBPAQGS8803 = true;
+            }
+            boolean LIBPAQGS8804 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95);
+            boolean LIBPAQGS8805 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95);
+            boolean LIBPAQGS8806 = false;
+            boolean LIBPAQGS8806_1 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 && 5 < P_IM24 && P_IM24 < 95) && (P_INCON25 < 95);
+            boolean LIBPAQGS8806_2 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (5 < P_SDE23 && P_SDE23 < 95 && P_IM24 <= 5) && (P_INCON25 < 95);
+            boolean LIBPAQGS8806_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 && P_IM24 <= 5) && (P_INCON25 < 95);
+            //涓変釜鏉′欢 鍏朵腑涓�涓鍚堝氨杩斿洖true
+            if(LIBPAQGS8806_1 || LIBPAQGS8806_2 || LIBPAQGS8806_3){
+                LIBPAQGS8806 = true;
+            }
+
+            //璁剧疆鍛戒腑鐨勬湁鏁堟�х粨鏋�
+            Map calculateMap = new HashMap();
+            calculateMap.put(LIBPAQGS8801, "LIBPAQGS8801");
+            calculateMap.put(LIBPAQGS8802, "LIBPAQGS8802");
+            calculateMap.put(LIBPAQGS8803, "LIBPAQGS8803");
+            calculateMap.put(LIBPAQGS8804, "LIBPAQGS8804");
+            calculateMap.put(LIBPAQGS8805, "LIBPAQGS8805");
+            calculateMap.put(LIBPAQGS8806, "LIBPAQGS8806");
+            String codeId = selectTrueObject(calculateMap);
+
+            TLibraryCode maqReportLibrary = getMaqReportLibrary(map, codeId, langType);
+            return maqReportLibrary;
+        } catch (Exception ex) {
+            log.error("DiagnosisTitle error:{}", ex.getMessage(), ex);
+            return null;
+        }
+    }
+
+    @Override
+    public Map<String, String> getMAQwaterDropsImages() {
+        return null;
+    }
+}

--
Gitblit v1.9.1