DatabaseQueryAddin Class

The DatabaseQueryAddin class is one of the seven addins available in the Leadtools.Medical.WebViewer.Addins assembly.  The DatabaseQueryAddin is used to read patient, study, series, and instance level information, as well as presentation state information from the database. The DatabaseQueryAddin class is shown below, with its public members and a description of each member: 

public class DatabaseQueryAddin : IQueryAddin 
   { 
      // Constructor 
      public DatabaseQueryAddin(IAuthorizedStorageDataAccessAgent dataAccess); 
 
      // Queries the storage server database for patients (Patient Level Query) 
      public PatientData[] FindPatients(string userName, QueryOptions options, ExtraOptions extraOptions); 
       
      // Queries the storage server database for studies (Study level query) 
      public StudyData[] FindStudies(string userName, QueryOptions options, ExtraOptions extraOptions); 
       
      // Queries the storage server database for series (Series level query) 
      public SeriesData[] FindSeries(string userName, QueryOptions options, ExtraOptions extraOptions); 
       
      // Queries the storage server database for DICOM instances (Image level query) 
      public InstanceData[] FindInstances(string userName, QueryOptions options, ExtraOptions extraOptions); 
 
      // Finds the presentation state instances (DICOM Annotations) in the storage server database 
      public PresentationStateData[] FindPresentationState(string userName, string referencedSeries, string userData); 
   } 

Note that the FindPatients, FindStudies, FindSeries, and FindInstances methods all take a QueryOptions parameter.  The QueryOptions class defines all possible query parameters that can be used when calling one of these methods.  For example, to find all male patients born before 1970, call FindPatients and pass a QueryOptions parameter with the Sex and BirthDate members filled accordingly.

The QueryOptions class has the following public members:

public class QueryOptions 
   { 
      public PatientsQueryOptions PatientsOptions { get; set; } 
 
      public StudiesQueryOptions StudiesOptions { get; set; } 
 
      public SeriesQueryOptions SeriesOptions { get; set; } 
 
      public InstancesQueryOptions InstancesOptions { get; set; } 
   } 

The four QueryOptions members have the following class definitions: 

public class PatientsQueryOptions 
   { 
      public string PatientName { get; set; } 
      public string PatientID { get; set; } 
      public string Sex { get; set; } 
      public string BirthDate { get; set; } 
   } 
 
 
   public class StudiesQueryOptions 
   { 
      public string StudyID { get; set; } 
      public string[] ModalitiesInStudy { get; set; } 
      public string AccessionNumber { get; set; } 
      public string ReferDoctorName { get; set; } 
      public string StudyDateStart { get; set; } 
      public string StudyDateEnd { get; set; } 
      public string StudyTimeStart { get; set; } 
      public string StudyTimeEnd { get; set; } 
      public string StudyInstanceUID { get; set; } 
   } 
 
   public class SeriesQueryOptions 
   { 
      public string Modality { get; set; } 
      public string SeriesNumber { get; set; } 
      public string SeriesInstanceUID { get; set; } 
   } 
 
   public class InstancesQueryOptions 
   { 
      public string InstanceNumber { get; set; } 
      public string SOPInstanceUID { get; set; } 
   } 

This defines all possible search parameters for the FindPatients, FindStudies, FindSeries, and FindInstances methods.  The FindXxxx methods all internally call the FillMatchingParameters() method, which converts a QueryOptions object to a MatchingParameterList object.  The MatchingParameterList object is used to generate the WHERE statement of the corresponding database query.  For detailed information on the MatchingParameterList object, see the Custom Medical Storage Data Access Layer section of the Changing the LEAD Medical Storage Server to Use a Different Database Schema  tutorial.

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