Registering the Medical Storage Data Access Layer

The LEAD Medical Storage Server has two main components that run in different processes:

My.Medical.Storage.DataAccessLayer must be registered in each of the two processes.

Registering the My.Medical.Storage.DataAccessLayer requires the following steps:

The following code snippet shows a Configure method which does this:

private static IStorageDataAccessAgent _dataAccess; 
       
      public static IStorageDataAccessAgent DataAccess 
      { 
         get 
         { 
            return _dataAccess; 
         } 
 
         set 
         { 
            _dataAccess = value; 
         } 
      } 
 
       
      public static string ServiceDirectory 
      { 
         get; 
         set; 
      } 
       
      static void RegisterInterfaces() 
      { 
         DataAccessServiceLocator.Register<IPatientInfo>(new MyPatientInfo()); 
         DataAccessServiceLocator.Register<IStudyInfo>(new MyStudyInfo()); 
         DataAccessServiceLocator.Register<ISeriesInfo>(new MySeriesInfo()); 
         DataAccessServiceLocator.Register<IInstanceInfo>(new MyInstanceInfo()); 
          
         RegisteredEntities.Items.Add(RegisteredEntities.PatientEntityName, typeof(MyPatient)); 
         RegisteredEntities.Items.Add(RegisteredEntities.StudyEntityName, typeof(MyStudy)); 
         RegisteredEntities.Items.Add(RegisteredEntities.SeriesEntityName, typeof(MySeries)); 
         RegisteredEntities.Items.Add(RegisteredEntities.InstanceEntityName, typeof(MyInstance)); 
      } 
 
      static void RegisterDataAccessAgents(string serviceName) 
      { 
         System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(ServiceDirectory); 
         if (!DataAccessServices.IsDataAccessServiceRegistered<IStorageDataAccessAgent>()) 
         { 
            IStorageDataAccessAgent storageDataAccess =  
               DataAccessFactory.GetInstance(new MyStorageDataAccessConfigurationView(configuration, null, serviceName)).CreateDataAccessAgent<IStorageDataAccessAgent>(); 
 
            DataAccessServices.RegisterDataAccessService<IStorageDataAccessAgent>(storageDataAccess); 
 
            DataAccess = storageDataAccess; 
         } 
         else 
         { 
            DataAccess = DataAccessServices.GetDataAccessService<IStorageDataAccessAgent>(); 
         } 
      } 
       
      public void Configure(Leadtools.Dicom.AddIn.DicomServer server) 
      { 
         ServiceDirectory = server.ServerDirectory; 
 
         RegisterDataAccessAgents(ServiceDirectory); 
         RegisterInterfaces(); 
      } 

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Imaging, Medical, and Document
Click or drag to resize