Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/main/java/org/mskcc/limsrest/model/SampleManifest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,36 @@ public void addQcReport(QcReport r) {
public static class QcReport {
public QcReport() {}

public QcReport(QcReportType qcReportType,
String IGORecommendation, String comments, String investigatorDecision, String DIN) {
/**
* DNA / Library QC (and RNA when rin/totalMass are not needed): {@code rin} and {@code totalMass} are null.
*/
public QcReport(QcReportType qcReportType,
String IGORecommendation, String comments, String investigatorDecision, String DIN) {
this(qcReportType, IGORecommendation, comments, investigatorDecision, DIN, null, null);
}

/**
* Full QC report; use {@code rin} and {@code totalMass} for {@link QcReportType#RNA}.
*/
public QcReport(QcReportType qcReportType,
String IGORecommendation, String comments, String investigatorDecision, String DIN,
String RIN, Double totalMass) {
this.qcReportType = qcReportType;
this.IGORecommendation = IGORecommendation;
this.comments = comments;
this.investigatorDecision = investigatorDecision;
this.din = DIN;
this.rin = RIN;
this.totalMass = totalMass;
}

public QcReportType qcReportType;
public String IGORecommendation;
public String comments;
public String investigatorDecision;
public String din;
public String rin;
public Double totalMass;
}
@NoArgsConstructor @ToString
@Getter @Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,38 @@ protected void addIGOQcRecommendations(SampleManifest sampleManifest, DataRecord
}
}

log.info("Searching for QcReportRna report");
List<DataRecord> qcRecordsRna = sample.getDescendantsOfType("QcReportRna", user);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FahimehMirhaj can this return null? If accessing null qcrecordsrna if statement will fill

Copy link
Copy Markdown
Member Author

@FahimehMirhaj FahimehMirhaj Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

if (qcRecordsRna != null && !qcRecordsRna.isEmpty()) {
try {
DataRecord qcRecord = qcRecordsRna.get(0);
int i = 1;
while (qcRecord.getBooleanVal("HideFromSampleQC", user) && i < qcRecordsRna.size()) {
qcRecord = qcRecordsRna.get(i++);
}
String igoQcRecommendation = qcRecord.getStringVal("IgoQcRecommendation", user);
String comments = qcRecord.getStringVal("Comments", user);
String id = qcRecord.getStringVal("InvestigatorDecision", user);
String rin = null;
try {
rin = qcRecord.getStringVal("RIN", user);
} catch (Exception rinEx) {
log.warn("Failed to retrieve RIN value: " + rinEx.getMessage());
}
Double totalMass = null;
try {
totalMass = qcRecord.getDoubleVal("TotalMass", user);
} catch (Exception massEx) {
log.warn("Failed to retrieve TotalMass value: " + massEx.getMessage());
}
SampleManifest.QcReport r = new SampleManifest.QcReport(
SampleManifest.QcReportType.RNA, igoQcRecommendation, comments, id, null, rin, totalMass);
sampleManifest.addQcReport(r);
} catch (Exception e) {
log.warn("Failed to retrieve RNA QC Record value: " + e.getMessage());
}
}

log.info("Searching for QcReportLibrary");
List<DataRecord> qcRecordsLib = sample.getDescendantsOfType("QcReportLibrary", user);
if (qcRecordsLib.size() > 0) {
Expand Down