Skip to content

Deprecate study protocol designer tools (phase 2)#6406

Merged
labkey-klum merged 22 commits intodevelopfrom
fb_study_designer_module
Mar 7, 2025
Merged

Deprecate study protocol designer tools (phase 2)#6406
labkey-klum merged 22 commits intodevelopfrom
fb_study_designer_module

Conversation

@labkey-klum
Copy link
Contributor

@labkey-klum labkey-klum commented Mar 3, 2025

Rationale

This is the follow on work for this PR. For this phase of the work, the tables used by the study protocol designer will not be shown in the study schema. Additionally export and import options for this feature will not be available.

Related Pull Requests

Changes

  • Move study design table classes into the study API for now to make it easier to move into a module later.
  • Introduce StudyDesignQuerySchema and StudyDesignSchema to manage the study design tables.
  • Conditionalize folder writers and importers to respect the deprecated flag.
  • Fix automated tests

@labkey-klum labkey-klum self-assigned this Mar 5, 2025
private void importStudyDesignData(BindException errors, VirtualFile studyDir, StudyImportContext importContext) throws Exception
{
if (importContext != null)
if (importContext != null && OptionalFeatureService.get().isFeatureEnabled(StudyUtils.STUDY_DESIGN_FEATURE_FLAG))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that the importTreatmentVisitMapData method below should have this same check

@@ -2783,10 +2784,6 @@ public void deleteAllStudyData(Container c, User user)

deleteStudyDesignData(c, user, studyDesignTables);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this deleteStudyDesignData be moved as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll probably save that for the next phase when we split it out to a separate module

if (null != contextualRole && ReaderRole.class != contextualRole.getClass())
throw new IllegalStateException("Only ReaderRole is currently supported");
_contextualRole = contextualRole;
_designQuerySchema = StudyDesignQuerySchema.get(this, c, study, contextualRole);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the check for isFeatureEnabled happens in StudyDesignQuerySchema right? so it isn't needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will return null in that case and there should be null checks throughout this class.

{
checkedPermissions.add(perm);
// Most tables should not be editable in Dataspace
if (!perm.equals(ReadPermission.class) && getContainer().isDataspace())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if Atlas is the only server using study design, we probably don't really need these Dataspace related checks anymore right? probably not something that needs to change in this PR though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a good question, I found these Dataspace checks confusing so it will be nice to clean these up in the final phase.

BaseColumnInfo containerCol = new AliasedColumn(this, "Container", _rootTable.getColumn("Container"));
containerCol.setConceptURI(BuiltInColumnTypes.CONTAINERID_CONCEPT_URI);

addColumn(containerCol);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like StudyDesignBaseTable. addContainerColumn matches these lines, can that be used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good call.

protected boolean checkContainerPermission(UserPrincipal user, Class<? extends Permission> perm)
{
return _userSchema.getContainer().hasPermission(user, perm, getContextualRoles());
}*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these commented out methods be removed? I think these are in the parent StudyDesignBaseTable right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

@labkey-klum labkey-klum requested a review from cnathe March 5, 2025 18:13
Copy link
Contributor

@cnathe cnathe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled down the PR and did some minor manual testing to verify the study design tables show in the study schema when the flag is enabled (and do not show when disabled).

@labkey-klum labkey-klum merged commit 48a9859 into develop Mar 7, 2025
4 checks passed
@labkey-klum labkey-klum deleted the fb_study_designer_module branch March 7, 2025 20:49
labkey-tchad pushed a commit to LabKey/customModules that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants