• 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

87.5
/Rdmp.Core/DataExport/Data/DeployedExtractionFilter.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.Checks;
12
using Rdmp.Core.Curation.Data;
13
using Rdmp.Core.Curation.FilterImporting.Construction;
14
using Rdmp.Core.MapsDirectlyToDatabaseTable;
15
using Rdmp.Core.MapsDirectlyToDatabaseTable.Attributes;
16
using Rdmp.Core.Repositories;
17
using Rdmp.Core.ReusableLibraryCode.Checks;
18

19
namespace Rdmp.Core.DataExport.Data;
20

21
/// <summary>
22
/// Sometimes it is necessary to restrict which records are extracted for a given ExtractionConfiguration beyond the linkage against a cohort.  For example you might want to extract
23
/// 'only paracetamol prescriptions' for your cohort rather than the entire Prescribing dataset.  This is achieved by using a DeployedExtractionFilter.  DeployedExtractionFilters are
24
/// curated pieces of WHERE SQL with a name and description.  These can either be written bespoke for your extract or copied from a master ExtractionFilter in the Catalogue database.
25
/// In general if a filter concept is reusable and useful across multiple projects / over time then you should create it in the Catalogue database as an ExtractionFilter and then
26
/// import a copy into your ExtractionConfiguration each time you need it (or mark it as IsMandatory if it should always be used in data extraction of that Catalogue).
27
/// 
28
/// <para>When you import a master filter into your ExtractionConfiguration a copy of the WHERE SQL, any
29
/// parameters and the name and description will be made as a DeployedExtractionFilter which will also contain a reference back to the original (ClonedFromExtractionFilter_ID).  This
30
/// allows you to ensure consistency over time and gives you a central location (the ExtractionFilter) to fix errors in the Filter implementation etc.  </para>
31
/// 
32
/// </summary>
33
public class DeployedExtractionFilter : ConcreteFilter
34
{
35
    #region Database Properties
36

37
    private int? _clonedFromExtractionFilterID;
38
    private int? _filterContainerID;
39
    private int _order;
40

41
    /// <inheritdoc/>
42
    public override int? ClonedFromExtractionFilter_ID
43
    {
44
        get => _clonedFromExtractionFilterID;
74✔
45
        set => SetField(ref _clonedFromExtractionFilterID, value);
104✔
46
    }
47

48
    /// <inheritdoc/>
49
    [Relationship(typeof(FilterContainer), RelationshipType.SharedObject)]
50
    public override int? FilterContainer_ID
51
    {
52
        get => _filterContainerID;
466✔
53
        set => SetField(ref _filterContainerID, value);
140✔
54
    }
55

56
    #endregion
57

58
    #region Relationships
59

60
    /// <summary>
61
    /// Returns all parameters declared against this filter (does not include other parameters in scope e.g. globals)
62
    /// </summary>
63
    [NoMappingToDatabase]
64
    public DeployedExtractionFilterParameter[] ExtractionFilterParameters => Repository
48✔
65
        .GetAllObjectsWhere<DeployedExtractionFilterParameter>("ExtractionFilter_ID", ID).ToArray();
48✔
66

67
    /// <inheritdoc/>
68
    [NoMappingToDatabase]
69
    public override IContainer FilterContainer => FilterContainer_ID.HasValue
8!
70
        ? Repository.GetObjectByID<FilterContainer>(FilterContainer_ID.Value)
8✔
71
        : null;
8✔
72

73
    public override int Order { get => _order; set => SetField(ref _order, value); }
166✔
74

75
    #endregion
76

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

80
    /// <inheritdoc/>
81
    public override IFilterFactory GetFilterFactory() =>
82
        new DeployedExtractionFilterFactory((IDataExportRepository)Repository);
8✔
83

84
    /// <inheritdoc/>
85
    public override Catalogue GetCatalogue()
86
    {
87
        var ds = GetDataset().ExtractableDataSet;
16✔
88
        try
89
        {
90
            return (Catalogue)ds.Catalogue;
16✔
91
        }
92
        catch (Exception)
×
93
        {
94
            //could be that the catalogue has been deleted
95
            return null;
×
96
        }
97
    }
16✔
98

99
    /// <inheritdoc/>
100
    public override ISqlParameter[] GetAllParameters() => ExtractionFilterParameters.Cast<ISqlParameter>().ToArray();
42✔
101

102
    public DeployedExtractionFilter()
×
103
    {
104
    }
×
105

106
    /// <summary>
107
    /// Creates a new empty WHERE filter in the given <paramref name="container"/> that will be used when
108
    /// extracting the dataset.
109
    /// 
110
    /// <para>This object is created into the data export metadata database</para>
111
    /// </summary>
112
    /// <param name="repository"></param>
113
    /// <param name="name"></param>
114
    /// <param name="container"></param>
115
    public DeployedExtractionFilter(IDataExportRepository repository, string name, FilterContainer container)
36✔
116
    {
117
        Repository = repository;
36✔
118
        Repository.InsertAndHydrate(this, new Dictionary<string, object>
36!
119
        {
36✔
120
            { "Name", name != null ? (object)name : DBNull.Value },
36✔
121
            { "FilterContainer_ID", container != null ? (object)container.ID : DBNull.Value }
36✔
122
        });
36✔
123
    }
36✔
124

125
    /// <summary>
126
    /// Read an existing WHERE filter out of the database
127
    /// </summary>
128
    /// <param name="repository"></param>
129
    /// <param name="r"></param>
130
    internal DeployedExtractionFilter(IDataExportRepository repository, DbDataReader r)
131
        : base(repository, r)
86✔
132
    {
133
        WhereSQL = r["WhereSQL"] as string;
86✔
134
        Description = r["Description"] as string;
86✔
135
        Name = r["Name"] as string;
86✔
136
        IsMandatory = (bool)r["IsMandatory"];
86✔
137

138
        if (r["FilterContainer_ID"] != null && !string.IsNullOrWhiteSpace(r["FilterContainer_ID"].ToString()))
86✔
139
            FilterContainer_ID = int.Parse(r["FilterContainer_ID"].ToString());
78✔
140
        else
141
            FilterContainer_ID = null;
8✔
142

143
        ClonedFromExtractionFilter_ID = ObjectToNullableInt(r["ClonedFromExtractionFilter_ID"]);
86✔
144
        Order = int.Parse(r["Order"].ToString());
86✔
145
    }
86✔
146

147
    /// <summary>
148
    /// Returns Name of filters
149
    /// </summary>
150
    /// <returns></returns>
151
    public override string ToString() => Name;
10✔
152

153

154
    /// <summary>
155
    /// Checks the filter is properly defined (e.g. not blank).
156
    /// </summary>
157
    /// <param name="notifier"></param>
158
    public override void Check(ICheckNotifier notifier)
159
    {
160
        base.Check(notifier);
10✔
161

162
        var checker = new ClonedFilterChecker(this, ClonedFromExtractionFilter_ID,
10✔
163
            ((IDataExportRepository)Repository).CatalogueRepository);
10✔
164
        checker.Check(notifier);
10✔
165
    }
10✔
166

167
    /// <summary>
168
    /// Returns the configuration and dataset (<see cref="ISelectedDataSets"/>) in which the filter is declared.  This involves traversing
169
    /// up any nested <see cref="FilterContainer"/>s to the root.
170
    /// 
171
    /// <para>Returns null if the filter is an orphan (not in a container or part of an orphan container tree)</para>
172
    /// </summary>
173
    /// <returns></returns>
174
    public SelectedDataSets GetDataset()
175
    {
176
        if (FilterContainer_ID == null)
16!
177
            return null;
×
178

179
        var container = Repository.GetObjectByID<FilterContainer>(FilterContainer_ID.Value);
16✔
180
        return container.GetSelectedDataSetsRecursively();
16✔
181
    }
182

183
    public DeployedExtractionFilter ShallowClone(FilterContainer into)
184
    {
185
        var clone = new DeployedExtractionFilter(DataExportRepository, Name, into);
4✔
186
        CopyShallowValuesTo(clone);
4✔
187
        return clone;
4✔
188
    }
189
}
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