Search in sources :

Example 1 with LabImpl

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

the class Dtos method to.

public static Transfer to(@Nonnull TransferDto from) {
    Transfer to = new Transfer();
    setLong(to::setId, from.getId(), false);
    setString(to::setTransferRequestName, from.getTransferRequestName());
    setDateTime(to::setTransferTime, from.getTransferTime());
    setObject(to::setSenderLab, LabImpl::new, from.getSenderLabId());
    setObject(to::setSenderGroup, Group::new, from.getSenderGroupId());
    setString(to::setRecipient, from.getRecipient());
    setObject(to::setRecipientGroup, Group::new, from.getRecipientGroupId());
    addTransferItems(to::getSampleTransfers, from.getItems(), EntityType.SAMPLE, TransferSample::new, SampleImpl::new, SampleBoxPosition::new, Sample::setBoxPosition);
    addTransferItems(to::getLibraryTransfers, from.getItems(), EntityType.LIBRARY, TransferLibrary::new, LibraryImpl::new, LibraryBoxPosition::new, Library::setBoxPosition);
    addTransferItems(to::getLibraryAliquotTransfers, from.getItems(), EntityType.LIBRARY_ALIQUOT, TransferLibraryAliquot::new, LibraryAliquot::new, LibraryAliquotBoxPosition::new, LibraryAliquot::setBoxPosition);
    addTransferItems(to::getPoolTransfers, from.getItems(), EntityType.POOL, TransferPool::new, PoolImpl::new, PoolBoxPosition::new, Pool::setBoxPosition);
    return to;
}
Also used : Group(com.eaglegenomics.simlims.core.Group) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) ParentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentSample) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) Sample(uk.ac.bbsrc.tgac.miso.core.data.Sample) WorksetSample(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetSample) GrandparentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.GrandparentSample) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) LibraryAliquotBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryAliquotBoxPosition) LibraryBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryBoxPosition) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) WorksetLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibraryAliquot) OrderLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.OrderLibraryAliquot) DetailedLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) PoolImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) SampleBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.SampleBoxPosition) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) PoolBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.PoolBoxPosition) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) InstrumentStatusPositionRunPool(uk.ac.bbsrc.tgac.miso.core.data.impl.view.instrumentstatus.InstrumentStatusPositionRunPool) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) ParentLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) WorksetLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibrary) Library(uk.ac.bbsrc.tgac.miso.core.data.Library) SampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)

Example 2 with LabImpl

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

the class Dtos method toReceiptTransfer.

private static <T extends Boxable, R extends TransferItem<T>> R toReceiptTransfer(@Nonnull ReceivableDto<T, R> from, @Nonnull T item) {
    if (isStringEmptyOrNull(from.getReceivedTime())) {
        return null;
    }
    R transferItem = from.makeTransferItem();
    transferItem.setItem(item);
    setBoolean(transferItem::setReceived, from.isReceived(), true);
    setBoolean(transferItem::setQcPassed, from.isReceiptQcPassed(), true);
    setString(transferItem::setQcNote, from.getReceiptQcNote());
    Transfer transfer = new Transfer();
    transferItem.setTransfer(transfer);
    from.getTransferItemsFunction().apply(transfer).add(transferItem);
    setDateTime(transfer::setTransferTime, from.getReceivedTime());
    setObject(transfer::setSenderLab, LabImpl::new, from.getSenderLabId());
    setObject(transfer::setRecipientGroup, Group::new, from.getRecipientGroupId());
    return transferItem;
}
Also used : Group(com.eaglegenomics.simlims.core.Group) Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl)

Example 3 with LabImpl

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

the class Dtos method to.

public static Lab to(@Nonnull LabDto from) {
    Lab to = new LabImpl();
    setLong(to::setId, from.getId(), false);
    setString(to::setAlias, from.getAlias());
    setBoolean(to::setArchived, from.getArchived(), false);
    return to;
}
Also used : LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab)

Example 4 with LabImpl

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

the class HibernateLabDaoIT method testAddLab.

@Test
public void testAddLab() {
    Lab l = new LabImpl();
    l.setAlias("NewLab");
    User user = new UserImpl();
    user.setId(1L);
    l.setCreator(user);
    l.setLastModifier(user);
    Date now = new Date();
    l.setCreationTime(now);
    l.setLastModified(now);
    final long newId = dao.create(l);
    Lab saved = dao.get(newId);
    assertNotNull(saved);
    assertEquals(l.getAlias(), saved.getAlias());
}
Also used : User(com.eaglegenomics.simlims.core.User) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab) Date(java.util.Date) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 5 with LabImpl

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

the class Dtos method toTissueSample.

private static SampleTissue toTissueSample(@Nonnull SampleTissueDto from) {
    SampleTissue to = new SampleTissueImpl();
    to.setPassageNumber(from.getPassageNumber());
    to.setTimesReceived(from.getTimesReceived());
    to.setTubeNumber(from.getTubeNumber());
    to.setRegion(nullifyStringIfBlank(from.getRegion()));
    to.setSecondaryIdentifier(from.getSecondaryIdentifier());
    if (from.getTissueOriginId() != null) {
        TissueOrigin tissueOrigin = new TissueOriginImpl();
        tissueOrigin.setId(from.getTissueOriginId());
        to.setTissueOrigin(tissueOrigin);
    }
    if (from.getTissueTypeId() != null) {
        TissueType tissueType = new TissueTypeImpl();
        tissueType.setId(from.getTissueTypeId());
        to.setTissueType(tissueType);
    }
    if (from.getTissueMaterialId() != null) {
        TissueMaterial tissueMaterial = new TissueMaterialImpl();
        tissueMaterial.setId(from.getTissueMaterialId());
        to.setTissueMaterial(tissueMaterial);
    }
    if (from.getLabId() != null) {
        Lab lab = new LabImpl();
        lab.setId(from.getLabId());
        to.setLab(lab);
    }
    setString(to::setTimepoint, from.getTimepoint());
    return to;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) TissueMaterialImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl) TissueOrigin(uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin) TissueType(uk.ac.bbsrc.tgac.miso.core.data.TissueType) TissueMaterial(uk.ac.bbsrc.tgac.miso.core.data.TissueMaterial) TissueOriginImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueOriginImpl) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) SampleTissueImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl) TissueTypeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab)

Aggregations

LabImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl)6 Lab (uk.ac.bbsrc.tgac.miso.core.data.Lab)4 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)3 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)3 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)3 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)3 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)3 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)3 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)3 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)3 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)3 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)3 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)3 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)3 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)3 Group (com.eaglegenomics.simlims.core.Group)2 Transfer (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer)2 User (com.eaglegenomics.simlims.core.User)1 Date (java.util.Date)1 Test (org.junit.Test)1