Package gov.nih.mipav.model.dicomcomm
Class DICOM_Query
- java.lang.Object
-
- gov.nih.mipav.model.dicomcomm.DICOM_SOP
-
- gov.nih.mipav.model.dicomcomm.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 Summary
Fields Modifier and Type Field Description private booleancancelFlagIf true then the DICOM query is cancelled.DICOM_CRequestcFindRqcFind request object.DICOM_CResponsecFindRspCResponse (Find response) object.private DICOM_ObjectddoThe DICOM data object.private booleankeepGoingBoolean that tells the thread whether or not it should keep going.protected intMSG_IDThe DICOM message ID.DICOM_PDUServicepduThe PDU service object.private ViewJFrameDICOMQueryqueryFrameThe GUI frame to starting queries.private intqueryTypeIndicates the type of query (i.e.
-
Constructor Summary
Constructors Constructor Description DICOM_Query()DICOM_Query constructor.DICOM_Query(ViewJFrameDICOMQuery _queryFrame, int _type)DICOMQuery constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DICOM_PDUServiceconnectToServer(java.lang.String AETitle)Connects to the server with an Application Entity title provided.intgetMsgID()getMsgID - This returns the msgID for the outgoing C-Move Request.voidrun()Runs this query in a separate thread.voidsendFindCancelRQ(int msgID, DICOM_PDUService pdu)Send a C-CANCEL-FIND-RQ to the Service Class Provider;ie.voidsendQuery(DICOM_PDUService pdu, DICOM_Object ddo)Sends patient root query to remote DICOM Q/R server.intsetMsgID()This sets the unique msgID for the outgoing C-Move Request.voidsetParameters(DICOM_PDUService pdu, DICOM_Object ddo)Sets up the neccessary parameters for sending a query.voidsetPatientRootQuery()setPatientRootQuery - sets query to Patient Root.voidsetPatientStudyOnlyQuery()setPatientStudyOnlyQuery - sets query to Patient Study Only.DICOM_ObjectsetQueryImagesData(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.DICOM_ObjectsetQueryPatientData(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.DICOM_ObjectsetQuerySeriesData(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.DICOM_ObjectsetQueryStudyData(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.DICOM_ObjectsetQueryStudyData(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.voidsetStop()Tells the thread to stop (does not call thread.stop(): unsafe).voidsetStudyRootQuery()Sets query to Study Root.voidwrite(DICOM_PDUService pdu, DICOM_Object ddo)Writes a query.-
Methods inherited from class gov.nih.mipav.model.dicomcomm.DICOM_SOP
verifySOPClass
-
-
-
-
Field Detail
-
cFindRq
public DICOM_CRequest cFindRq
cFind request object.
-
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.
-
ddo
private DICOM_Object ddo
The DICOM data object.
-
keepGoing
private boolean keepGoing
Boolean that tells the thread whether or not it should keep going.
-
pdu
public DICOM_PDUService pdu
The PDU service object.
-
queryFrame
private ViewJFrameDICOMQuery queryFrame
The GUI frame to starting queries.
-
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:
runin interfacejava.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 messagepdu- 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 querystudyInstUID- key attribute for image level queryseriesInstUID- 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 querypatientID- 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 querystudyInstUID- 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 querystudyID- 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 querystudyID- 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.
-
write
public void write(DICOM_PDUService pdu, DICOM_Object ddo) throws DICOM_Exception
Writes a query.- Parameters:
pdu- instance of PDU_Serviceddo- DOCUMENT ME!- Throws:
DICOM_Exception- anything goes wrong
-
-