17
17
* User: trevor
18
18
* Date: 2023-4-19
19
19
*/
20
+ using SanteDB . BI . Services . Impl ;
21
+ using SanteDB . BusinessRules . JavaScript ;
22
+ using SanteDB . Caching . Memory . Session ;
23
+ using SanteDB . Caching . Memory ;
20
24
using SanteDB . Client . Configuration ;
21
25
using SanteDB . Client . Configuration . Upstream ;
26
+ using SanteDB . Client . Disconnected . Services ;
27
+ using SanteDB . Client . OAuth ;
28
+ using SanteDB . Client . Tickles ;
29
+ using SanteDB . Client . Upstream . Management ;
30
+ using SanteDB . Client . Upstream . Repositories ;
31
+ using SanteDB . Client . Upstream . Security ;
32
+ using SanteDB . Client . Upstream ;
33
+ using SanteDB . Client . UserInterface . Impl ;
22
34
using SanteDB . Core ;
35
+ using SanteDB . Core . Applets . Services . Impl ;
23
36
using SanteDB . Core . Configuration ;
37
+ using SanteDB . Core . Data . Backup ;
38
+ using SanteDB . Core . Data ;
39
+ using SanteDB . Core . Security . Audit ;
40
+ using SanteDB . Core . Security . Privacy ;
41
+ using SanteDB . Core . Security ;
42
+ using SanteDB . Core . Services . Impl ;
43
+ using SanteDB . Security . Certs . BouncyCastle ;
24
44
using System ;
25
45
using System . Collections . Generic ;
26
46
using System . Linq ;
@@ -36,6 +56,79 @@ public class MauiClientInitialConfigurationProvider : IInitialConfigurationProvi
36
56
37
57
public SanteDBConfiguration Provide ( SanteDBHostType hostContextType , SanteDBConfiguration configuration )
38
58
{
59
+ var appServiceSection = configuration . GetSection < ApplicationServiceContextConfigurationSection > ( ) ;
60
+ var instanceName = appServiceSection . InstanceName ;
61
+ var localDataPath = AppDomain . CurrentDomain . GetData ( "DataDirectory" ) ? . ToString ( ) ;
62
+
63
+ if ( null == localDataPath )
64
+ {
65
+ throw new ApplicationException ( "Application bug exists. DataDirectory was not set before configuration provider was called. Ensure the DataDirectory data variable in the app domain is set before the config provider is initialized." ) ;
66
+ }
67
+
68
+ appServiceSection . ServiceProviders . AddRange ( new List < TypeReferenceConfiguration > ( ) {
69
+ new TypeReferenceConfiguration ( typeof ( AesSymmetricCrypographicProvider ) ) ,
70
+ new TypeReferenceConfiguration ( typeof ( InMemoryTickleService ) ) ,
71
+ new TypeReferenceConfiguration ( typeof ( DefaultNetworkInformationService ) ) ,
72
+ new TypeReferenceConfiguration ( typeof ( SHA256PasswordHashingService ) ) ,
73
+ new TypeReferenceConfiguration ( typeof ( DefaultPolicyDecisionService ) ) ,
74
+ new TypeReferenceConfiguration ( typeof ( MemoryAdhocCacheService ) ) ,
75
+ new TypeReferenceConfiguration ( typeof ( AppletLocalizationService ) ) ,
76
+ new TypeReferenceConfiguration ( typeof ( AppletBusinessRulesDaemon ) ) ,
77
+ new TypeReferenceConfiguration ( typeof ( DefaultUpstreamManagementService ) ) ,
78
+ new TypeReferenceConfiguration ( typeof ( DefaultUpstreamIntegrationService ) ) ,
79
+ new TypeReferenceConfiguration ( typeof ( DefaultUpstreamAvailabilityProvider ) ) ,
80
+ new TypeReferenceConfiguration ( typeof ( MemoryCacheService ) ) ,
81
+ new TypeReferenceConfiguration ( typeof ( DefaultThreadPoolService ) ) ,
82
+ new TypeReferenceConfiguration ( typeof ( MauiInteractionProvider ) ) ,
83
+ new TypeReferenceConfiguration ( typeof ( MemoryQueryPersistenceService ) ) ,
84
+ new TypeReferenceConfiguration ( typeof ( FileSystemDispatcherQueueService ) ) ,
85
+ new TypeReferenceConfiguration ( typeof ( SimplePatchService ) ) ,
86
+ new TypeReferenceConfiguration ( typeof ( DefaultBackupManager ) ) ,
87
+ new TypeReferenceConfiguration ( typeof ( AppletBiRepository ) ) ,
88
+ new TypeReferenceConfiguration ( typeof ( OAuthClient ) ) ,
89
+ new TypeReferenceConfiguration ( typeof ( MemorySessionManagerService ) ) ,
90
+ new TypeReferenceConfiguration ( typeof ( UpstreamUpdateManagerService ) ) , // AmiUpdateManager
91
+ new TypeReferenceConfiguration ( typeof ( UpstreamIdentityProvider ) ) ,
92
+ new TypeReferenceConfiguration ( typeof ( UpstreamApplicationIdentityProvider ) ) ,
93
+ new TypeReferenceConfiguration ( typeof ( UpstreamSecurityChallengeProvider ) ) , // AmiSecurityChallengeProvider
94
+ new TypeReferenceConfiguration ( typeof ( UpstreamRoleProviderService ) ) ,
95
+ new TypeReferenceConfiguration ( typeof ( UpstreamSecurityRepository ) ) ,
96
+ new TypeReferenceConfiguration ( typeof ( UpstreamRepositoryFactory ) ) ,
97
+ new TypeReferenceConfiguration ( typeof ( UpstreamPolicyInformationService ) ) ,
98
+ new TypeReferenceConfiguration ( typeof ( DataPolicyFilterService ) ) ,
99
+ new TypeReferenceConfiguration ( typeof ( MauiOperatingSystemInfoService ) ) ,
100
+ new TypeReferenceConfiguration ( typeof ( AppletSubscriptionRepository ) ) ,
101
+ new TypeReferenceConfiguration ( typeof ( InMemoryPivotProvider ) ) ,
102
+ new TypeReferenceConfiguration ( typeof ( AuditDaemonService ) ) ,
103
+ new TypeReferenceConfiguration ( typeof ( DefaultDataSigningService ) ) ,
104
+ new TypeReferenceConfiguration ( typeof ( DefaultBarcodeProviderService ) ) ,
105
+ new TypeReferenceConfiguration ( typeof ( FileSystemDispatcherQueueService ) ) ,
106
+ new TypeReferenceConfiguration ( typeof ( BouncyCastleCertificateGenerator ) ) ,
107
+ new TypeReferenceConfiguration ( typeof ( RepositoryEntitySource ) ) ,
108
+ new TypeReferenceConfiguration ( typeof ( FileSystemCdssLibraryRepository ) ) ,
109
+ new TypeReferenceConfiguration ( typeof ( MauiPlatformSecurityProvider ) ) ,
110
+ } ) ;
111
+
112
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "input.name" , "simple" ) ) ;
113
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "input.address" , "text" ) ) ;
114
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "optional.patient.address.city" , "true" ) ) ;
115
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "optional.patient.address.county" , "true" ) ) ;
116
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "optional.patient.address.state" , "false" ) ) ;
117
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "optional.patient.name.family" , "false" ) ) ;
118
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "optional.patient.address.given" , "false" ) ) ;
119
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.address.state" , "false" ) ) ;
120
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.address.county" , "true" ) ) ;
121
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.address.city" , "false" ) ) ;
122
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.address.precinct" , "true" ) ) ;
123
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.name.prefix" , "true" ) ) ;
124
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.name.suffix" , "true" ) ) ;
125
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.name.family" , "false" ) ) ;
126
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "forbid.patient.name.given" , "false" ) ) ;
127
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "allow.patient.religion" , "false" ) ) ;
128
+ appServiceSection . AppSettings . Add ( new AppSettingKeyValuePair ( "allow.patient.ethnicity" , "false" ) ) ;
129
+ appServiceSection . AppSettings = appServiceSection . AppSettings . OrderBy ( o => o . Key ) . ToList ( ) ;
130
+
131
+
39
132
// Security configuration
40
133
var wlan = NetworkInterface . GetAllNetworkInterfaces ( ) . FirstOrDefault ( o => o . NetworkInterfaceType == NetworkInterfaceType . Ethernet || o . Description . StartsWith ( "wlan" ) ) ;
41
134
String macAddress = Guid . NewGuid ( ) . ToString ( ) ;
0 commit comments