Provides members for limiting the results of storage data access queries.
public abstract class StorageDbDataAccessAgent6 : StorageDbDataAccessAgent5, IStorageDataAccessAgent6
public:
ref class StorageDbDataAccessAgent6 abstract : StorageDbDataAccessAgent5, IStorageDataAccessAgent6
This class implements the IStorageDataAccessAgent6 interface.
The functionality in the IStorageDataAccessAgent6 interface that is not a part of the derived interfaces is related, limiting the results of storage data access queries.
Related interfaces:
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");
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document