use of uk.ac.bbsrc.tgac.miso.core.data.impl.view.GrandparentSample in project miso-lims by miso-lims.
the class Dtos method setEffectiveQcFailure.
private static void setEffectiveQcFailure(ListLibraryAliquotView from, UpstreamQcFailableDto to) {
for (ParentAliquot parent = from.getParentAliquot(); parent != null; parent = parent.getParentAliquot()) {
if (parent.getDetailedQcStatus() != null && Boolean.FALSE.equals(parent.getDetailedQcStatus().getStatus())) {
to.setEffectiveQcFailureId(parent.getDetailedQcStatus().getId());
to.setEffectiveQcFailureLevel(EntityType.LIBRARY_ALIQUOT.getLabel());
return;
}
}
ParentLibrary lib = from.getParentLibrary();
if (lib != null) {
if (lib.getDetailedQcStatus() != null && Boolean.FALSE.equals(lib.getDetailedQcStatus().getStatus())) {
to.setEffectiveQcFailureId(lib.getDetailedQcStatus().getId());
to.setEffectiveQcFailureLevel(EntityType.LIBRARY.getLabel());
return;
}
ParentSample sam = lib.getParentSample();
if (sam != null) {
if (sam.getDetailedQcStatus() != null && Boolean.FALSE.equals(sam.getDetailedQcStatus().getStatus())) {
to.setEffectiveQcFailureId(sam.getDetailedQcStatus().getId());
to.setEffectiveQcFailureLevel(sam.getParentSampleClass() == null ? EntityType.SAMPLE.getLabel() : sam.getParentSampleClass().getSampleCategory());
return;
}
for (GrandparentSample parent = sam.getParentSample(); parent != null; parent = parent.getParentSample()) {
if (sam.getDetailedQcStatus() != null && Boolean.FALSE.equals(sam.getDetailedQcStatus().getStatus())) {
to.setEffectiveQcFailureId(parent.getDetailedQcStatus().getId());
to.setEffectiveQcFailureLevel(parent.getParentSampleClass() == null ? EntityType.SAMPLE.getLabel() : parent.getParentSampleClass().getSampleCategory());
return;
}
}
}
}
}
Aggregations