Class DICOM_Query

  • All Implemented Interfaces:
    java.lang.Runnable

    public class DICOM_Query
    extends DICOM_SOP
    implements java.lang.Runnable
    This is the DICOM query class that defines functions to compose and send a patient root, patient level DICOM query request to the image file server located in NIH's Clinical Center.
    This DICOM communication package was originally based on the Java Dicom Package, whose license is below:
     Java Dicom Package (com.zmed.dicom)
     
      Copyright (c) 1996-1997 Z Medical Imaging Systems, Inc.
     
      This software is provided, as is, for non-commercial educational
      purposes only.   Use or incorporation of this software or derivative
      works in commercial applications requires written consent from
      Z Medical Imaging Systems, Inc.
     
      Z MEDICAL IMAGING SYSTEMS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT
      THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
      BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
      FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR CONFORMANCE TO ANY
      SPECIFICATION OR STANDARD.  Z MEDICAL IMAGING SYSTEMS SHALL NOT BE
      LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING OR
      MODIFYING THIS SOFTWARE OR ITS DERIVATIVES.
     
      =============================================================================
     
      This software package is implemented similarly to the UC Davis public
      domain C++ DICOM implementation which contains the following copyright
      notice:
     
      Copyright (C) 1995, University of California, Davis
     
      THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND THE UNIVERSITY
      OF CALIFORNIA DOES NOT MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
      PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
      USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
      SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
      THE SOFTWARE IS WITH THE USER.
     
      Copyright of the software and supporting documentation is
      owned by the University of California, and free access
      is hereby granted as a license to use this software, copy this
      software and prepare derivative works based upon this software.
      However, any distribution of this software source code or
      supporting documentation or derivative works (source code and
      supporting documentation) must include this copyright notice.
     
      The UC Davis C++ source code is publicly available from the following
      anonymous ftp site:
     
      ftp://imrad.ucdmc.ucdavis.edu/pub/dicom/UCDMC/
     
    Version:
    1.0
    Author:
    Sunita Munjal
    • Field Detail

      • cFindRsp

        public DICOM_CResponse cFindRsp
        CResponse (Find response) object.
      • MSG_ID

        protected int MSG_ID
        The DICOM message ID.
      • cancelFlag

        private boolean cancelFlag
        If true then the DICOM query is cancelled.
      • keepGoing

        private boolean keepGoing
        Boolean that tells the thread whether or not it should keep going.
      • queryType

        private int queryType
        Indicates the type of query (i.e. STUDY, SERIES ...)
    • Constructor Detail

      • DICOM_Query

        public DICOM_Query()
        DICOM_Query constructor.
      • DICOM_Query

        public DICOM_Query​(ViewJFrameDICOMQuery _queryFrame,
                           int _type)
        DICOMQuery constructor.
        Parameters:
        _queryFrame - reference the query frame
        _type - type of query (i.e. STUDY, SERIES ...)
    • Method Detail

      • connectToServer

        public DICOM_PDUService connectToServer​(java.lang.String AETitle)
        Connects to the server with an Application Entity title provided.
        Parameters:
        AETitle - application entity title for remote server
        Returns:
        pdu return instance of PDU_Service class which contains the remote system connect info.
      • getMsgID

        public int getMsgID()
        getMsgID - This returns the msgID for the outgoing C-Move Request.
        Returns:
        msgID uniquely identifies the current C-Move RQ
      • run

        public void run()
        Runs this query in a separate thread. Calls sendQuery.
        Specified by:
        run in interface java.lang.Runnable
      • sendFindCancelRQ

        public void sendFindCancelRQ​(int msgID,
                                     DICOM_PDUService pdu)
        Send a C-CANCEL-FIND-RQ to the Service Class Provider;ie. Image Archive
        Parameters:
        msgID - unique identifier for the current message
        pdu - instance of PDU_Service containing remote connect info.
      • sendQuery

        public void sendQuery​(DICOM_PDUService pdu,
                              DICOM_Object ddo)
        Sends patient root query to remote DICOM Q/R server.
        Parameters:
        pdu - instance of PDU_Service containing remote connect info.
        ddo - patient root query data object
      • setMsgID

        public int setMsgID()
        This sets the unique msgID for the outgoing C-Move Request.
        Returns:
        msgID uniquely identifies the current C-Move RQ
      • setParameters

        public void setParameters​(DICOM_PDUService pdu,
                                  DICOM_Object ddo)
        Sets up the neccessary parameters for sending a query. Must be called before the thread is started.
        Parameters:
        pdu - instance of PDU_Service containing remote connect info.
        ddo - move request identifier
      • setPatientRootQuery

        public void setPatientRootQuery()
        setPatientRootQuery - sets query to Patient Root.
      • setPatientStudyOnlyQuery

        public void setPatientStudyOnlyQuery()
        setPatientStudyOnlyQuery - sets query to Patient Study Only.
      • setQueryImagesData

        public DICOM_Object setQueryImagesData​(java.lang.String patientID,
                                               java.lang.String studyInstUID,
                                               java.lang.String seriesInstUID)
        Sets up the data object (IOD) for a patient root image level C-Find request on key patient ID.
        Parameters:
        patientID - key attribute for image level query
        studyInstUID - key attribute for image level query
        seriesInstUID - key attribute for image level query
        Returns:
        return patient root image level query data object
      • setQueryPatientData

        public DICOM_Object setQueryPatientData​(java.lang.String patientName,
                                                java.lang.String patientID)
        Sets up the data object (IOD) for a patient root patient level C-Find request on key patient name.
        Parameters:
        patientName - a key attribute for query
        patientID - a key attribute for query - can be empty string
        Returns:
        return patient root patient level query data object
      • setQuerySeriesData

        public DICOM_Object setQuerySeriesData​(java.lang.String patientID,
                                               java.lang.String studyInstUID)
        Sets up the data object (IOD) for a patient root series level C-Find request on key patient ID.
        Parameters:
        patientID - key attribute for study level query
        studyInstUID - key attribute for series level query
        Returns:
        return patient root series level query data object
      • setQueryStudyData

        public DICOM_Object setQueryStudyData​(java.lang.String patientID,
                                              java.lang.String studyID)
        Sets up the data object (IOD) for a patient root study level C-Find request on key patient ID.
        Parameters:
        patientID - key attribute for study level query
        studyID - key attribute for study level query/ can be empty string ""
        Returns:
        return patient root study level query data object
      • setQueryStudyData

        public DICOM_Object setQueryStudyData​(java.lang.String patientName,
                                              java.lang.String patientID,
                                              java.lang.String studyID,
                                              java.lang.String studyDate,
                                              java.lang.String referringPhys)
        Sets up the data object (IOD) for a patient root study level C-Find request on key patient ID.
        Parameters:
        patientName - DOCUMENT ME!
        patientID - key attribute for study level query
        studyID - key attribute for study level query/ can be empty string ""
        studyDate - DOCUMENT ME!
        referringPhys - DOCUMENT ME!
        Returns:
        return patient root study level query data object
      • setStop

        public void setStop()
        Tells the thread to stop (does not call thread.stop(): unsafe).
      • setStudyRootQuery

        public void setStudyRootQuery()
        Sets query to Study Root.