20250402 更新
1.处理检验扩展数据中属于基峰的值设置为/
This commit is contained in:
@@ -63,6 +63,8 @@ public interface TestRecordSampleDataConstant {
|
||||
|
||||
Double INVALID_VALUE = -999d;
|
||||
|
||||
String INVALID_VALUE_STR = "/";
|
||||
|
||||
// 判断当前值是否是无效值
|
||||
static boolean isInvalidValue(Double value) {
|
||||
return value != null && INVALID_VALUE.equals(value);
|
||||
|
||||
@@ -5,6 +5,7 @@ import digital.laboratory.platform.inspection.dto.SampleInspectDataDTO;
|
||||
import digital.laboratory.platform.inspection.entity.TestRecordSampleData;
|
||||
import digital.laboratory.platform.inspection.vo.TestRecordSampleDataVO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -28,7 +29,12 @@ public class TestRecordSampleDataConverter {
|
||||
testRecordSampleData.setSampleConcentration(vo.getSampleConcentration());
|
||||
testRecordSampleData.setCompoundName(vo.getCompoundName());
|
||||
testRecordSampleData.setRtTimeWithinError(vo.getRtTimeWithinError());
|
||||
testRecordSampleData.setRtTimeError(vo.getRtTimeError());
|
||||
String rtTimeError = vo.getRtTimeError();
|
||||
if (rtTimeError != null && rtTimeError.equals(TestRecordSampleDataConstant.INVALID_VALUE_STR)) {
|
||||
testRecordSampleData.setRtTimeError(null);
|
||||
} else {
|
||||
testRecordSampleData.setRtTimeError(new BigDecimal(rtTimeError));
|
||||
}
|
||||
testRecordSampleData.setTargetRtTime(vo.getTargetRtTime());
|
||||
testRecordSampleData.setStdRtTime(vo.getStdRtTime());
|
||||
testRecordSampleData.setIsDetected(vo.getIsDetected().equals(TestRecordSampleDataConstant.IS) ? 1 : 0);
|
||||
|
||||
@@ -324,7 +324,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
|
||||
testDataJson.set("swsj", NULL_PLACEHOLDER); // 上机
|
||||
testDataJson.set("swyxtj", NULL_PLACEHOLDER); // 液相条件
|
||||
testDataJson.set("swzptj", NULL_PLACEHOLDER); // 质谱条件
|
||||
testDataJson.set("wjcjgpd", "±" + processInspectDataService.getHairCaseIonAbundanceRatioWithinErrorRange(stdData.getIonAbundanceRatio().doubleValue())); //相对离子丰度比的最大允许相对误差(%)
|
||||
testDataJson.set("wjcjgpd", "±" + processInspectDataService.getHairCaseIonAbundanceRatioWithinErrorRange(Double.parseDouble(stdData.getIonAbundanceRatio()))); //相对离子丰度比的最大允许相对误差(%)
|
||||
testDataJson.set("wtdw", entrustInfo.getEntrustDepartment());
|
||||
testDataJson.set("wzdy", StrUtil.join(",", drug.getMainDeclusteringPotential(), drug.getMinorDeclusteringPotential()));
|
||||
return testDataJson;
|
||||
|
||||
@@ -50,12 +50,25 @@ public class TestRecordSampleDataExpandVO {
|
||||
|
||||
/************************ 处理需要特定格式返回的字段 **************************/
|
||||
|
||||
public BigDecimal getIonAbundanceRatio() {
|
||||
return ionAbundanceRatio != null ? ionAbundanceRatio.setScale(2, RoundingMode.HALF_UP) : null;
|
||||
public String getIonAbundanceRatio() {
|
||||
if (getBasePeak()) {
|
||||
return "/";
|
||||
}
|
||||
return ionAbundanceRatio != null ? ionAbundanceRatio.setScale(2, RoundingMode.HALF_UP).toString() : null;
|
||||
}
|
||||
|
||||
public BigDecimal getIonAbundanceRatioError() {
|
||||
return ionAbundanceRatioError != null ? ionAbundanceRatioError.setScale(2, RoundingMode.HALF_UP) : null;
|
||||
public String getIonAbundanceRatioError() {
|
||||
if (getBasePeak()) {
|
||||
return "/";
|
||||
}
|
||||
return ionAbundanceRatioError != null ? ionAbundanceRatioError.setScale(2, RoundingMode.HALF_UP).toString() : null;
|
||||
}
|
||||
|
||||
public String getIonAbundanceRatioWithinError() {
|
||||
if (getBasePeak()) {
|
||||
return "/";
|
||||
}
|
||||
return ionAbundanceRatioWithinError;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,8 +89,11 @@ public class TestRecordSampleDataVO {
|
||||
return isDetected.equals(1) ? TestRecordSampleDataConstant.IS : TestRecordSampleDataConstant.NO;
|
||||
}
|
||||
|
||||
public BigDecimal getRtTimeError() {
|
||||
return rtTimeError != null ? rtTimeError.setScale(3, RoundingMode.HALF_UP) : null;
|
||||
public String getRtTimeError() {
|
||||
if (sampleType.equals(TestRecordSampleDataConstant.SAMPLE_TYPE_STD)) {
|
||||
return TestRecordSampleDataConstant.INVALID_VALUE_STR;
|
||||
}
|
||||
return rtTimeError != null ? rtTimeError.setScale(3, RoundingMode.HALF_UP).toString() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,11 +101,11 @@ public class TestRecordSampleDataVO {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getIonAbundanceRatioError() {
|
||||
public String getIonAbundanceRatioError() {
|
||||
return expandList != null && expandList.size() > 1 ? expandList.get(1).getIonAbundanceRatioError() : null;
|
||||
}
|
||||
|
||||
public BigDecimal getIonAbundanceRatio() {
|
||||
public String getIonAbundanceRatio() {
|
||||
return expandList != null && expandList.size() > 1 ? expandList.get(1).getIonAbundanceRatio() : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user