←Select platform

IStorageDataAccessAgent6 Interface

Summary

Provides members for limiting the results of storage data access queries.

Remarks

The IStorageDataAccessAgent6 interface derives from these interfaces:

The functionality in the IStorageDataAccessAgent6 interface that is not a part of the derived interfaces is related to limiting the results of storage data access queries.

Example

This example shows how to use IStorageDataAccessAgent6.Flags to limit the results of a storage data access query.

C#
using Leadtools.Dicom; 
using Leadtools.DicomDemos; 
using Leadtools.Medical.DataAccessLayer; 
using Leadtools.Medical.DataAccessLayer.Catalog; 
using Leadtools.Medical.Storage.DataAccessLayer; 
using Leadtools.Medical.Storage.DataAccessLayer.Configuration; 
 
public static IStorageDataAccessAgent6 GetStorageDataAccessAgent6() 
{ 
   // Before running this sample, follow these steps: 
   // 1. Run CSPacsDatabaseConfigurationDemo.exe to create the databases 
   // 2. Run CSPACSConfigDemo.exe to create the DICOM services 
   // 3. Set 'serviceDirectory' to the DICOM service folder 
   string serviceDirectory = @"d:\LEADTOOLS22\Bin\Dotnet4\x64\L22_PACS_SCP64"; 
   string productName = "StorageServer"; 
   string serviceName = "L22_PACS_SCP64"; 
   System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(serviceDirectory); 
 
   StorageDataAccessConfigurationView view = new StorageDataAccessConfigurationView(configuration, productName, serviceName); 
   IStorageDataAccessAgent6 agent = DataAccessFactory.GetInstance(view).CreateDataAccessAgent<IStorageDataAccessAgent6>(); 
   return agent; 
} 
 
public static void StorageDataAccessFlagsExample() 
{ 
   IStorageDataAccessAgent6 agent = GetStorageDataAccessAgent6(); 
   string patientId = string.Empty; 
   ICatalogEntity patientEntity = null; 
   MatchingParameterCollection mpc = null; 
   MatchingParameterList mpl = null; 
   int instanceCount = 0; 
   DataSet ds = null; 
 
   // Limit wild-card queries to 10 results 
   agent.Flags = StorageDataAccessFlags.LimitOnlyWildcardQueries; 
   agent.MaxQueryResults = 10; 
 
   // 1st Query: 
   //    Get the count of all instances for James Smith, 999-12-3456 
   //    For the default Storage Server database, this patient has 483 instances 
   patientId = "999-12-3456"; 
   patientEntity = RegisteredEntities.GetPatientEntity(patientId); 
   mpc = new MatchingParameterCollection(); 
   mpl = new MatchingParameterList(); 
   mpl.Add(patientEntity); 
   mpc.Add(mpl); 
   ds = agent.QueryCompositeInstances(mpc); 
   instanceCount = ds.InstanceRowCount(); 
   Console.WriteLine($"1st Query: InstanceCount (should be 483): {instanceCount}"); 
 
   // 2nd Query: 
   //    Get the count of all instances for patient with wildcard 
   //    For the default Storage Server database, this patient has 483 instances 
   //    But since this is a wildcard query, the result is limited by 'MaxQueryResults' which is 10 
   patientId = "999%"; 
   patientEntity = RegisteredEntities.GetPatientEntity(patientId); 
   mpc = new MatchingParameterCollection(); 
   mpl = new MatchingParameterList(); 
   mpl.Add(patientEntity); 
   mpc.Add(mpl); 
   ds = agent.QueryCompositeInstances(mpc); 
   instanceCount = ds.InstanceRowCount(); 
   Console.WriteLine($"2nd Query: InstanceCount (should be 10): {instanceCount}"); 
 
   // 3rd Query: 
   //    Get the count of all instances for all patients 
   //    For the default Storage Server database, this 509 instances 
   //    But since this is a wildcard query, the result is limited by 'MaxQueryResults' which is 10 
   patientId = string.Empty; 
   patientEntity = RegisteredEntities.GetPatientEntity(patientId); 
   mpc = new MatchingParameterCollection(); 
   mpl = new MatchingParameterList(); 
   mpl.Add(patientEntity); 
   mpc.Add(mpl); 
   ds = agent.QueryCompositeInstances(mpc); 
   instanceCount = ds.InstanceRowCount(); 
   Console.WriteLine($"3rd Query: InstanceCount (should be 10): {instanceCount}"); 
 
   // 4th Query: 
   //    Repeat the 3rd query, but this time set MaxQueryResults = 0 to enable unlimited query results 
   //    The result should be 509 
   agent.MaxQueryResults = 0; 
   patientId = string.Empty; 
   patientEntity = RegisteredEntities.GetPatientEntity(patientId); 
   mpc = new MatchingParameterCollection(); 
   mpl = new MatchingParameterList(); 
   mpl.Add(patientEntity); 
   mpc.Add(mpl); 
   ds = agent.QueryCompositeInstances(mpc); 
   instanceCount = ds.InstanceRowCount(); 
   Console.WriteLine($"4th Query: InstanceCount (should be 509): {instanceCount}"); 
 
   Console.WriteLine("Finished"); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.5.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Medical.Storage.DataAccessLayer Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.