Search in sources :

Example 1 with ParentLibrary

use of uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary in project miso-lims by miso-lims.

the class PoolImplTest method addElement.

private void addElement(PoolImpl pool, Index index1, Index index2) {
    ListLibraryAliquotView ldi = new ListLibraryAliquotView();
    ldi.setParentLibrary(new ParentLibrary());
    ldi.getParentLibrary().setIndex1(index1);
    ldi.getParentLibrary().setIndex2(index2);
    PoolElement element = new PoolElement(pool, ldi);
    pool.getPoolContents().add(element);
}
Also used : ParentLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary) ListLibraryAliquotView(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ListLibraryAliquotView) PoolElement(uk.ac.bbsrc.tgac.miso.core.data.impl.view.PoolElement)

Example 2 with ParentLibrary

use of uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary 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;
                }
            }
        }
    }
}
Also used : ParentLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary) ParentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentSample) GrandparentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.GrandparentSample) ParentAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentAliquot)

Aggregations

ParentLibrary (uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary)2 GrandparentSample (uk.ac.bbsrc.tgac.miso.core.data.impl.view.GrandparentSample)1 ListLibraryAliquotView (uk.ac.bbsrc.tgac.miso.core.data.impl.view.ListLibraryAliquotView)1 ParentAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentAliquot)1 ParentSample (uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentSample)1 PoolElement (uk.ac.bbsrc.tgac.miso.core.data.impl.view.PoolElement)1