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

HicServices / RDMP / 26566925905

28 May 2026 09:37AM UTC coverage: 57.023% (-0.08%) from 57.101%
26566925905

push

github

JFriel
Merge branch 'bugfix/cohort-commit-issue' of https://github.com/HicServices/RDMP into bugfix/cohort-commit-issue

11562 of 21813 branches covered (53.01%)

Branch coverage included in aggregate %.

32688 of 55787 relevant lines covered (58.59%)

18057.84 hits per line

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

0.0
/Rdmp.Core/DataViewing/ViewCohortIdentificationConfigurationSqlCollection.cs
1
// Copyright (c) The University of Dundee 2018-2021
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.Collections.Generic;
8
using System.Linq;
9
using FAnsi.Discovery.QuerySyntax;
10
using Rdmp.Core.Curation.Data;
11
using Rdmp.Core.Curation.Data.Cohort;
12
using Rdmp.Core.Curation.Data.Dashboarding;
13
using Rdmp.Core.QueryBuilding;
14
using Rdmp.Core.ReusableLibraryCode.DataAccess;
15

16

17
namespace Rdmp.Core.DataViewing;
18

19
internal class ViewCohortIdentificationConfigurationSqlCollection : PersistableObjectCollection,
20
    IViewSQLAndResultsCollection
21
{
22
    public bool UseQueryCache { get; set; }
×
23
    public bool DisableRun => false;
×
24

25
    public ViewCohortIdentificationConfigurationSqlCollection()
×
26
    {
27
    }
×
28

29
    public ViewCohortIdentificationConfigurationSqlCollection(CohortIdentificationConfiguration config) : this()
×
30
    {
31
        DatabaseObjects.Add(config);
×
32
    }
×
33

34
    public IEnumerable<DatabaseEntity> GetToolStripObjects()
35
    {
36
        if (UseQueryCache)
×
37
        {
38
            var cache = GetCacheServer();
×
39
            if (cache != null)
×
40
                yield return cache;
×
41
        }
42
    }
×
43

44
    private ExternalDatabaseServer GetCacheServer() =>
45
        CohortIdentificationConfiguration is { QueryCachingServer_ID: not null }
×
46
            ? CohortIdentificationConfiguration.QueryCachingServer
×
47
            : null;
×
48

49

50
    public IDataAccessPoint GetDataAccessPoint()
51
    {
52
        var cache = GetCacheServer();
×
53

54
        if (UseQueryCache && cache != null)
×
55
            return cache;
×
56

57
        var builder = new CohortQueryBuilder(CohortIdentificationConfiguration, null);
×
58
        builder.RegenerateSQL();
×
59
        return new SelfCertifyingDataAccessPoint(builder.Results.TargetServer);
×
60
    }
61

62
    public string GetSql()
63
    {
64
        var builder = new CohortQueryBuilder(CohortIdentificationConfiguration, null);
×
65

66
        if (!UseQueryCache && CohortIdentificationConfiguration.QueryCachingServer_ID.HasValue)
×
67
            builder.CacheServer = null;
×
68

69

70
        return builder.SQL;
×
71
    }
72

73
    public string GetTabName() => $"View {CohortIdentificationConfiguration}";
×
74

75
    public void AdjustAutocomplete(IAutoCompleteProvider autoComplete)
76
    {
77
    }
×
78

79
    private CohortIdentificationConfiguration CohortIdentificationConfiguration =>
80
        DatabaseObjects.OfType<CohortIdentificationConfiguration>().SingleOrDefault();
×
81

82
    public IQuerySyntaxHelper GetQuerySyntaxHelper() => GetDataAccessPoint()?.GetQuerySyntaxHelper();
×
83
}
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