/// <summary>
 /// Create injected service
 /// </summary>
 public MdmDataManagementService(IServiceManager serviceManager, IConfigurationManager configuration, IDataCachingService cachingService = null, IRecordMatchingConfigurationService matchConfigurationService = null, IRecordMatchingService matchingService = null, ISubscriptionExecutor subscriptionExecutor = null, SimDataManagementService simDataManagementService = null, IJobManagerService jobManagerService = null)
 {
     this.m_configuration             = configuration.GetSection <ResourceManagementConfigurationSection>();
     this.m_matchingService           = matchingService;
     this.m_serviceManager            = serviceManager;
     this.m_subscriptionExecutor      = subscriptionExecutor;
     this.m_jobManager                = jobManagerService;
     this.m_matchConfigurationService = matchConfigurationService;
     this.m_dataCachingService        = cachingService;
     if (simDataManagementService != null)
     {
         throw new InvalidOperationException("Cannot run MDM and SIM in same mode");
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Configure the feature
        /// </summary>
        public void Configure(SanteDBConfiguration configuration, IDictionary <string, string> settings)
        {
            var resourceConf = configuration.GetSection <ResourceManagementConfigurationSection>();

            if (resourceConf == null)
            {
                resourceConf = new ResourceManagementConfigurationSection();
                configuration.AddSection(resourceConf);
            }

            if (settings.TryGetValue(ResourceTypeSetting, out string resources))
            {
                resourceConf.ResourceTypes = resources.Split(';').Select(o =>
                {
                    var conf = o.Split('=');

                    if (conf.Length > 1)
                    {
                        Trace.TraceWarning("OLD SETTING DETECTED - Since 2.1.65 the of match configurations ({0}) should be moved to the match definition - THIS SETTING WILL BE IGNORED", conf[1]);
                    }

                    return(new ResourceTypeReferenceConfiguration()
                    {
                        TypeXml = conf[0]
                    });
                }).ToList();
            }

            // Add services
            var serviceConfiguration = configuration.GetSection <ApplicationServiceContextConfigurationSection>().ServiceProviders;

            if (!serviceConfiguration.Any(s => s.Type == typeof(MdmDataManagementService)))
            {
                serviceConfiguration.Add(new TypeReferenceConfiguration(typeof(MdmDataManagementService)));
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Candidate operations manager
 /// </summary>
 public MdmIgnoreResource(IConfigurationManager configurationManager)
 {
     this.m_configuration = configurationManager.GetSection <ResourceManagementConfigurationSection>();
     this.ParentTypes     = this.m_configuration?.ResourceTypes.Select(o => o.Type).ToArray() ?? Type.EmptyTypes;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Candidate operations manager
 /// </summary>
 public MdmLinkResource(IConfigurationManager configurationManager, IDataPersistenceService <Bundle> batchService)
 {
     this.m_configuration = configurationManager.GetSection <ResourceManagementConfigurationSection>();
     this.ParentTypes     = this.m_configuration?.ResourceTypes.Select(o => o.Type).ToArray() ?? Type.EmptyTypes;
     this.m_batchService  = batchService;
 }