فهرست منبع

性能验证模块 开发 (二期) / 添加精密度结论模板内容

liyuan 1 سال پیش
والد
کامیت
8feea4117e

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

@@ -103,4 +103,7 @@ public class PrecisionEP15 extends PVModel {
         return table;
     }
 
+    public List<PrecisionEP15Item> getItems() {
+        return items;
+    }
 }

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

@@ -58,6 +58,7 @@ public class PrecisionEP15Item {
     private final int df;
 
     private final double p;//0.01 or 0.05
+    private double cr;
 
     public PrecisionEP15Item(int index, double[][] data, InspectionConfigVO configVO) {
         this.name = configVO.getSpecimensName()[index];
@@ -82,6 +83,26 @@ public class PrecisionEP15Item {
         this.df = configVO.getDays() * (configVO.getRepeatNum() - 1);
     }
 
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getLevel() {
+        return level;
+    }
+
+    public int getDf() {
+        return df;
+    }
+
+    public double getP() {
+        return p;
+    }
+
     public double getN() {
         return n;
     }
@@ -98,6 +119,14 @@ public class PrecisionEP15Item {
         this.vr = vr;
     }
 
+    public double getCr() {
+        return cr;
+    }
+
+    public void setCr(double cr) {
+        this.cr = cr;
+    }
+
     public double getSdb() {
         return sdb;
     }
@@ -221,9 +250,6 @@ public class PrecisionEP15Item {
 
     public void calculate() {
         //批内标准差
-//        xValue[] vrs = Arrays.stream(data).map(SpecimensCalcVO::getVariance).toArray(xValue[]::new);
-//        double withinVr = xAverage.eval(vrs).getDoub();
-//        sr = Math.sqrt(withinVr);
         double[] vrs = new double[data.length];
         for (int i = 0; i < data.length; i++) {
             vrs[i] = StatUtils.variance(data[i]);
@@ -231,7 +257,6 @@ public class PrecisionEP15Item {
         vr = StatUtils.mean(vrs);
         sdr = Math.sqrt(vr);//SDr 为批内标准差
         //总均值
-//        xValue[] means = Arrays.stream(data).map(SpecimensCalcVO::getMean).toArray(xValue[]::new);
         double[] means = new double[data.length];
         for (int i = 0; i < data.length; i++) {
             means[i] = StatUtils.mean(data[i]);
@@ -259,8 +284,8 @@ public class PrecisionEP15Item {
         }
         double d = data.length;
 
-//        double cr = PVModel.getCValue(df, level, 0.05);
-        verR = allowableSDr * Math.sqrt(PVModel.getCValue(df, level, p) / df);
+        cr = PVModel.getCValue(df, level, p);
+        verR = allowableSDr * Math.sqrt(cr / 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)));

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

@@ -1,15 +1,44 @@
-<h3>结果判读</h3>
+<#list items! as item>
+<h3>${item.name} 结论判断:</h3>
+    <h5>重复(批内)精密度</h5>
 <p>
-    重复精密度
-    计算值 S,与厂家声称值σ,相比较
-    计算值 S.(0.632 mg/dL)<厂家声称值,(1.0 mg/dL),表明厂家声称的重复精密度可靠,不需再计算验证值。
+    <strong> 计算值S<sub>r</sub>与厂家声称值σ<sub>r</sub>相比较 </strong>
+    <#if (item.sdr > item.allowableSDr)>
+        计算值 S<sub>r</sub>(${item.sdr} ${units}) > 厂家声称值σ<sub>r</sub>(${item.allowableSDr} ${units}),需将计算值与验证值比较。<br />
+    <strong>验证值的计算:</strong><br />
+        自由度(df) = ${item.df} <br />
+        C点的确定: 当 假失控率 a = ${item.p}, ${item.level}个水平时, C = ${item.cr} <br />
+        验证值<sub>r</sub> = ${item.verR} <br />
+        <strong> 计算值S<sub>r</sub>与验证值<sub>r</sub>相比较 </strong> <br />
+        <#if (item.sdr > item.verR)>
+            计算值 S<sub>r</sub>(${item.sdr} ${units}) > 厂家声称值σ<sub>r</sub>(${item.allowableSDr} ${units}),表明厂家声称的重复精密度未得到临床实验室验证,应与厂家联系并取得帮助。
+        <#else>
+            计算值 S<sub>r</sub>(${item.sdr} ${units}) ≤ 厂家声称值σ<sub>r</sub>(${item.allowableSDr} ${units}),则证实满足厂家的声明要求。
+        </#if>
+    <#else>
+        计算值 S<sub>r</sub>(${item.sdr} ${units}) ≤ 厂家声称值σ<sub>r</sub>(${item.allowableSDr} ${units}),表明厂家声称的重复精密度可靠,不需再计算验证值。
+    </#if>
 
-    验证结论
-    计算值 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 低于这一验证值,则已证实满足厂家的声明要求。
+</p>
 
+    <h5>期间(室内)精密度</h5>
+    <p>
+        <strong> 计算值S<sub>l</sub>与厂家声称值σ<sub>l</sub>相比较 </strong>
+        <#if (item.sdl > item.allowableSDl)>
+            计算值 S<sub>l</sub>(${item.sdl} ${units}) > 厂家声称值σ<sub>l</sub>(${item.allowableSDl} ${units}),需将计算值与验证值比较。<br />
+            <strong>验证值的计算:</strong><br />
+            自由度(T) = ${item.t} <br />
+            C点的确定: 当 假失控率 a = ${item.p}, ${item.level}个水平时, C = ${item.c} <br />
+            验证值<sub>l</sub> = ${item.verL} <br />
+            <strong> 计算值S<sub>l</sub>与验证值<sub>l</sub>相比较 </strong> <br />
+            <#if (item.sdl > item.verL)>
+                计算值 S<sub>l</sub>(${item.sdl} ${units}) > 厂家声称值σ<sub>l</sub>(${item.allowableSDl} ${units}),表明厂家声称的重复精密度未得到临床实验室验证,应与厂家联系并取得帮助。
+            <#else>
+                计算值 S<sub>l</sub>(${item.sdl} ${units}) ≤ 厂家声称值σ<sub>l</sub>(${item.allowableSDl} ${units}),则证实满足厂家的声明要求。
+            </#if>
+        <#else>
+            计算值 S<sub>l</sub>(${item.sdl} ${units}) ≤ 厂家声称值σ<sub>l</sub>(${item.allowableSDl} ${units}),表明厂家声称的重复精密度可靠,不需再计算验证值。
+        </#if>
 
-与室间质量评价文件推荐的允许总误差(total allowable error,TEa)比较。得到的 CV 或标准差与 TEa 进行比较。a. 批内精密度或标准差应≤TEa 的 1/4。b. 批间精密度或标准差应≤TEa 的 1/3。±
-</p>
+    </p>
+</#list>

+ 4 - 3
ibps-provider-root/modules/provider-business/src/main/resources/pv/report/precisionRepeatability.ftl

@@ -1,10 +1,11 @@
 <#list specimensName! as name>
+    <#assign x = name?index>
     <h3>${name} 结论判断:</h3>
     <p>
-      <#if (cvs[name?index] > batchCVSValue)>
-          计算得出的变异系数 ${cvs[name?index]} > ${teaFormat}, 验证不合格。
+      <#if (cvs[x] > batchCVSValue)>
+          计算得出的变异系数 ${cvs[x]} > ${teaFormat}(${batchCVSValue}), 验证不合格。
       <#else>
-          计算得出的变异系数 ${cvs[name?index]} ≤ ${teaFormat}, 验证合格。
+          计算得出的变异系数 ${cvs[x]} ≤ ${teaFormat}(${batchCVSValue}), 验证合格。
       </#if>
     </p>
 </#list>

+ 4 - 2
ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/verification/model2/PrecisionEP15Test.java

@@ -28,8 +28,10 @@ public class PrecisionEP15Test {
         InspectionConfigVO config = new InspectionConfigVO("精密度", 5, 2,
                 null, 3, LocalDate.now(), true);
         config.setRange(99);
-        config.setBatchCVSValue(3.2);
-        config.setDailyCVSValue(3.1);
+//        config.setBatchCVSValue(3.2);
+//        config.setDailyCVSValue(3.1);
+        config.setAllowableSDl(new double[]{0.01,0.02});
+        config.setAllowableSDr(new double[]{0.08,0.06});
         config.setDecimal(3);
         config.setUnits("mmg/L");
         config.setKey(ModelEnum.PrecisionEP15.getKey());