←Select platform

Flags Property

Summary

Gets or sets a StorageDataAccessFlags value that can limit the results of a storage data access query.

Syntax
C#
C++/CLI
public StorageDataAccessFlags Flags { get; set; } 
public:  
   property StorageDataAccessFlags^ Flags 
   { 
      StorageDataAccessFlags^ get() 
      void set(StorageDataAccessFlags^ value) 
   } 

Property Value

A StorageDataAccessFlags value that can limit the results of a storage data access query.

Remarks

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 IStorageDataAccessAgent6.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 IStorageDataAccessAgent6.Flags is StorageDataAccessFlags.None, then the result of any of the above queries is exactly MaxQueryResults.

If MaxQueryResults is greater than 0 and IStorageDataAccessAgent6.Flags is StorageDataAccessFlags.LimitOnlyWildcardQueries, then the result of any of the above queries is:

  1. Exactly MaxQueryResults if the query is a wild-card query
  2. Unlimited if the query is not a wild-card query
Example
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.