Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging template aggregate to add filters to SelectedDatasets #1327

Merged
merged 1 commit into from
Aug 4, 2022
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

...

### Added

- Template cohort builder aggregates can be dragged onto extraction datasets to import the container tree [#1307](https://github.com/HicServices/RDMP/issues/1307)

## [7.0.17] - 2022-08-01

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using System.Collections.Generic;
using System.Linq;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.Curation.Data.Aggregation;
using Rdmp.Core.Curation.Data.Cohort;
using Rdmp.Core.Curation.Data.Cohort.Joinables;
Expand Down Expand Up @@ -53,6 +54,11 @@ public class AggregateConfigurationCombineable : ICombineToMakeCommand
/// </summary>
public AggregateConfiguration[] JoinableUsersIfAny { get; set; }

/// <summary>
/// True if the <see cref="Aggregate"/> has an <see cref="ExtendedProperty"/> declaring it as a reusable template
/// </summary>
public bool IsTemplate { get; set; }

/// <summary>
/// Creates a new instance, popualtes <see cref="Aggregate"/> and discovers all other state cached fields (e.g.
/// <see cref="JoinableDeclarationIfAny"/> etc).
Expand All @@ -64,6 +70,8 @@ public AggregateConfigurationCombineable(AggregateConfiguration aggregate)

IsPatientIndexTable = Aggregate.IsJoinablePatientIndexTable();

IsTemplate = aggregate.CatalogueRepository.GetExtendedProperties(ExtendedProperty.IsTemplate,aggregate).Any(p=> Equals(p.Value, "true"));

//is the aggregate part of cohort identification
CohortIdentificationConfigurationIfAny = Aggregate.GetCohortIdentificationConfigurationIfAny();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ public override void Activate(SelectedDataSets target)

public override ICommandExecution ProposeExecution(ICombineToMakeCommand cmd, SelectedDataSets target, InsertOption insertOption = InsertOption.Default)
{

// if use drops a reusable template aggregate (e.g. from Cohort Builder)
if(cmd is AggregateConfigurationCombineable ac && ac.IsTemplate && ac.Aggregate.RootFilterContainer_ID != null)
{
// offer to import the WHERE containers
return new ExecuteCommandImportFilterContainerTree(ItemActivator, target, ac.Aggregate);
}

if(cmd is ContainerCombineable cc)
return new ExecuteCommandImportFilterContainerTree(ItemActivator,target,cc.Container);
{
return new ExecuteCommandImportFilterContainerTree(ItemActivator, target, cc.Container);
}

return null;
}
Expand Down