use of uk.ac.bbsrc.tgac.miso.core.data.SampleTissueProcessing in project miso-lims by miso-lims.
the class AbstractBulkSampleIT method assertAllForTissueProcessing.
protected void assertAllForTissueProcessing(Map<String, String> tproc, Long sampleId, boolean newlyCreated) {
SampleTissueProcessing target = (SampleTissueProcessing) getSession().get(SampleTissueProcessingImpl.class, sampleId);
assertPlainSampleAttributes(tproc, target, newlyCreated);
assertDetailedSampleAttributes(tproc, target);
if (newlyCreated) {
SampleTissue tissueParent = LimsUtils.getParent(SampleTissue.class, target);
assertTissueAttributes(tproc, tissueParent);
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleTissueProcessing in project miso-lims by miso-lims.
the class Dtos method asDetailedSampleDto.
private static DetailedSampleDto asDetailedSampleDto(@Nonnull DetailedSample from) {
DetailedSampleDto dto = null;
if (isIdentitySample(from)) {
dto = asIdentitySampleDto((SampleIdentity) from);
} else if (isTissueSample(from)) {
dto = asTissueSampleDto((SampleTissue) from);
} else if (isTissueProcessingSample(from)) {
dto = asTissueProcessingSampleDto((SampleTissueProcessing) from);
} else if (isAliquotSample(from)) {
dto = asAliquotSampleDto((SampleAliquot) from);
} else if (isStockSample(from)) {
dto = asStockSampleDto((SampleStock) from);
} else {
throw new IllegalArgumentException();
}
dto.setSampleClassId(from.getSampleClass().getId());
dto.setSampleClassAlias(from.getSampleClass().getAlias());
dto.setSampleCategory(from.getSampleClass().getSampleCategory());
dto.setSampleSubcategory(from.getSampleClass().getSampleSubcategory());
if (from.getSubproject() != null) {
dto.setSubprojectId(from.getSubproject().getId());
dto.setSubprojectAlias(from.getSubproject().getAlias());
dto.setSubprojectPriority(from.getSubproject().getPriority());
}
if (from.getParent() != null) {
DetailedSample parent = from.getParent();
dto.setParentId(parent.getId());
setString(dto::setParentName, parent.getName());
dto.setParentAlias(parent.getAlias());
dto.setParentSampleClassId(parent.getSampleClass().getId());
if (parent.getBox() != null) {
dto.setParentBoxPosition(parent.getBoxPosition());
dto.setParentBoxPositionLabel(BoxUtils.makeBoxPositionLabel(parent.getBox().getAlias(), parent.getBoxPosition()));
}
}
GroupIdentifiable effective = from.getEffectiveGroupIdEntity();
if (effective != null) {
dto.setEffectiveGroupId(effective.getGroupId());
dto.setEffectiveGroupIdSample(effective.getAlias());
}
if (from.getGroupId() != null) {
dto.setGroupId(from.getGroupId());
}
if (from.getGroupDescription() != null) {
dto.setGroupDescription(from.getGroupDescription());
}
if (from.isSynthetic() != null) {
dto.setSynthetic(from.isSynthetic());
}
setDateString(dto::setCreationDate, from.getCreationDate());
dto.setNonStandardAlias(from.hasNonStandardAlias());
setString(dto::setVolumeUsed, from.getVolumeUsed());
setString(dto::setNgUsed, from.getNgUsed());
if (from.getIdentityAttributes() != null) {
ParentIdentityAttributes identity = from.getIdentityAttributes();
setString(dto::setIdentityConsentLevel, maybeGetProperty(identity.getConsentLevel(), ConsentLevel::getLabel));
setString(dto::setEffectiveExternalNames, identity.getExternalName());
}
if (from.getTissueAttributes() != null) {
ParentTissueAttributes tissue = from.getTissueAttributes();
setString(dto::setEffectiveTissueOriginAlias, tissue.getTissueOrigin().getAlias());
setString(dto::setEffectiveTissueOriginDescription, tissue.getTissueOrigin().getDescription());
setString(dto::setEffectiveTissueTypeAlias, tissue.getTissueType().getAlias());
setString(dto::setEffectiveTissueTypeDescription, tissue.getTissueType().getDescription());
}
setEffectiveQcFailure(from, dto);
if (from.getRequisition() == null) {
Requisition requisition = getParentRequisition(from);
setId(dto::setEffectiveRequisitionId, requisition);
setString(dto::setEffectiveRequisitionAlias, maybeGetProperty(requisition, Requisition::getAlias));
}
return dto;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleTissueProcessing in project miso-lims by miso-lims.
the class BulkSampleCreateIT method testCreateOneCurlsWithProject.
@Test
public void testCreateOneCurlsWithProject() throws Exception {
// Goal: ensure one Curls associated with a predefined project can be saved
BulkSamplePage page = getCreatePage(1, projectId, SampleTissueProcessing.CATEGORY_NAME);
HandsOnTable table = page.getTable();
Map<String, String> curls = new LinkedHashMap<>();
curls.put(SamColumns.DESCRIPTION, "Description");
curls.put(SamColumns.RECEIVE_DATE, "2017-07-17");
curls.put(SamColumns.RECEIVED_FROM, "University Health Network - BioBank");
curls.put(SamColumns.RECEIVED_BY, "TestGroupOne");
curls.put(SamColumns.RECEIPT_CONFIRMED, "True");
curls.put(SamColumns.RECEIPT_QC_PASSED, "True");
curls.put(SamColumns.RECEIPT_QC_NOTE, "");
// increment
curls.put(SamColumns.ID_BARCODE, "106");
curls.put(SamColumns.SAMPLE_CLASS, "Tissue Piece");
curls.put(SamColumns.SAMPLE_TYPE, "GENOMIC");
curls.put(SamColumns.SCIENTIFIC_NAME, "Homo sapiens");
curls.put(SamColumns.GROUP_ID, "1");
curls.put(SamColumns.GROUP_DESCRIPTION, "Test one");
curls.put(SamColumns.TISSUE_ORIGIN, "Bn (Brain)");
curls.put(SamColumns.TISSUE_TYPE, "P (Primary tumour)");
curls.put(SamColumns.PASSAGE_NUMBER, "");
curls.put(SamColumns.TIMES_RECEIVED, "1");
curls.put(SamColumns.TUBE_NUMBER, "1");
curls.put(SamColumns.SECONDARY_ID, "tube id 1");
curls.put(SamColumns.TISSUE_MATERIAL, "FFPE");
curls.put(SamColumns.REGION, "Medulla oblongata");
curls.put(SamColumns.QC_STATUS, "Ready");
curls.put(SamColumns.PIECE_TYPE, "Curls");
curls.put(SamColumns.SLIDES_CONSUMED, "2");
curls.forEach((k, v) -> table.enterText(k, 0, v));
// need to enter this here, after project is entered otherwise identity lookup fails
// increment
curls.put(SamColumns.EXTERNAL_NAME, "ext6");
table.enterText(SamColumns.EXTERNAL_NAME, 0, curls.get(SamColumns.EXTERNAL_NAME));
assertIdentityLookupWasSuccessful(table, 0);
assertTrue(page.save(false));
HandsOnTable savedTable = page.getTable();
Long newId = getIdForRow(savedTable, 0);
// verify attributes against what got saved to the database
Project predefined = (Project) getSession().get(ProjectImpl.class, projectId);
SampleTissueProcessing created = (SampleTissueProcessing) getSession().get(SampleTissueProcessingImpl.class, newId);
assertEquals("confirm project", predefined.getShortName(), created.getProject().getShortName());
// everything else should be the same as in testCreateOneCurlsNoProject
}
Aggregations