-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestScenarioDefinition.cs
More file actions
147 lines (114 loc) · 5.73 KB
/
Copy pathTestScenarioDefinition.cs
File metadata and controls
147 lines (114 loc) · 5.73 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
using LantanaGroup.Automation.Generation;
namespace Automation.UI.Models;
/// <summary>
/// A named, saveable test scenario configuration.
/// Stored in MongoDB and presented in the UI for quick reuse.
/// </summary>
public class TestScenarioDefinition
{
/// <summary>Unique identifier (Guid stored as string in Mongo).</summary>
public Guid Id { get; set; } = Guid.NewGuid();
/// <summary>User-facing name for this scenario.</summary>
public string Name { get; set; } = string.Empty;
/// <summary>Optional description / notes.</summary>
public string? Description { get; set; }
/// <summary>
/// When true, the scenario was seeded by the system and cannot be modified or deleted.
/// It can still be cloned.
/// </summary>
public bool IsSystemScenario { get; set; }
// ----- Report -----
/// <summary>How the report is triggered.</summary>
public ReportMethod ReportMethod { get; set; } = ReportMethod.Adhoc;
/// <summary>Selected measures for the run.</summary>
public List<ProfiledMeasureType> SelectedMeasures { get; set; } = [ProfiledMeasureType.NhsnAcuteCareHospitalMonthlyInitialPopulation];
// ----- Patient Pool -----
/// <summary>Generation seed for deterministic output.</summary>
public int Seed { get; set; } = 20260329;
/// <summary>Number of patients (used in Standard generation mode).</summary>
public int PatientCount { get; set; } = 10;
/// <summary>Minimum resources per patient (inclusive). Generation picks a random value in [Min, Max] per patient.</summary>
public int ResourcesPerPatientMin { get; set; } = 250;
/// <summary>Maximum resources per patient (inclusive). When equal to Min, every patient gets the same count.</summary>
public int ResourcesPerPatientMax { get; set; } = 250;
// ----- Generation Mode -----
/// <summary>
/// Cohort-based configuration for measure-eligibility mode.
/// Each cohort defines how many patients to generate with a given eligibility
/// and which clinical scenario indices are allowed as the source pool.
/// </summary>
public List<PatientCohortDefinition> PatientCohorts { get; set; } = [];
/// <summary>
/// Configured NHSN reporting Organization ID for this scenario.
/// </summary>
public string NhsnOrganizationId { get; set; } = string.Empty;
// ----- Housekeeping -----
/// <summary>
/// Optional query plan template ID. When set, the scenario uses this template's
/// queries instead of the built-in defaults from <c>QueryPlanDefaults</c>.
/// When null, the system default query plan is used.
/// </summary>
public Guid? QueryPlanTemplateId { get; set; }
/// <summary>
/// Optional normalization suite ID. When set, the scenario uses this suite's
/// operations instead of creating a simple default normalization.
/// When null, the system default normalization suite is used.
/// </summary>
public Guid? NormalizationSuiteId { get; set; }
/// <summary>
/// Optional organization-resource-map template ID used to configure
/// DataAcquisition organization-location mapping behavior for the run.
/// When null, the system default template is used.
/// </summary>
public Guid? OrganizationResourceMapTemplateId { get; set; }
/// <summary>
/// Remove facility config, soft-delete reports, DA logs, and query dispatch config after the run.
/// </summary>
public bool CleanupServiceData { get; set; }
/// <summary>
/// Expunge all data from the FHIR server after the run.
/// </summary>
public bool CleanupFhirData { get; set; } = true;
// ----- Reporting Period -----
/// <summary>
/// Reporting period start (UTC). When null, the system default
/// (<c>2023-01-01T00:00:00Z</c>) is used. The UI auto-suggests a value that
/// encompasses imported-patient encounter dates when imports are added.
/// </summary>
public DateTimeOffset? ReportPeriodStart { get; set; }
/// <summary>
/// Reporting period end (UTC). When null, the system default
/// (<c>2023-12-31T23:59:59Z</c>) is used.
/// </summary>
public DateTimeOffset? ReportPeriodEnd { get; set; }
// ----- Live Scheduled Simulation -----
/// <summary>
/// When true, a ScheduledReport run holds a short live window and accepts
/// Admit/Discharge injections before finalizing the report.
/// </summary>
public bool IsLiveSimulation { get; set; }
/// <summary>
/// Live reporting window length in minutes (typically 5, 10, or 15).
/// </summary>
public int ReportingWindowMinutes { get; set; } = 10;
/// <summary>
/// Optional number of generated patients to admit when the live window opens.
/// </summary>
public int SeedPatientCount { get; set; }
// ----- Imported Patients (supplemental, separate from cohorts/random pool) -----
/// <summary>
/// Patients to fetch from the FHIR server by ID and include alongside the generated pool.
/// These patients are assumed to already exist on the server; their data is fetched at run
/// time, classified, and added to the manifest. They are NOT uploaded and NOT expunged on
/// cleanup.
/// </summary>
public List<ImportedPatientInput> ImportedPatientIds { get; set; } = [];
/// <summary>
/// Patients supplied as FHIR transaction bundles (one bundle per patient). These are
/// uploaded to the FHIR server during the run, included in the manifest, and expunged on
/// cleanup like any generated patient.
/// </summary>
public List<ImportedPatientInput> ImportedPatientBundles { get; set; } = [];
/// <summary>When the scenario was created or last updated.</summary>
public DateTimeOffset UpdatedAt { get; set; } = DateTimeOffset.UtcNow;
}