use of uk.ac.bbsrc.tgac.miso.core.data.qc.RequisitionQC 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;
}
use of uk.ac.bbsrc.tgac.miso.core.data.qc.RequisitionQC in project miso-lims by miso-lims.
the class HibernateRequisitionQcDaoIT method makeQc.
@Override
protected RequisitionQC makeQc(Requisition entity) {
RequisitionQC qc = new RequisitionQC();
qc.setRequisition(entity);
return qc;
}
Aggregations