32 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/dcmdata/dctk.h"
35 #include "dcmtk/dcmnet/dcompat.h"
36 #include "dcmtk/dcmnet/dimse.h"
37 #include "dcmtk/dcmnet/dcasccff.h"
38 #include "dcmtk/dcmnet/dcasccfg.h"
47 enum DcmCloseAssociationType
50 DCMSCU_RELEASE_ASSOCIATION,
52 DCMSCU_ABORT_ASSOCIATION,
54 DCMSCU_PEER_REQUESTED_RELEASE,
56 DCMSCU_PEER_ABORTED_ASSOCIATION
95 Uint32 numResults()
const;
195 Uint16 &rspStatusCode);
225 OFBool &waitForNextResponse);
251 const Uint16 actionTypeID,
253 Uint16 &rspStatusCode);
267 const int timeout = 0);
413 DIMSE_ProgressCallback callback,
414 void *callbackContext,
429 E_TransferSyntax &transferSyntax);
463 const Uint32 timeout = 0);
480 DIMSE_ProgressCallback callback,
481 void *callbackContext);
const OFString & getPeerHostName() const
Returns the SCP's (peer's) host name configured.
T_DIMSE_BlockingMode getDIMSEBlockingMode() const
Returns whether DIMSE messaging is configured to be blocking or unblocking.
virtual OFCondition sendECHORequest(const T_ASC_PresentationContextID presID)
This function sends a C-ECHO command via network to another DICOM application.
OFString m_assocConfigFilename
Configuration file for presentation contexts (optional)
Uint16 m_messageIDRespondedTo
Mandatory response field.
OFCondition receiveDIMSECommand(T_ASC_PresentationContextID *presID, T_DIMSE_Message *msg, DcmDataset **statusDetail, DcmDataset **commandSet=NULL, const Uint32 timeout=0)
Receive DIMSE command (excluding dataset!) over the currently open association.
Uint32 getMaxReceivePDULength() const
Returns maximum PDU length configured to be received by SCU.
virtual OFCondition sendCANCELRequest(Uint16 presContextID)
Send C-FIND-CANCEL and, therefore, ends the C-FIND session, i.e. no further responses will be handled...
virtual void closeAssociation(const DcmCloseAssociationType closeType)
Closes the association created by this SCU.
void setPeerPort(const Uint16 peerPort)
Set SCP's port number to connect to for association negotiation.
OFList< OFString > transferSyntaxes
List of Transfer Syntaxes for Presentation Context.
Uint16 m_status
Mandatory Response Field.
T_ASC_Network * m_net
The DICOM network the association is based on.
virtual ~FINDResponse()
Destructor, cleans up internal memory (datasets if present)
OFCondition getDatasetInfo(DcmDataset *dataset, OFString &sopClassUID, OFString &sopInstanceUID, E_TransferSyntax &transferSyntax)
Returns SOP Class UID, SOP Instance UID and original transfer syntax for a given dataset.
const OFString & getAETitle() const
Returns the SCU's own configured AETitle.
DcmSCU & operator=(const DcmSCU &src)
Private undefined operator=.
void setMaxReceivePDULength(const unsigned long maxRecPDU)
Set maximum PDU length (to be received by SCU)
Class representing a bunch of FINDResponses from a single C-FIND session.
T_ASC_Association * m_assoc
Associaton of this SCU. This class only handles 1 association at a time.
T_DIMSE_Message * m_openDIMSERequest
The last DIMSE successfully sent, unresponded DIMSE request.
OFBool getVerbosePCMode() const
Returns the verbose presentation context mode configured specifying whether details on the presentati...
void setDIMSEBlockingMode(const T_DIMSE_BlockingMode blockingMode)
Set whether to send in DIMSE blocking or non-blocking mode.
T_ASC_PresentationContextID findPresentationContextID(const OFString &abstractSyntax, const OFString &transferSyntax)
After negotiation association, this call returns the first usable presentation context given the desi...
DcmDataset * m_dataset
Conditional response field (NULL if absent)
virtual Uint16 checkEVENTREPORTRequest(T_DIMSE_N_EventReportRQ &request, DcmDataset *reqDataset)
Check given N-EVENT-REPORT request and dataset for validity.
void findPresentationContext(const T_ASC_PresentationContextID presID, OFString &abstractSyntax, OFString &transferSyntax)
After negotiation association, this call returns the presentation context belonging to the given pres...
void setAETitle(const OFString &myAETtitle)
Set SCU's AETitle to be used in association negotiation.
factory class which creates transport layer connections.
void setVerbosePCMode(const OFBool mode)
Set whether to show presentation contexts in verbose or debug mode.
void setPeerAETitle(const OFString &peerAETitle)
Set SCP's AETitle to talk to in association negotiation.
Uint32 getACSETimeout() const
Returns the timeout configured defining how long SCU will wait for messages during ACSE messaging (as...
OFString m_peerAETitle
AEtitle of remote application.
OFString m_ourAETitle
AEtitle of this application.
OFString m_assocConfigFile
Configuration file containing association parameters.
virtual OFCondition handleEVENTREPORTRequest(DcmDataset *&reqDataset, Uint16 &eventTypeID, const int timeout=0)
Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding respons...
void setDIMSETimeout(const Uint32 dimseTimeout)
Set timeout for receiving DIMSE messages.
T_DIMSE_BlockingMode m_blockMode
DIMSE blocking mode.
Uint16 getPeerPort() const
Returns the SCP's (peer's) TCP/IP port configured.
Uint32 m_acseTimeout
ACSE timeout.
OFBool getTLSEnabled() const
Returns whether SCU is configured to create a TLS connection with the SCP.
virtual ~DcmSCU()
Virtual destructor.
OFBool isConnected() const
Get current connection status.
FINDResponse()
Standard constructor.
OFList< DcmSCUPresContext > m_presContexts
List of presentation contexts that should be negotiated.
virtual OFCondition sendFINDRequest(T_ASC_PresentationContextID presID, DcmDataset *queryKeys, FINDResponses *responses)
Sends a C-FIND Request on given presentation context and receives list of responses.
Class representing a single C-FIND response.
OFCondition sendDIMSEMessage(const T_ASC_PresentationContextID presID, T_DIMSE_Message *msg, DcmDataset *dataObject, DIMSE_ProgressCallback callback, void *callbackContext, DcmDataset **commandSet=NULL)
Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM app...
Uint16 nextMessageID()
Returns next available message ID free to be used by SCU.
void setAssocConfigFileAndProfile(const OFString &filename, const OFString &profile)
Set an association configuration file and profile to be used.
virtual OFCondition sendACTIONRequest(const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 actionTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode)
This function sends a N-ACTION request on the currently opened association and receives the correspon...
virtual OFCondition negotiateAssociation()
Negotiate association by using presentation contexts and parameters as defined by earlier function ca...
OFString m_peer
Peer hostname.
OFCondition addPresentationContext(const OFString &abstractSyntax, const OFList< OFString > &xferSyntaxes)
Add presentation context to be used for association negotiation.
Defines presentation context, consisting of one abstract syntax name and a list of transfer syntaxes ...
a class handling the DICOM dataset format (files without meta header)
DcmSCU()
Constructor, just initializes internal class members.
const OFString & getPeerAETitle() const
Returns the SCP's (peer's) AETitle configured.
Uint16 m_peerPort
Port of remote application entity.
virtual OFCondition handleFINDResponse(Uint16 presContextID, FINDResponse *response, OFBool &waitForNextResponse)
This is the standard handler for C-FIND message responses: It just adds up all responses it receives ...
virtual OFCondition sendSTORERequest(const T_ASC_PresentationContextID presID, const OFString &dicomFile, DcmDataset *dset, DcmDataset *&rspCommandSet, DcmDataset *&rspStatusDetail, Uint16 &rspStatusCode)
This function sends a C-STORE request on the currently opened association and receives the correspond...
virtual OFCondition initNetwork()
Initialize network, i.e. prepare for association negotiation.
Base class for implementing DICOM Service Class User functionality.
a simple string class that implements a subset of std::string.
OFCondition receiveDIMSEDataset(T_ASC_PresentationContextID *presID, DcmDataset **dataObject, DIMSE_ProgressCallback callback, void *callbackContext)
Receives one dataset (of instance data) via network from another DICOM application.
T_ASC_Parameters * m_params
Association parameters.
void setACSETimeout(const Uint32 acseTimeout)
Set timeout for receiving ACSE messages.
OFBool m_verbosePCMode
Verbose PC mode.
Uint32 m_dimseTimeout
DIMSE timeout.
Uint32 getDIMSETimeout() const
Returns the DIMSE timeout configured defining how long SCU will wait for DIMSE responses.
OFString abstractSyntaxName
Abstract Syntax Name of Presentation Context.
OFCondition useSecureConnection(DcmTransportLayer *tlayer)
Tells DcmSCU to use a secure TLS connection described by the given TLS layer.
General purpose class for condition codes.
void setPeerHostName(const OFString &peerHostName)
Set SCP's host (hostname or IP address) to talk to in association negotiation.
OFString m_assocConfigProfile
Profile in configuration file that should be used (optional)
Uint32 m_maxReceivePDULength
Maximum PDU size.