|
|
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.lc.ibps.components.verification.model.InspectionConfigVO;
|
|
|
import com.lc.ibps.components.verification.report.ChartDTO;
|
|
|
import com.lc.ibps.components.verification.report.TableDTO;
|
|
|
+import org.apache.commons.math3.linear.MatrixUtils;
|
|
|
+import org.apache.commons.math3.linear.RealMatrix;
|
|
|
import org.apache.commons.math3.stat.StatUtils;
|
|
|
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
|
|
|
|
|
@@ -15,6 +17,7 @@ public class TruenessEP15Patient extends PVModel {
|
|
|
private final double[] y;
|
|
|
//样本的标示值/理论值 x
|
|
|
private final double[] x;
|
|
|
+ private final double rejectionRate;
|
|
|
private double[] yx;
|
|
|
private double[] yxb;
|
|
|
|
|
|
@@ -33,17 +36,15 @@ public class TruenessEP15Patient extends PVModel {
|
|
|
|
|
|
public TruenessEP15Patient(double[][] data, InspectionConfigVO configVO) {
|
|
|
super(data, configVO);
|
|
|
- this.y = data[0];
|
|
|
- this.x = data[1];
|
|
|
+ final RealMatrix realMatrix = MatrixUtils.createRealMatrix(data);
|
|
|
+ this.y = realMatrix.getColumn(0);
|
|
|
+ this.x = realMatrix.getColumn(1);
|
|
|
meanX = StatUtils.mean(x);
|
|
|
meanY = StatUtils.mean(y);
|
|
|
-// if(t == 0){
|
|
|
- this.t = getTValue(this.y.length - 1, 0.01);
|
|
|
-// }else {
|
|
|
-// this.t = t;
|
|
|
-// }
|
|
|
this.n = this.y.length;
|
|
|
this.sdClaim = configVO.getClaimValue();
|
|
|
+ this.rejectionRate = (double)configVO.getRejectionRate()/100;
|
|
|
+ this.t = getTValue(this.y.length - 1, rejectionRate);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -157,7 +158,11 @@ public class TruenessEP15Patient extends PVModel {
|
|
|
this.sdClaim = sdClaim;
|
|
|
}
|
|
|
|
|
|
- public double[][] getData() {
|
|
|
+ public double getRejectionRate() {
|
|
|
+ return rejectionRate;
|
|
|
+ }
|
|
|
+
|
|
|
+ public double[][] getReportData() {
|
|
|
|
|
|
double[][] d = new double[y.length][5];
|
|
|
for (int i = 0; i < y.length; i++) {
|
|
|
@@ -175,32 +180,27 @@ public class TruenessEP15Patient extends PVModel {
|
|
|
TableDTO table = new TableDTO();
|
|
|
String[] header = {"次数", "Y (实验方法)", "X (比较方法)", "Y<sub>i</sub>-X<sub>i</sub>", "(Y<sub>i</sub>-X<sub>i</sub>-B)"};
|
|
|
table.buildHeader(header);
|
|
|
- table.buildData(getData(), getScale());
|
|
|
+ table.buildData(getReportData(), getScale());
|
|
|
return table;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
TableDTO buildTable1DTO(int sheetIndex) {
|
|
|
TableDTO table = new TableDTO();
|
|
|
- String[][] data = new String[8][2];
|
|
|
-
|
|
|
- data[0] = new String[]{"Y均值", format(meanY)};
|
|
|
- data[1] = new String[]{"X均值", format(meanX)};
|
|
|
- data[2] = new String[]{"差值(B)", format(bias)};
|
|
|
- data[3] = new String[]{"差值标准差(SD<sub>diff</sub>)", format(sdDiff)};
|
|
|
- data[4] = new String[]{"置信区间上限", format(ucl)};
|
|
|
- data[5] = new String[]{"置信区间下限", format(lcl)};
|
|
|
- data[6] = new String[]{"验证区间上限", format(uvl)};
|
|
|
- data[7] = new String[]{"验证区间下限", format(lvl)};
|
|
|
-// data[1] =new String[]{"批内方差 (V<sub>r</sub>)" , format(item.vr)};
|
|
|
-// data[2] =new String[]{"批内标准差 (S<sub>r</sub>)" , format(item.sr)};
|
|
|
-// data[3] =new String[]{"批内变异系数 (CV<sub>r</sub>)" , format(item.cvr)};
|
|
|
-// data[4] =new String[]{"",""};
|
|
|
-// data[5] =new String[]{"批间方差 (V<sub>b</sub>)" , format(item.vb)};
|
|
|
-//// data[4] =new String[]{"批间标准差 (S<sub>b</sub>)" , format(item.sb)};
|
|
|
-// data[6] =new String[]{"实验室内标准差 (S<sub>1</sub>)" , format(item.s1)};
|
|
|
-// data[7] =new String[]{"实验室变异系数 (CV)" , format(item.cv1)};
|
|
|
- table.buildData(data);
|
|
|
+ String[] header = {"实验项目", "Y均值","X均值","差值(B)", "差值标准差(SD<sub>diff</sub>)", "验证区间", "厂家声称偏倚"};
|
|
|
+ table.buildHeader(header);
|
|
|
+
|
|
|
+ String[][] r = new String[1][7];
|
|
|
+
|
|
|
+ r[0][0] = getItemName();
|
|
|
+ r[0][1] = format(meanY);
|
|
|
+ r[0][2] = format(meanX);
|
|
|
+ r[0][3] = format(bias);
|
|
|
+ r[0][4] = format(sdDiff);
|
|
|
+ r[0][5] = String.format("%s %s ~ %s %s",format(lvl),getUnits(),format(uvl),getUnits());
|
|
|
+ r[0][6] = format(sdClaim);
|
|
|
+
|
|
|
+ table.buildData(r);
|
|
|
return table;
|
|
|
}
|
|
|
|