public static Instrument to(@Nonnull InstrumentDto dto) { Instrument to = new InstrumentImpl(); to.setId(dto.getId()); to.setDateCommissioned(parseDate(dto.getDateCommissioned())); to.setDateDecommissioned(parseDate(dto.getDateDecommissioned())); to.setName(dto.getName()); to.setInstrumentModel(to(dto.getInstrumentModel())); to.setSerialNumber(dto.getSerialNumber()); return to; }
public static Kit to(@Nonnull KitConsumableDto dto) { Kit to = new KitImpl(); if (dto.getId() != null) { to.setId(dto.getId()); } to.setKitDate(parseDate(dto.getDate())); to.setKitDescriptor(to(dto.getDescriptor())); to.setLotNumber(dto.getLotNumber()); return to; }
public static Pool to(@Nonnull PoolDto dto) { PoolImpl to = new PoolImpl(); to.setId(dto.getId() == null ? PoolImpl.UNSAVED_ID : dto.getId()); to.setAlias(dto.getAlias()); to.setConcentration(dto.getConcentration() == null ? null : Double.valueOf(dto.getConcentration())); to.setConcentrationUnits(dto.getConcentrationUnits()); to.setCreationDate(parseDate(dto.getCreationDate())); to.setDescription(dto.getDescription()); to.setIdentificationBarcode(dto.getIdentificationBarcode()); to.setDiscarded(dto.isDiscarded()); if (dto.getVolume() != null) { to.setVolume(Double.valueOf(dto.getVolume())); } to.setVolumeUnits(dto.getVolumeUnits()); to.setPlatformType(PlatformType.valueOf(dto.getPlatformType())); to.setPoolDilutions(dto.getPooledElements().stream().map(dilution -> { PoolableElementView view = new PoolableElementView(); view.setDilutionId(dilution.getId()); view.setDilutionName(dilution.getName()); view.setDilutionVolumeUsed(dilution.getVolumeUsed() == null ? null : Double.valueOf(dilution.getVolumeUsed())); PoolDilution link = new PoolDilution(to, view); if (dilution.getProportion() != null) { link.setProportion(dilution.getProportion()); } return link; }).collect(Collectors.toSet())); to.setQcPassed(dto.getQcPassed()); to.setBoxPosition((PoolBoxPosition) makeBoxablePosition(dto, to)); return 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())); run.setInstrument(new InstrumentImpl()); if (from.getInstrumentId() != null) { run.getInstrument().setId(from.getInstrumentId()); } if (from.getInstrumentName() != null) { run.getInstrument().setName(from.getInstrumentName()); } if (from.getArray() != null) { run.setArray(to(from.getArray())); } run.setHealth(HealthType.get(from.getStatus())); if (from.getStartDate() != null) { run.setStartDate(parseDate(from.getStartDate())); } if (from.getCompletionDate() != null) { run.setCompletionDate(parseDate(from.getCompletionDate())); } if (from.getLastModified() != null) { run.setLastModified(parseDate(from.getLastModified())); } return run; }
public static LibraryDilution to(@Nonnull DilutionDto from) { LibraryDilution to = new LibraryDilution(); if (from.getId() != null) to.setId(from.getId()); if (!isStringEmptyOrNull(from.getName())) { to.setName(from.getName()); } to.setIdentificationBarcode(from.getIdentificationBarcode()); to.setConcentration(from.getConcentration() == null ? null : Double.valueOf(from.getConcentration())); to.setConcentrationUnits(from.getConcentrationUnits()); to.setNgUsed(from.getNgUsed() == null ? null : Double.valueOf(from.getNgUsed())); to.setVolume(from.getVolume() == null ? null : Double.valueOf(from.getVolume())); to.setVolumeUnits(from.getVolumeUnits()); to.setVolumeUsed(from.getVolumeUsed() == null ? null : Double.valueOf(from.getVolumeUsed())); to.setLibrary(to(from.getLibrary())); to.setCreationDate(parseDate(from.getCreationDate())); if (from.getTargetedSequencingId() != null) { to.setTargetedSequencing(new TargetedSequencing()); to.getTargetedSequencing().setId(from.getTargetedSequencingId()); } to.setBoxPosition((DilutionBoxPosition) makeBoxablePosition(from, to)); to.setDiscarded(from.isDiscarded()); return to; }
to.setLocationBarcode(nullifyStringIfBlank(from.getLocationBarcode())); to.setSampleType(from.getSampleType()); to.setReceivedDate(parseDate(from.getReceivedDate())); to.setQcPassed(from.getQcPassed()); to.setScientificName(from.getScientificName()); to.setDistributionDate(parseDate(from.getDistributionDate())); to.setDistributionRecipient(from.getDistributionRecipient()); return to;
to.setId(dto.getId()); to.setDate(parseDate(dto.getDate())); to.setResults(dto.getResults()); to.setType(to(dto.getType()));
to.setCreationDate(parseDate(from.getCreationDate())); if (from.getReceivedDate() != null) { to.setReceivedDate(parseDate(from.getReceivedDate())); setObject(to::setSpikeInDilutionFactor, from.getSpikeInDilutionFactor(), DilutionFactor::get); to.setDistributed(from.isDistributed()); to.setDistributionDate(parseDate(from.getDistributionDate())); to.setDistributionRecipient(from.getDistributionRecipient()); return to;
to.setSubproject(subproject); to.setCreationDate(LimsUtils.isStringEmptyOrNull(from.getCreationDate()) ? null : parseDate(from.getCreationDate())); if (from.getIdentityId() != null) { to.setIdentityId(from.getIdentityId());