-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathManageNemsSubscriptionConfig.cs
More file actions
102 lines (86 loc) · 3.63 KB
/
ManageNemsSubscriptionConfig.cs
File metadata and controls
102 lines (86 loc) · 3.63 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
namespace NHS.CohortManager.DemographicServices;
using System.ComponentModel.DataAnnotations;
using Hl7.Fhir.Specification.Navigation;
/// <summary>
/// Configuration settings for NEMS subscription management
/// </summary>
public class ManageNemsSubscriptionConfig
{
/// <summary>
/// NEMS FHIR API base endpoint
/// Integration: https://msg.intspineservices.nhs.uk/STU3
/// Production: Contact NHS Digital for production URLs
/// </summary>
[Required(ErrorMessage = "NemsFhirEndpoint is required")]
public string NemsFhirEndpoint { get; set; } = string.Empty;
/// <summary>
/// Your organization's ASID (Application Service Instance Identifier)
/// Example: "200000002527"
/// </summary>
[Required(ErrorMessage = "NemsFromAsid is required")]
public string NemsFromAsid { get; set; } = string.Empty;
/// <summary>
/// Target ASID (usually same as FromAsid for NEMS)
/// Example: "200000002527"
/// </summary>
[Required(ErrorMessage = "NemsToAsid is required")]
public string NemsToAsid { get; set; } = string.Empty;
/// <summary>
/// Your organization's ODS code
/// Example: "T8T9T"
/// </summary>
[Required(ErrorMessage = "NemsOdsCode is required")]
public string NemsOdsCode { get; set; } = string.Empty;
/// <summary>
/// Your MESH mailbox ID (CRITICAL: Use full mailbox ID, not just ODS code)
/// Example: "T8T9TOT001" (NOT just "T8T9T")
/// </summary>
[Required(ErrorMessage = "NemsMeshMailboxId is required")]
public string NemsMeshMailboxId { get; set; } = string.Empty;
/// <summary>
/// Azure Key Vault connection string for certificate storage
/// Example: "https://your-keyvault.vault.azure.net/"
/// </summary>
public string KeyVaultConnectionString { get; set; } = string.Empty;
/// <summary>
/// Name of the NEMS client certificate stored in Key Vault
/// Example: "nems-client-certificate"
/// </summary>
public string NemsKeyName { get; set; } = string.Empty;
/// <summary>
/// Local certificate file path (for development only)
/// Only used when KeyVaultConnectionString is empty
/// </summary>
public string? NemsLocalCertPath { get; set; }
/// <summary>
/// Local certificate password (for development only)
/// Only used when KeyVaultConnectionString is empty
/// </summary>
public string? NemsLocalCertPassword { get; set; }
/// <summary>
/// FHIR profile for EMS subscriptions
/// </summary>
public string NemsSubscriptionProfile { get; set; } = "https://fhir.nhs.uk/STU3/StructureDefinition/EMS-Subscription-1";
/// <summary>
/// Base criteria for NHS number identifier
/// </summary>
public string NemsSubscriptionCriteria { get; set; } = "https://fhir.nhs.uk/Id/nhs-number";
/// <summary>
/// Whether to bypass server certificate validation (for development only)
/// Set to true only during local development
/// </summary>
public bool NemsBypassServerCertificateValidation { get; set; } = false;
/// <summary>
/// HTTP client timeout in seconds for NEMS API requests
/// Default: 300 seconds (5 minutes)
/// </summary>
public int NemsHttpClientTimeoutSeconds { get; set; } = 300;
/// <summary>
/// Custom validation to ensure either KeyVault or local cert is configured
/// </summary>
public bool IsValid => !string.IsNullOrEmpty(KeyVaultConnectionString) || !string.IsNullOrEmpty(NemsLocalCertPath);
/// <summary>
/// Bool to set the function to be in stubbed mode. Simulated responses from NEMS
/// </summary>
public bool IsStubbed { get; set; } = true;
}