Gets or sets a StorageDataAccessFlags value that can limit the results of a storage data access query.
public StorageDataAccessFlags Flags { get; set; }
public:
property StorageDataAccessFlags^ Flags
{
StorageDataAccessFlags^ get()
void set(StorageDataAccessFlags^ value)
}
A StorageDataAccessFlags value that can limit the results of a storage data access query.
A production PACS Storage Server database often contains 10 million or more records. Performing an open query (i.e. no filters) on such a database can be a time-consuming task that ties up resources.
The MaxQueryResults and Flags together limit the results of any of the following queries:
If MaxQueryResults is 0, then the result of any of the above queries is unlimited.
If MaxQueryResults is greater than 0 and Flags is StorageDataAccessFlags.None, then the result of any of the above queries is exactly MaxQueryResults.
If MaxQueryResults is greater than 0 and Flags is StorageDataAccessFlags.LimitOnlyWildcardQueries
, then the result of any of the above queries is:
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