diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.Designer.cs b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.Designer.cs index 10db07ba2f..551e0582e5 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.Designer.cs +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.Designer.cs @@ -2044,18 +2044,6 @@ public static Byte[] ProjectSavedCohortsNode } } - /// - /// Looks up a localized resource of type Image. - /// - public static Byte[] CommittedCohortIdentificationNode - { - get - { - object obj = ResourceManager.GetObject("CommittedCohortIdentificationNode", resourceCulture); - return ((Byte[])(obj)); - } - } - /// /// Looks up a localized resource of type Image. /// diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx index fa88f5e525..f13f3b4b5c 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx @@ -514,9 +514,6 @@ ..\ProjectSavedCohortsNode.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\CommittedCohortIdentificationNode.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\collapseAllNodes.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs b/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs index 5277dbf27d..f9438999a8 100644 --- a/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs +++ b/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs @@ -208,7 +208,6 @@ public enum RDMPConcept LoadMetadataCatalogueLinkage, Setting, TicketingSystemReleaseStatus, - CommittedCohortIdentificationNode, AllDatasetsNode, RegexRedaction, RegexRedactionConfiguration, diff --git a/Rdmp.Core/Providers/DataExportChildProvider.cs b/Rdmp.Core/Providers/DataExportChildProvider.cs index 267613c0d0..a7df1937d6 100644 --- a/Rdmp.Core/Providers/DataExportChildProvider.cs +++ b/Rdmp.Core/Providers/DataExportChildProvider.cs @@ -13,6 +13,7 @@ using Rdmp.Core.Caching.Pipeline; using Rdmp.Core.CohortCommitting.Pipeline; using Rdmp.Core.Curation.Data; +using Rdmp.Core.Curation.Data.Cohort; using Rdmp.Core.Curation.Data.Pipelines; using Rdmp.Core.DataExport.Data; using Rdmp.Core.DataExport.DataExtraction.Pipeline; @@ -238,6 +239,22 @@ private void AddChildren(FolderNode folder, DescendancyList descendancy ); } + private void AddChildren(FolderNode folder, DescendancyList descendancy) + { + foreach (var child in folder.ChildFolders) + //add subfolder children + AddChildren(child, descendancy.Add(child)); + + //add catalogues in folder + foreach (var cic in folder.ChildObjects) AddToDictionaries(new HashSet() { cic }, descendancy.SetBetterRouteExists()); + + // Children are the folders + objects + AddToDictionaries(new HashSet( + folder.ChildFolders.Cast() + .Union(folder.ChildObjects)), descendancy + ); + } + private void BuildSelectedDatasets() { _selectedDataSetsWithNoIsExtractionIdentifier = @@ -347,7 +364,9 @@ private void AddChildren(ProjectCohortsNode projectCohortsNode, DescendancyList children.Add(savedCohortsNode); AddChildren(savedCohortsNode, descendancy.Add(savedCohortsNode)); - var associatedCohortConfigurations = new CommittedCohortIdentificationNode(projectCohortsNode.Project); + var associatedCohortConfigurations = FolderHelper.BuildFolderTree(projectCohortsNode.Project.GetAssociatedCohortIdentificationConfigurations()); + associatedCohortConfigurations.Name = "Associated Cohort Configurations"; + associatedCohortConfigurations.Parent = new FolderNode($"\\{projectCohortsNode.Project}\\{projectCohortsNode}"); children.Add(associatedCohortConfigurations); AddChildren(associatedCohortConfigurations, descendancy.Add(associatedCohortConfigurations)); @@ -371,18 +390,6 @@ private void AddChildren(AssociatedCohortIdentificationTemplatesNode associatedC AddToDictionaries(children, descendancy); } - private void AddChildren(CommittedCohortIdentificationNode associatedCohortConfigurations, DescendancyList descendancy) - { - var children = new HashSet(); - var associatedCohorts = associatedCohortConfigurations.Project.GetAssociatedCohortIdentificationConfigurations(); - foreach (var cohort in associatedCohorts) - { - children.Add(cohort); - } - - AddToDictionaries(children, descendancy); - } - private void AddChildren(ProjectSavedCohortsNode savedCohortsNode, DescendancyList descendancy) { var children = new HashSet(); diff --git a/Rdmp.Core/Providers/Nodes/CohortNodes/CommittedCohortIdentificationNode.cs b/Rdmp.Core/Providers/Nodes/CohortNodes/CommittedCohortIdentificationNode.cs deleted file mode 100644 index f356b83793..0000000000 --- a/Rdmp.Core/Providers/Nodes/CohortNodes/CommittedCohortIdentificationNode.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) The University of Dundee 2024-2024 -// This file is part of the Research Data Management Platform (RDMP). -// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -// You should have received a copy of the GNU General Public License along with RDMP. If not, see . - -using Rdmp.Core.Curation.Data.Cohort; -using Rdmp.Core.DataExport.Data; - -namespace Rdmp.Core.Providers.Nodes.CohortNodes -{ - /// - /// Collection of all (queries for identifying patient lists) which have been - /// committed with a . - /// - /// A can be associated with multiple Projects - /// - public class CommittedCohortIdentificationNode : Node, IOrderable - { - public Project Project { get; set; } - - - public CommittedCohortIdentificationNode(Project project) - { - Project = project; - } - - public override string ToString() => "Associated Cohort Configurations"; - - protected bool Equals(CommittedCohortIdentificationNode other) => - Equals(Project, other.Project); - - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; - return Equals((CommittedCohortIdentificationNode)obj); - } - - public override int GetHashCode() => Project != null ? Project.GetHashCode() : 0; - - public int Order - { - get => 1; - set { } - } - } -} diff --git a/Rdmp.UI/NavigationTrack.cs b/Rdmp.UI/NavigationTrack.cs index 622d0099cc..9437fb6c2a 100644 --- a/Rdmp.UI/NavigationTrack.cs +++ b/Rdmp.UI/NavigationTrack.cs @@ -64,7 +64,7 @@ public NavigationTrack(Func aliveDelegate, Action activate) public void Prune() { _navigationStack = new Stack(_navigationStack.ToArray().Take(MaxHistory + 1).Reverse().Where(_isAlive)); - _forward = new Stack(_forward.AsEnumerable().ToArray().AsEnumerable().Reverse().Where(_isAlive)); + _forward = new Stack(_forward.ToArray().AsEnumerable().Reverse().Where(_isAlive)); } ///