1313using Rdmp . Core . Caching . Pipeline ;
1414using Rdmp . Core . CohortCommitting . Pipeline ;
1515using Rdmp . Core . Curation . Data ;
16+ using Rdmp . Core . Curation . Data . Cohort ;
1617using Rdmp . Core . Curation . Data . Pipelines ;
1718using Rdmp . Core . DataExport . Data ;
1819using Rdmp . Core . DataExport . DataExtraction . Pipeline ;
@@ -238,6 +239,22 @@ private void AddChildren(FolderNode<Project> folder, DescendancyList descendancy
238239 ) ;
239240 }
240241
242+ private void AddChildren ( FolderNode < CohortIdentificationConfiguration > folder , DescendancyList descendancy )
243+ {
244+ foreach ( var child in folder . ChildFolders )
245+ //add subfolder children
246+ AddChildren ( child , descendancy . Add ( child ) ) ;
247+
248+ //add catalogues in folder
249+ foreach ( var cic in folder . ChildObjects ) AddToDictionaries ( new HashSet < object > ( ) { cic } , descendancy . SetBetterRouteExists ( ) ) ;
250+
251+ // Children are the folders + objects
252+ AddToDictionaries ( new HashSet < object > (
253+ folder . ChildFolders . Cast < object > ( )
254+ . Union ( folder . ChildObjects ) ) , descendancy
255+ ) ;
256+ }
257+
241258 private void BuildSelectedDatasets ( )
242259 {
243260 _selectedDataSetsWithNoIsExtractionIdentifier =
@@ -347,7 +364,9 @@ private void AddChildren(ProjectCohortsNode projectCohortsNode, DescendancyList
347364 children . Add ( savedCohortsNode ) ;
348365 AddChildren ( savedCohortsNode , descendancy . Add ( savedCohortsNode ) ) ;
349366
350- var associatedCohortConfigurations = new CommittedCohortIdentificationNode ( projectCohortsNode . Project ) ;
367+ var associatedCohortConfigurations = FolderHelper . BuildFolderTree ( projectCohortsNode . Project . GetAssociatedCohortIdentificationConfigurations ( ) ) ;
368+ associatedCohortConfigurations . Name = "Associated Cohort Configurations" ;
369+ associatedCohortConfigurations . Parent = new FolderNode < CohortIdentificationConfiguration > ( $ "\\ { projectCohortsNode . Project } \\ { projectCohortsNode } ") ;
351370 children . Add ( associatedCohortConfigurations ) ;
352371 AddChildren ( associatedCohortConfigurations , descendancy . Add ( associatedCohortConfigurations ) ) ;
353372
@@ -371,18 +390,6 @@ private void AddChildren(AssociatedCohortIdentificationTemplatesNode associatedC
371390 AddToDictionaries ( children , descendancy ) ;
372391 }
373392
374- private void AddChildren ( CommittedCohortIdentificationNode associatedCohortConfigurations , DescendancyList descendancy )
375- {
376- var children = new HashSet < object > ( ) ;
377- var associatedCohorts = associatedCohortConfigurations . Project . GetAssociatedCohortIdentificationConfigurations ( ) ;
378- foreach ( var cohort in associatedCohorts )
379- {
380- children . Add ( cohort ) ;
381- }
382-
383- AddToDictionaries ( children , descendancy ) ;
384- }
385-
386393 private void AddChildren ( ProjectSavedCohortsNode savedCohortsNode , DescendancyList descendancy )
387394 {
388395 var children = new HashSet < object > ( ) ;
0 commit comments