-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathConceptDTO.cs
More file actions
94 lines (83 loc) · 3.58 KB
/
ConceptDTO.cs
File metadata and controls
94 lines (83 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Copyright (c) 2022, UW Medicine Research IT, University of Washington
// Developed by Nic Dobbins and Cliff Spital, CRIO Sean Mooney
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
using System;
using System.Collections.Generic;
using Model.Compiler;
namespace API.DTO.Compiler
{
public class ConceptDTO : ConceptRefDTO
{
public Guid? ParentId { get; set; }
public Guid RootId { get; set; }
public string ExternalId { get; set; }
public string ExternalParentId { get; set; }
public bool IsNumeric { get; set; }
public bool IsEventBased { get; set; }
public bool IsParent { get; set; }
public bool IsEncounterBased { get; set; }
public bool IsPatientCountAutoCalculated { get; set; }
public bool IsQueryable { get; set; }
public bool IsSpecializable { get; set; }
public string UiDisplayName { get; set; }
public string UiDisplayText { get; set; }
public string UiDisplaySubtext { get; set; }
public string UiDisplayUnits { get; set; }
public string UiDisplayTooltip { get; set; }
public string UiDisplayEventName { get; set; }
public int? UiDisplayPatientCount { get; set; }
public int? EventTypeId { get; set; }
public IEnumerable<ConceptSpecializationGroup> SpecializationGroups { get; set; }
public IEnumerable<ConceptPatientYearCount> UiDisplayPatientCountByYear { get; set; }
public string UiNumericDefaultText { get; set; }
public ConceptDTO() { }
public ConceptDTO(Concept c) : base(c)
{
ParentId = c.ParentId;
RootId = c.RootId;
ExternalId = c.ExternalId;
ExternalParentId = c.ExternalParentId;
IsNumeric = c.IsNumeric;
IsEventBased = c.IsEventBased;
IsParent = c.IsParent;
IsEncounterBased = c.IsEncounterBased;
IsSpecializable = c.IsSpecializable;
SpecializationGroups = c.SpecializationGroups.ConceptSpecializationGroupDTOs();
UiDisplayName = c.UiDisplayName;
UiDisplayText = c.UiDisplayText;
UiDisplaySubtext = c.UiDisplaySubtext;
UiDisplayUnits = c.UiDisplayUnits;
UiDisplayTooltip = c.UiDisplayTooltip;
UiDisplayPatientCount = c.UiDisplayPatientCount;
UiDisplayPatientCountByYear = c.UiDisplayPatientCountByYear;
UiDisplayEventName = c.UiDisplayEventName;
UiNumericDefaultText = c.UiNumericDefaultText;
EventTypeId = c.EventTypeId;
// A field is queryable by default, but can be considered ineligible for querying
// if it doesn't have query fields (WHERE and numeric) defined.
IsQueryable = !(string.IsNullOrWhiteSpace(c.SqlFieldNumeric)
&& string.IsNullOrWhiteSpace(c.SqlSetWhere));
}
}
public class ConceptRefDTO : IConceptRefDTO
{
public Guid? Id { get; set; }
public string UniversalId { get; set; }
public bool UseUniversalId() => !string.IsNullOrWhiteSpace(UniversalId);
public ConceptRefDTO()
{
}
public ConceptRefDTO(ConceptRef c)
{
Id = c.Id;
UniversalId = c.UniversalId?.ToString();
}
public ConceptRefDTO(Concept c)
{
Id = c.Id;
UniversalId = c.UniversalId?.ToString();
}
}
}