Browse Source

[task-1766] 性能验证模块 开发 (二期) / 添加新的验证方法和新的配置detail表

Li Yuan 1 year ago
parent
commit
12dba44b95

+ 15 - 7
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model/ConfigVO.java

@@ -12,12 +12,12 @@ public class ConfigVO {
     private double batchCVSValue;
     private double dailyCVS;
     private double dailyCVSValue;
-    private double allowableSDr;
-    private double allowableSDl;
+    private double[] allowableSDr;
+    private double[] allowableSDl;
     private int decimal;
 
     private double claimValue;
-
+    private int rejectionRate;
     public String[] getModel() {
         return model;
     }
@@ -106,19 +106,27 @@ public class ConfigVO {
         this.claimValue = claimValue;
     }
 
-    public double getAllowableSDr() {
+    public double[] getAllowableSDr() {
         return allowableSDr;
     }
 
-    public void setAllowableSDr(double allowableSDr) {
+    public void setAllowableSDr(double[] allowableSDr) {
         this.allowableSDr = allowableSDr;
     }
 
-    public double getAllowableSDl() {
+    public double[] getAllowableSDl() {
         return allowableSDl;
     }
 
-    public void setAllowableSDl(double allowableSDl) {
+    public void setAllowableSDl(double[] allowableSDl) {
         this.allowableSDl = allowableSDl;
     }
+
+    public int getRejectionRate() {
+        return rejectionRate;
+    }
+
+    public void setRejectionRate(int rejectionRate) {
+        this.rejectionRate = rejectionRate;
+    }
 }

+ 0 - 4
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/LinearRangeAverageSlope.java

@@ -31,9 +31,6 @@ public class LinearRangeAverageSlope extends PVModel {
 
     private final PolynomialRegression pr1 = new PolynomialRegression();
 
-    private final double claimValue;
-
-
     private double sdr;
     private double cvr;
 
@@ -42,7 +39,6 @@ public class LinearRangeAverageSlope extends PVModel {
 
         this.means = new double[this.specimensNum];
         this.standardDeviations = new double[this.specimensNum];
-        this.claimValue = configVO.getClaimValue();
         this.diffs = new double[5][this.specimensNum];
         this.dli = new double[5][this.specimensNum];
         this.targetValues = new double[this.specimensNum];

+ 0 - 2
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/LinearRangeEP6A.java

@@ -33,7 +33,6 @@ public class LinearRangeEP6A extends PVModel {
     private final PolynomialRegression pr3 = new PolynomialRegression();
     private PolynomialRegression prBest;
 
-    private final double claimValue;
 
 
     private double sdr;
@@ -44,7 +43,6 @@ public class LinearRangeEP6A extends PVModel {
 
         this.means = new double[this.specimensNum];
         this.standardDeviations = new double[this.specimensNum];
-        this.claimValue = configVO.getClaimValue();
         this.diffs = new double[5][this.specimensNum];
         this.dli = new double[5][this.specimensNum];
         this.targetValues = new double[this.specimensNum];

+ 1 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/PrecisionEP15.java

@@ -28,7 +28,7 @@ public class PrecisionEP15 extends PVModel {
             double[][] sub = new double[data.length][configVO.getRepeatNum()];
             realMatrix.copySubMatrix(0, data.length - 1,
                     i * configVO.getRepeatNum(), (i + 1) * configVO.getRepeatNum() - 1, sub);
-            items.add(new PrecisionEP15Item(specimensName[i], sub, configVO));
+            items.add(new PrecisionEP15Item(i, sub, configVO));
         }
     }
 

+ 13 - 8
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/PrecisionEP15Item.java

@@ -1,6 +1,7 @@
 package com.lc.ibps.components.verification.model2;
 
 import com.lc.ibps.components.verification.model.InspectionConfigVO;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.math3.stat.StatUtils;
 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
 
@@ -58,19 +59,23 @@ public class PrecisionEP15Item {
 
     private final double p;//0.01 or 0.05
 
-    public PrecisionEP15Item(String name, double[][] data, InspectionConfigVO configVO) {
-        this.name = name;
+    public PrecisionEP15Item(int index, double[][] data, InspectionConfigVO configVO) {
+        this.name = configVO.getSpecimensName()[index];
         this.data = data;
         this.n = configVO.getRepeatNum();
         this.allowableCVr = configVO.getBatchCVSValue();
         this.allowableCVl = configVO.getDailyCVSValue();
-        this.allowableSDr = configVO.getAllowableSDr();
-        this.allowableSDl = configVO.getAllowableSDl();
+        if(ArrayUtils.isNotEmpty(configVO.getAllowableSDr())) {
+            this.allowableSDr = configVO.getAllowableSDr()[index];
+        }
+        if(ArrayUtils.isNotEmpty(configVO.getAllowableSDl())) {
+            this.allowableSDl = configVO.getAllowableSDl()[index];
+        }
 
         this.level = configVO.getSpecimensNum();
-        int range = configVO.getRange();
-        if (range > 0 && range < 100) {
-            this.p = (double) (100 - range) / 100;
+        int rate = configVO.getRejectionRate();
+        if (rate > 0 && rate < 100) {
+            this.p = (double) (rate / 100);
         } else {
             this.p = 0.01;
         }
@@ -255,7 +260,7 @@ public class PrecisionEP15Item {
         double d = data.length;
 
 //        double cr = PVModel.getCValue(df, level, 0.05);
-        verR = allowableSDr * Math.sqrt(PVModel.getCValue(df, level, 0.05) / df);
+        verR = allowableSDr * Math.sqrt(PVModel.getCValue(df, level, p) / df);
 
         //t=((((C14-1)*(C16^2))+(C14*M11))^2)/(((C14-1)/C13*(C16^4))+(((C14^2)*(M11^2))/(C13-1)))
         t = (Math.pow((((n - 1) * (Math.pow(sdr, 2))) + (n * vb)), 2)) / (((n - 1) / d * (Math.pow(sdr, 4))) + (((Math.pow(n, 2)) * (Math.pow(vb, 2))) / (d - 1)));

+ 8 - 0
ibps-provider-root/modules/provider-business/src/main/resources/pv/report/precisionEP15A2.ftl

@@ -1,5 +1,13 @@
 <h3>结果判读</h3>
 <p>
+    重复精密度
+    计算值 S,与厂家声称值σ,相比较
+    计算值 S.(0.632 mg/dL)<厂家声称值,(1.0 mg/dL),表明厂家声称的重复精密度可靠,不需再计算验证值。
+
+    验证结论
+    计算值 S,<厂家声称值。,表明厂家声称的重复精密度可靠。A.3.2 期间精密度A.3.2.1 计算值S与厂家声称值相比较
+    计算值 S(2.21 mg/dL)>厂家声称值。(2.0 mg/dL),需将计算值。与验证值比较。A.3.2.2 验证值的计算
+    A.3.2.2.1 按公式(9)计算自由度(T):
 与厂家声明的标准差或 CV 比较。如果测得的SDl 或 CV 小于厂家声明的实验室标准差则通过验证。若测得的室内标准差大于厂家声明的实验室标准差则应先计算 T 值(程序计算参数,即有效自由度),再通过 T 值来计算出“验证值”,验证厂家提供的精密度声明的上限。如果 SD 低于这一验证值,则已证实满足厂家的声明要求。