Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2582,20 +2582,13 @@ study/src/org/labkey/study/query/ParticipantTable.java -text
study/src/org/labkey/study/query/ParticipantVisitDatasetTable.java -text
study/src/org/labkey/study/query/ParticipantVisitTable.java -text
study/src/org/labkey/study/query/PrimaryTypeTable.java -text
study/src/org/labkey/study/query/PtidObfuscatingDisplayColumn.java -text
study/src/org/labkey/study/query/PublishedRecordQueryView.java -text
study/src/org/labkey/study/query/QCStateTable.java -text
study/src/org/labkey/study/query/SimpleSpecimenTable.java -text
study/src/org/labkey/study/query/SpecimenCommentTable.java -text
study/src/org/labkey/study/query/SpecimenDetailTable.java -text
study/src/org/labkey/study/query/SpecimenEventTable.java -text
study/src/org/labkey/study/query/SpecimenRequestStatusTable.java -text
study/src/org/labkey/study/query/SpecimenRequestTable.java -text
study/src/org/labkey/study/query/SpecimenSummaryTable.java -text
study/src/org/labkey/study/query/SpecimenVialCountTable.java -text
study/src/org/labkey/study/query/StudyQuerySchema.java -text
study/src/org/labkey/study/query/StudySchemaProvider.java -text
study/src/org/labkey/study/query/VialRequestTable.java -text
study/src/org/labkey/study/query/VialTable.java -text
study/src/org/labkey/study/query/VisitAliasesTable.java -text
study/src/org/labkey/study/query/VisitTable.java -text
Expand Down
10 changes: 0 additions & 10 deletions study/api-src/org/labkey/api/specimen/SpecimenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.labkey.api.module.Module;
import org.labkey.api.module.ModuleLoader;
import org.labkey.api.query.FieldKey;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.specimen.model.SpecimenComment;
import org.labkey.api.study.Study;
import org.labkey.api.study.StudyService;
Expand All @@ -46,8 +45,6 @@ public class SpecimenManager
{
private final static SpecimenManager INSTANCE = new SpecimenManager();

public static final String VIEW_SPECIMEN_TABLES_FLAG = "viewSpecimenTables";

private SpecimenManager()
{
}
Expand All @@ -63,13 +60,6 @@ public boolean isSpecimenModuleActive(Container c)
return null != specimenModule && c.getActiveModules().contains(specimenModule);
}

// Include specimen queries in the study schema if the specimen module is active or an admin has chosen to expose
// them via an optional feature
public boolean areSpecimenTablesViewable(Container c)
{
return isSpecimenModuleActive(c) || OptionalFeatureService.get().isFeatureEnabled(VIEW_SPECIMEN_TABLES_FLAG);
}

public int getSpecimenCountForVisit(Visit visit)
{
Container container = visit.getContainer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
import org.labkey.api.query.QuerySettings;
import org.labkey.api.query.QueryUpdateService;
import org.labkey.api.query.QueryView;
import org.labkey.api.query.UserSchema;
import org.labkey.api.security.User;
import org.labkey.api.security.permissions.Permission;
import org.labkey.api.services.ServiceRegistry;
import org.labkey.api.study.Study;
import org.labkey.api.study.importer.SimpleStudyImportContext;
import org.labkey.api.study.query.AbstractStudyQuerySchema;
import org.labkey.api.util.SafeToRender;
import org.labkey.api.view.ActionURL;
import org.labkey.api.view.ViewContext;
Expand Down Expand Up @@ -71,12 +70,15 @@ void importSpecimenArchive(@Nullable FileLike inputFile, PipelineJob job, Simple

boolean isEnableRequests(Container c);

void addSpecimenPivotTableNames(Set<String> names);
/** Adds the names of the study schema tables that the specimen module provides */
void addSpecimenTableNames(Set<String> names);

/**
* Returns a specimen pivot TableInfo, if that's what was requested
* Returns the requested study schema table if the specimen module provides it, otherwise null
*/
@Nullable TableInfo getSpecimenPivotTable(UserSchema schema, String name, Study study, ContainerFilter cf);
@Nullable TableInfo getSpecimenTable(AbstractStudyQuerySchema schema, String name, ContainerFilter cf);

TableInfo createSpecimenCommentTable(AbstractStudyQuerySchema schema, ContainerFilter cf, boolean joinBackToSpecimens);

@Nullable SafeToRender getSpecimenSettingsLink(Container c, User user);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2026 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.labkey.api.study.query;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.labkey.api.data.Container;
import org.labkey.api.data.ContainerFilter;
import org.labkey.api.data.DbSchema;
import org.labkey.api.data.TableInfo;
import org.labkey.api.query.SchemaKey;
import org.labkey.api.query.UserSchema;
import org.labkey.api.security.User;
import org.labkey.api.study.Study;

/**
* The study schema as seen by tables implemented outside the study module (e.g., specimen tables)
*/
public abstract class AbstractStudyQuerySchema extends UserSchema implements UserSchema.HasContextualRoles
{
protected AbstractStudyQuerySchema(@NotNull SchemaKey path, @Nullable String description, @NotNull User user, @NotNull Container c, DbSchema dbSchema)
{
super(path, description, user, c, dbSchema, null);
}

public abstract @Nullable Study getStudy();

/** for tables that support container filter, should they turn on support or not */
public boolean allowSetContainerFilter()
{
return true;
}

public abstract TableInfo createLocationLookupTable(@Nullable ContainerFilter cf);

/**
* @param rootTableColumnName PrimaryTypeId, DerivativeTypeId, DerivativeTypeId2, or AdditiveTypeId
*/
public abstract TableInfo createSpecimenTypeLookupTable(String rootTableColumnName, ContainerFilter cf);

public abstract TableInfo createSpecimenDetailLookupTable(@Nullable ContainerFilter cf);
}
Loading