• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 12032849274

26 Nov 2024 02:32PM UTC coverage: 57.242% (-0.1%) from 57.386%
12032849274

push

github

JBaird00183
Bump the aws-sdk group with 4 updates (#2074)

Bumps the aws-sdk group with 4 updates: [AWSSDK.S3](https://github.com/aws/aws-sdk-net), [AWSSDK.SecurityToken](https://github.com/aws/aws-sdk-net), [AWSSDK.SSO](https://github.com/aws/aws-sdk-net) and [AWSSDK.SSOOIDC](https://github.com/aws/aws-sdk-net).


Updates `AWSSDK.S3` from 3.7.407 to 3.7.407.1
- [Release notes](https://github.com/aws/aws-sdk-net/releases)
- [Changelog](https://github.com/aws/aws-sdk-net/blob/main/SDK.CHANGELOG.MD)
- [Commits](https://github.com/aws/aws-sdk-net/commits)

Updates `AWSSDK.SecurityToken` from 3.7.401.5 to 3.7.401.6
- [Release notes](https://github.com/aws/aws-sdk-net/releases)
- [Changelog](https://github.com/aws/aws-sdk-net/blob/main/SDK.CHANGELOG.MD)
- [Commits](https://github.com/aws/aws-sdk-net/commits)

Updates `AWSSDK.SSO` from 3.7.400.56 to 3.7.400.57
- [Release notes](https://github.com/aws/aws-sdk-net/releases)
- [Changelog](https://github.com/aws/aws-sdk-net/blob/main/SDK.CHANGELOG.MD)
- [Commits](https://github.com/aws/aws-sdk-net/commits)

Updates `AWSSDK.SSOOIDC` from 3.7.400.56 to 3.7.400.57
- [Release notes](https://github.com/aws/aws-sdk-net/releases)
- [Changelog](https://github.com/aws/aws-sdk-net/blob/main/SDK.CHANGELOG.MD)
- [Commits](https://github.com/aws/aws-sdk-net/commits)

---
updated-dependencies:
- dependency-name: AWSSDK.S3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws-sdk
- dependency-name: AWSSDK.SecurityToken
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws-sdk
- dependency-name: AWSSDK.SSO
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws-sdk
- dependency-name: AWSSDK.SSOOIDC
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws-sdk
...

Signed-off-by: dependabot[bot] <support@gi... (continued)

11215 of 21100 branches covered (53.15%)

Branch coverage included in aggregate %.

31759 of 53974 relevant lines covered (58.84%)

8252.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.63
/Rdmp.Core/Curation/Data/ExtractionFilter.cs
1
// Copyright (c) The University of Dundee 2018-2024
2
// This file is part of the Research Data Management Platform (RDMP).
3
// 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.
4
// 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.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System;
8
using System.Collections.Generic;
9
using System.Data.Common;
10
using System.Linq;
11
using Rdmp.Core.Curation.Data.Cohort;
12
using Rdmp.Core.Curation.FilterImporting.Construction;
13
using Rdmp.Core.MapsDirectlyToDatabaseTable;
14
using Rdmp.Core.MapsDirectlyToDatabaseTable.Attributes;
15
using Rdmp.Core.MapsDirectlyToDatabaseTable.Injection;
16
using Rdmp.Core.Repositories;
17
using Rdmp.Core.ReusableLibraryCode;
18

19
namespace Rdmp.Core.Curation.Data;
20

21
/// <summary>
22
/// Defines as a single line SQL Where statement, a way of reducing the scope of a data extraction / aggregation etc.  For example,
23
/// 'Only prescriptions for diabetes medications'.  An ExtractionFilter can have 0 or more ExtractionFilterParameters which allows
24
/// you to define a more versatile filter e.g. 'Only prescriptions for drug @bnfCode'
25
/// 
26
/// <para>Typically an ExtractionFilter is cloned out as either a DeployedExtractionFilter or an AggregateFilter and either used as is or
27
/// customised in its new state (where its parameters might have values populated into them).</para>
28
/// 
29
/// <para>It is not uncommon for an extraction to involve multiple customised copies of the same Extraction filter for example a user might
30
/// take the filter 'Prescriptions of drug @Drugname' and make 3 copies in a given project in DataExportManager (this would result in
31
/// 3 DeployedExtractionFilters) and set the value of the first to 'Paracetamol' the second to 'Aspirin' and the third to 'Ibuprofen'
32
/// and then put them all in a single AND container.</para>
33
/// 
34
/// <para>At query building time QueryBuilder rationalizes all the various containers, subcontainers, filters and parameters into one extraction
35
/// SQL query (including whatever columns/transforms it was setup with).</para>
36
/// </summary>
37
public class ExtractionFilter : ConcreteFilter, IHasDependencies, IInjectKnown<ExtractionFilterParameterSet[]>
38
{
39
    #region Database Properties
40

41
    private int _extractionInformationID;
42
    private Lazy<ExtractionFilterParameterSet[]> _knownExtractionFilterParameterSets;
43
    private int _order;
44

45
    /// <summary>
46
    /// The column in the <see cref="Catalogue"/> which is best/most associated with this filter.  A filter can query any column in any of the table(s) under
47
    /// the <see cref="Catalogue"/> but must always be associated with only one specific extractable column (<see cref="ExtractionInformation"/>)
48
    /// </summary>
49
    [Relationship(typeof(ExtractionInformation), RelationshipType.LocalReference)]
50
    public int ExtractionInformation_ID
51
    {
52
        get => _extractionInformationID;
1,680✔
53
        set => SetField(ref _extractionInformationID, value);
224✔
54
    }
55

56
    #endregion
57

58
    #region Relationships
59

60
    /// <inheritdoc/>
61
    [NoMappingToDatabase]
62
    public override IContainer FilterContainer => null;
4✔
63

64
    #endregion
65

66
    /// <inheritdoc/>
67
    [NoMappingToDatabase]
68
    public override int? FilterContainer_ID
69
    {
70
        get => throw new NotSupportedException();
×
71
        set => throw new NotSupportedException();
×
72
    }
73

74
    [NoMappingToDatabase]
75
    public ExtractionFilterParameterSet[] ExtractionFilterParameterSets => _knownExtractionFilterParameterSets.Value;
30✔
76

77
    /// <inheritdoc/>
78
    public override ColumnInfo GetColumnInfoIfExists() => ExtractionInformation.ColumnInfo;
26✔
79

80
    /// <inheritdoc/>
81
    public override IFilterFactory GetFilterFactory() => new ExtractionFilterFactory(ExtractionInformation);
14✔
82

83
    /// <inheritdoc/>
84
    public override Catalogue GetCatalogue() => ExtractionInformation.CatalogueItem.Catalogue;
×
85

86
    /// <inheritdoc/>
87
    public override ISqlParameter[] GetAllParameters() => ExtractionFilterParameters.ToArray();
62✔
88

89
    #region Relationships
90

91
    /// <inheritdoc cref="ExtractionInformation_ID"/>
92
    [NoMappingToDatabase]
93
    public ExtractionInformation ExtractionInformation =>
94
        Repository.GetObjectByID<ExtractionInformation>(ExtractionInformation_ID);
62✔
95

96
    /// <inheritdoc cref="ConcreteFilter.GetAllParameters"/>
97
    [NoMappingToDatabase]
98
    public IEnumerable<ExtractionFilterParameter> ExtractionFilterParameters =>
99
        Repository.GetAllObjectsWithParent<ExtractionFilterParameter>(this);
92✔
100

101
    #endregion
102

103
    public ExtractionFilter()
×
104
    {
105
        ClearAllInjections();
×
106
    }
×
107

108
    /// <summary>
109
    /// Creates a new WHERE SQL block for reuse with the <see cref="Catalogue"/> in which the <paramref name="parent"/> resides.  This is a top level master filter and can be
110
    /// copied out in <see cref="CohortIdentificationConfiguration"/>, ExtractionConfiguration etc.  This ensures a single curated block of
111
    /// logic that everyone shares.
112
    /// </summary>
113
    /// <param name="repository"></param>
114
    /// <param name="name"></param>
115
    /// <param name="parent"></param>
116
    public ExtractionFilter(ICatalogueRepository repository, string name, ExtractionInformation parent)
76✔
117
    {
118
        name ??= $"New Filter {Guid.NewGuid()}";
76!
119

120
        repository.InsertAndHydrate(this, new Dictionary<string, object>
76✔
121
        {
76✔
122
            { "Name", name },
76✔
123
            { "ExtractionInformation_ID", parent.ID }
76✔
124
        });
76✔
125

126
        ClearAllInjections();
76✔
127
    }
76✔
128

129
    internal ExtractionFilter(ICatalogueRepository repository, DbDataReader r)
130
        : base(repository, r)
148✔
131
    {
132
        ExtractionInformation_ID = int.Parse(r["ExtractionInformation_ID"].ToString());
148✔
133
        WhereSQL = r["WhereSQL"] as string;
148✔
134
        Description = r["Description"] as string;
148✔
135
        Name = r["Name"] as string;
148✔
136
        IsMandatory = (bool)r["IsMandatory"];
148✔
137
        Order = int.Parse(r["Order"].ToString());
148✔
138

139

140
        ClearAllInjections();
148✔
141
    }
148✔
142

143
    /// <inheritdoc/>
144
    public override string ToString() => Name;
20✔
145

146
    //we are an extraction filter ourselves! so obviously we werent cloned from one! (this is for aggregate and data export filters and satisfies IFilter).  Actually we can
147
    //be cloned via the publishing (elevation) from a custom filter defined at Aggregate level for example.  But in this case we don't need to know the ID anyway since we
148
    //become the new master anyway since we are at the highest level for filters
149

150
    /// <summary>
151
    /// Returns null, <see cref="ExtractionFilter"/> are master level filters and therefore never cloned from another filter
152
    /// </summary>
153
    [NoMappingToDatabase]
154
    public override int? ClonedFromExtractionFilter_ID
155
    {
156
        get => null;
×
157
        set => throw new NotSupportedException(
×
158
            "ClonedFromExtractionFilter_ID is only supported on lower level filters e.g. DeployedExtractionFilter and AggregateFilter");
×
159
    }
160
    public override int Order { get => _order; set => SetField(ref _order,value); }
332✔
161

162
    /// <inheritdoc/>
163
    public IHasDependencies[] GetObjectsThisDependsOn()
164
    {
165
        return new IHasDependencies[] { ExtractionInformation };
×
166
    }
167

168
    /// <inheritdoc/>
169
    public IHasDependencies[] GetObjectsDependingOnThis() => ExtractionFilterParameters.ToArray();
20✔
170

171
    public void InjectKnown(ExtractionFilterParameterSet[] instance)
172
    {
173
        _knownExtractionFilterParameterSets = new Lazy<ExtractionFilterParameterSet[]>(instance);
30✔
174
    }
30✔
175

176
    public void ClearAllInjections()
177
    {
178
        _knownExtractionFilterParameterSets = new Lazy<ExtractionFilterParameterSet[]>(() =>
226✔
179
            CatalogueRepository.GetAllObjectsWithParent<ExtractionFilterParameterSet>(this));
252✔
180
    }
226✔
181

182
    public override void DeleteInDatabase()
183
    {
184
        if (ExtractionFilterParameterSets.Any())
22✔
185
            throw new Exception(
2✔
186
                $"Cannot delete '{this}' because there are one or more {nameof(ExtractionFilterParameterSet)} declared on it");
2✔
187

188
        base.DeleteInDatabase();
20✔
189
    }
20✔
190
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc