use of uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl in project miso-lims by miso-lims.
the class DefaultRunServiceTest method makeSequencer.
private static Instrument makeSequencer() {
Instrument inst = new InstrumentImpl();
inst.setId(1L);
inst.setName(SEQUENCER_NAME);
inst.setInstrumentModel(makeInstrumentModel());
return inst;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static Instrument to(@Nonnull InstrumentDto dto) {
Instrument to = new InstrumentImpl();
setLong(to::setId, dto.getId(), false);
setDate(to::setDateCommissioned, dto.getDateCommissioned());
setDate(to::setDateDecommissioned, dto.getDateDecommissioned());
setString(to::setName, dto.getName());
setObject(to::setInstrumentModel, InstrumentModel::new, dto.getInstrumentModelId());
setString(to::setSerialNumber, dto.getSerialNumber());
setObject(to::setUpgradedInstrument, InstrumentImpl::new, dto.getUpgradedInstrumentId());
setObject(to::setDefaultRunPurpose, RunPurpose::new, dto.getDefaultRunPurposeId());
setString(to::setIdentificationBarcode, dto.getIdentificationBarcode());
setObject(to::setWorkstation, Workstation::new, dto.getWorkstationId());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static final ArrayRun to(@Nonnull ArrayRunDto from) {
ArrayRun run = new ArrayRun();
if (from.getId() != null) {
run.setId(from.getId());
}
run.setAlias(from.getAlias());
run.setDescription(nullifyStringIfBlank(from.getDescription()));
run.setFilePath(nullifyStringIfBlank(from.getFilePath()));
setObject(run::setInstrument, InstrumentImpl::new, from.getInstrumentId());
setObject(run::setArray, Array::new, from.getArrayId());
run.setHealth(HealthType.get(from.getStatus()));
setDate(run::setStartDate, from.getStartDate());
setDate(run::setCompletionDate, from.getCompletionDate());
setDate(run::setLastModified, from.getLastModified());
return run;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static Run to(@Nonnull RunDto dto) {
Run to = getPlatformRun(dto);
setLong(to::setId, dto.getId(), false);
setString(to::setName, dto.getName());
setString(to::setAlias, dto.getAlias());
setString(to::setDescription, dto.getDescription());
setObject(to::setHealth, dto.getStatus(), status -> HealthType.get(status));
setString(to::setAccession, dto.getAccession());
setObject(to::setSequencer, InstrumentImpl::new, dto.getInstrumentId());
setDate(to::setStartDate, dto.getStartDate());
setDate(to::setCompletionDate, dto.getEndDate());
setObject(to::setSequencingParameters, SequencingParameters::new, dto.getSequencingParametersId());
setObject(to::setSequencingKit, KitDescriptor::new, dto.getSequencingKitId());
setString(to::setSequencingKitLot, dto.getSequencingKitLot());
setString(to::setFilePath, dto.getRunPath());
setBoolean(to::setQcPassed, dto.getQcPassed(), true);
setBoolean(to::setDataReview, dto.getDataReview(), true);
setObject(to::setSop, Sop::new, dto.getSopId());
setObject(to::setDataManglingPolicy, dto.getDataManglingPolicy(), InstrumentDataManglingPolicy::valueOf);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static QC to(@Nonnull QcDto dto) {
QC to;
switch(dto.getQcTarget()) {
case "Library":
LibraryQC newLibraryQc = new LibraryQC();
Library ownerLibrary = new LibraryImpl();
ownerLibrary.setId(dto.getEntityId());
newLibraryQc.setLibrary(ownerLibrary);
to = newLibraryQc;
break;
case "Sample":
SampleQC newSampleQc = new SampleQC();
Sample ownerSample = new SampleImpl();
ownerSample.setId(dto.getEntityId());
newSampleQc.setSample(ownerSample);
to = newSampleQc;
break;
case "Pool":
PoolQC newPoolQc = new PoolQC();
Pool ownerPool = new PoolImpl();
ownerPool.setId(dto.getEntityId());
newPoolQc.setPool(ownerPool);
to = newPoolQc;
break;
case "Container":
ContainerQC newContainerQc = new ContainerQC();
SequencerPartitionContainer ownerContainer = new SequencerPartitionContainerImpl();
ownerContainer.setId(dto.getEntityId());
newContainerQc.setContainer(ownerContainer);
to = newContainerQc;
break;
case "Requisition":
RequisitionQC newRequisitionQc = new RequisitionQC();
Requisition ownerRequisition = new Requisition();
ownerRequisition.setId(dto.getEntityId());
newRequisitionQc.setRequisition(ownerRequisition);
to = newRequisitionQc;
break;
default:
throw new IllegalArgumentException("No such QC target: " + dto.getQcTarget());
}
if (dto.getId() != null) {
to.setId(dto.getId());
}
to.setDate(parseDate(dto.getDate()));
setBigDecimal(to::setResults, dto.getResults());
setObject(to::setType, QcType::new, dto.getQcTypeId());
to.setDescription(dto.getDescription());
setObject(to::setInstrument, InstrumentImpl::new, dto.getInstrumentId());
setObject(to::setKit, KitDescriptor::new, dto.getKitDescriptorId());
setString(to::setKitLot, dto.getKitLot());
addQcControlRuns(dto.getControls(), to, QcTarget.valueOf(dto.getQcTarget()));
return to;
}
Aggregations