DCMTK  Version 3.6.6
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WlmDataSourceFileSystem Class Reference

This class encapsulates data structures and operations for connecting to a file-based data source in the framework of the DICOM basic worklist management service. More...

+ Inheritance diagram for WlmDataSourceFileSystem:

Public Member Functions

 WlmDataSourceFileSystem ()
 default constructor.
 
 ~WlmDataSourceFileSystem ()
 destructor
 
OFCondition ConnectToDataSource ()
 Connects to the data source. More...
 
OFCondition DisconnectFromDataSource ()
 Disconnects from the data source. More...
 
void SetDfPath (const OFString &value)
 Set value in member variable. More...
 
void SetEnableRejectionOfIncompleteWlFiles (OFBool value)
 Set value in member variable. More...
 
OFBool IsCalledApplicationEntityTitleSupported ()
 Checks if the called application entity title is supported. More...
 
void HandleExistentButEmptyDescriptionAndCodeSequenceAttributes (DcmItem *dataset, const DcmTagKey &descriptionTagKey, const DcmTagKey &codeSequenceTagKey)
 This function performs a check on two attributes in the given dataset. More...
 
void HandleExistentButEmptyReferencedStudyOrPatientSequenceAttributes (DcmDataset *dataset, const DcmTagKey &sequenceTagKey)
 This function performs a check on a sequence attribute in the given dataset. More...
 
WlmDataSourceStatusType StartFindRequest (const DcmDataset &findRequestIdentifiers)
 Based on the search mask which was passed, this function determines all the records in the worklist database files which match the values of matching key attributes in the search mask. More...
 
DcmDatasetNextFindResponse (WlmDataSourceStatusType &rStatus)
 This function will return the next dataset that matches the given search mask, if there is one more resulting dataset to return. More...
 
- Public Member Functions inherited from WlmDataSource
 WlmDataSource ()
 default constructor.
 
virtual ~WlmDataSource ()
 destructor
 
void SetCalledApplicationEntityTitle (const OFString &value)
 Set value in member variable. More...
 
void SetFailOnInvalidQuery (OFBool value)
 Set value in member variable. More...
 
void SetNoSequenceExpansion (OFBool value)
 Set value in a member variable. More...
 
void SetReturnedCharacterSet (WlmReturnedCharacterSetType value)
 Set value in member variable. More...
 
WlmDataSourceStatusType CancelFindRequest ()
 This function handles a C-CANCEL Request during the processing of a C-FIND Request. More...
 
DcmAttributeTagGetOffendingElements ()
 Get value from member variable. More...
 
DcmLongStringGetErrorComments ()
 Get value from member variable. More...
 
virtual void SetDbDsn (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetDbUserName (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetDbUserPassword (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetCfgFileMatchRecords (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetCfgFileSelectValues (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetDatabaseType (WlmDatabaseType)
 Set value in a member variable in a derived class.
 
virtual void SetSerialNumber (const int)
 Set value in a member variable in a derived class. More...
 
virtual void SetInstitutionId (const unsigned int)
 Set value in a member variable in a derived class. More...
 
virtual void SetCreateNullvalues (OFBool)
 Set value in a member variable in a derived class.
 
virtual void SetPfFileName (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetModalityToReturn (const OFString &)
 Set value in a member variable in a derived class.
 
virtual void SetCommaSeparatePatientName (OFBool)
 Set value in a member variable in a derived class.
 
virtual void SetReturnPatientUidInAccessionNumber (OFBool)
 Set value in a member variable in a derived class.
 

Protected Member Functions

OFBool SetReadlock ()
 This function sets a read lock on the LOCKFILE in the directory that is specified through dfPath and calledApplicationEntityTitle. More...
 
OFBool ReleaseReadlock ()
 This function releases a read lock on the LOCKFILE in the given directory. More...
 
void HandleNonSequenceElementInResultDataset (DcmElement *element, unsigned long idx)
 This function takes care of handling a certain non-sequence element whithin the structure of a certain result dataset. More...
 
void HandleSequenceElementInResultDataset (DcmElement *element, unsigned long idx)
 This function takes care of handling a certain sequence element within the structure of a certain result dataset. More...
 
 WlmDataSourceFileSystem (const WlmDataSourceFileSystem &Src)
 Protected undefined copy-constructor. More...
 
WlmDataSourceFileSystemoperator= (const WlmDataSourceFileSystem &Src)
 Protected undefined operator=. More...
 
- Protected Member Functions inherited from WlmDataSource
OFBool CheckSearchMask (DcmDataset *searchMask)
 This function checks if the search mask has a correct format. More...
 
void CheckNonSequenceElementInSearchMask (DcmDataset *searchMask, int &invalidMatchingKeyAttributeCount, DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL)
 This function checks if a non-sequence element in the search mask has a correct format. More...
 
void CheckSequenceElementInSearchMask (DcmDataset *searchMask, int &invalidMatchingKeyAttributeCount, DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL)
 This function checks if a sequence element in the search mask has a correct format. More...
 
void ExpandEmptySequenceInSearchMask (DcmElement *&element)
 According to the 2001 DICOM standard (part 4, section C.2.2.2.6), if a search mask contains a sequence attribute which contains no item or a single empty item, all attributes from that particular sequence are in fact queried and shall be returned by the SCP. More...
 
OFBool IsSupportedMatchingKeyAttribute (DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL)
 This function checks if the given element refers to an attribute which is a supported matching key attribute. More...
 
OFBool IsSupportedReturnKeyAttribute (DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL)
 This function checks if the given element refers to an attribute which is a supported return key attribute. More...
 
void ClearDataset (DcmDataset *idents)
 This function removes all elements from the given DcmDataset object. More...
 
void PutOffendingElements (const DcmTagKey &tag)
 This function inserts the tag of an offending element into the corresponding member variable, unless this tag is already con- tained in this variable. More...
 
void PutErrorElements (const DcmTagKey &tag)
 This function inserts the tag of an error element into the corresponding member variable, without checking if it is already contained in this variable. More...
 
OFBool CheckMatchingKey (const DcmElement *elem)
 This function checks if the passed matching key's value only uses characters which are part of its data type's character repertoire. More...
 
OFBool ContainsOnlyValidCharacters (const char *s, const char *charset)
 This function returns OFTrue if all the characters of s can be found in the string charset. More...
 
OFBool GetStringValue (const DcmElement *elem, OFString &resultVal)
 This function returns the value of the given DICOM string element (attribute) in the parameter resultVal and returns OFTrue if successful. More...
 
OFString DeleteLeadingAndTrailingBlanks (const OFString &value)
 This function makes a copy of value without leading and trailing blanks. More...
 
 WlmDataSource (const WlmDataSource &Src)
 Protected undefined copy-constructor. More...
 
WlmDataSourceoperator= (const WlmDataSource &Src)
 Protected undefined operator=. More...
 

Protected Attributes

WlmFileSystemInteractionManager fileSystemInteractionManager
 manager for file system interaction
 
OFString dfPath
 path to database files
 
OFBool enableRejectionOfIncompleteWlFiles
 indicates if wl-files which are lacking return type 1 attributes or information in such attributes shall be rejected or not
 
int handleToReadLockFile
 handle to the read lock file
 
- Protected Attributes inherited from WlmDataSource
OFBool failOnInvalidQuery
 indicates if the application shall fail on an invalid C-Find RQ message
 
OFString callingApplicationEntityTitle
 calling AE Title
 
OFString calledApplicationEntityTitle
 called AE title
 
DcmDatasetidentifiers
 the search mask which is contained in the C-Find RQ message
 
DcmAttributeTagerrorElements
 list of error elements
 
DcmAttributeTagoffendingElements
 list of offending elements
 
DcmLongStringerrorComment
 error comment
 
OFBool foundUnsupportedOptionalKey
 indicates if we encountered an unsupported optional key attribute in the search mask
 
OFBool readLockSetOnDataSource
 indicates if a read lock was set on the data source
 
OFBool noSequenceExpansion
 indicates if the expansion of empty sequence attributes shall take place or not
 
WlmReturnedCharacterSetType returnedCharacterSet
 returned character set type
 
OFList< DcmDataset * > matchingDatasets
 array of matching datasets
 
OFString specificCharacterSet
 potentially specified specific character set (in search mask)
 
WlmSuperiorSequenceInfoTypesuperiorSequenceArray
 information about superior sequence elements; necessary for inserting values into resultDataset
 
unsigned long numOfSuperiorSequences
 number of elements in above array
 

Detailed Description

This class encapsulates data structures and operations for connecting to a file-based data source in the framework of the DICOM basic worklist management service.

Constructor & Destructor Documentation

◆ WlmDataSourceFileSystem()

WlmDataSourceFileSystem::WlmDataSourceFileSystem ( const WlmDataSourceFileSystem Src)
protected

Protected undefined copy-constructor.

Shall never be called.

Parameters
SrcSource object.

Member Function Documentation

◆ ConnectToDataSource()

OFCondition WlmDataSourceFileSystem::ConnectToDataSource ( )
virtual

Connects to the data source.

Returns
Indicates if the connection was established successfully.

Implements WlmDataSource.

◆ DisconnectFromDataSource()

OFCondition WlmDataSourceFileSystem::DisconnectFromDataSource ( )
virtual

Disconnects from the data source.

Returns
Indicates if the disconnection was completed successfully.

Implements WlmDataSource.

◆ HandleExistentButEmptyDescriptionAndCodeSequenceAttributes()

void WlmDataSourceFileSystem::HandleExistentButEmptyDescriptionAndCodeSequenceAttributes ( DcmItem dataset,
const DcmTagKey descriptionTagKey,
const DcmTagKey codeSequenceTagKey 
)

This function performs a check on two attributes in the given dataset.

At two different places in the definition of the DICOM worklist management service, a description attribute and a code sequence attribute with a return type of 1C are mentioned, and the condition specifies that either the description attribute or the code sequence attribute or both shall be supported by an SCP. (I am talking about RequestedProcedureDescription vs. RequestedProcedureCodeSequence and ScheduledProcedureStepDescription vs. ScheduledProtocolCodeSequence.) In both cases, this implementation actually supports both, the description and the code sequence attributes. In cases where the description attribute is actually empty or the code sequence attribute is actually empty or contains exactly one item with an empty CodeValue and an empty CodingSchemeDesignator, we want to remove the empty attribute from the dataset. This is what this function does. (Please note, that this function will always only delete one of the two, and this function will start checking the sequence attribute.

Parameters
datasetDataset in which the consistency of the two attributes shall be checked.
descriptionTagKeyDcmTagKey of the description attribute which shall be checked.
codeSequenceTagKeyDcmTagKey of the codeSequence attribute which shall be checked.

◆ HandleExistentButEmptyReferencedStudyOrPatientSequenceAttributes()

void WlmDataSourceFileSystem::HandleExistentButEmptyReferencedStudyOrPatientSequenceAttributes ( DcmDataset dataset,
const DcmTagKey sequenceTagKey 
)

This function performs a check on a sequence attribute in the given dataset.

At two different places in the definition of the DICOM worklist management service, a sequence attribute with a return type of 2 is mentioned containing two 1C attributes in its item; the condition of the two 1C attributes specifies that in case a sequence item is present, then these two attributes must be existent and must contain a value. (I am talking about ReferencedStudySequence and ReferencedPatientSequence.) In cases where the sequence attribute contains exactly one item with an empty ReferencedSOPClass and an empty ReferencedSOPInstance, we want to remove the item from the sequence. This is what this function does.

Parameters
datasetDataset in which the consistency of the sequence attribute shall be checked.
sequenceTagKeyDcmTagKey of the sequence attribute which shall be checked.

◆ HandleNonSequenceElementInResultDataset()

void WlmDataSourceFileSystem::HandleNonSequenceElementInResultDataset ( DcmElement element,
unsigned long  idx 
)
protected

This function takes care of handling a certain non-sequence element whithin the structure of a certain result dataset.

This function assumes that all elements in the result dataset are supported. In detail, a value for the current element with regard to the currently processed matching record will be requested from the fileSystemInteractionManager, and this value will be set in the element.

Parameters
elementPointer to the currently processed element.
idxIndex of the matching record (identifies this record).

◆ HandleSequenceElementInResultDataset()

void WlmDataSourceFileSystem::HandleSequenceElementInResultDataset ( DcmElement element,
unsigned long  idx 
)
protected

This function takes care of handling a certain sequence element within the structure of a certain result dataset.

On the basis of the matching record from the data source, this function will add items and values for all elements in these items to the current sequence element in the result dataset. This function assumes that all elements in the result dataset are supported. In case the current sequence element contains no items or more than one item, this element will be left unchanged.

Parameters
elementPointer to the currently processed element.
idxIndex of the matching record (identifies this record).

◆ IsCalledApplicationEntityTitleSupported()

OFBool WlmDataSourceFileSystem::IsCalledApplicationEntityTitleSupported ( )
virtual

Checks if the called application entity title is supported.

This function expects that the called application entity title was made available for this instance through WlmDataSource::SetCalledApplicationEntityTitle(). If this is not the case, OFFalse will be returned.

Returns
OFTrue, if the called application entity title is supported; OFFalse, if the called application entity title is not supported or it is not given.

Implements WlmDataSource.

◆ NextFindResponse()

DcmDataset* WlmDataSourceFileSystem::NextFindResponse ( WlmDataSourceStatusType rStatus)
virtual

This function will return the next dataset that matches the given search mask, if there is one more resulting dataset to return.

In such a case, rstatus will be set to WLM_PENDING or WLM_PENDING_WARNING, depending on if an unsupported key attribute was encountered in the search mask or not. If there are no more datasets that match the search mask, this function will return an empty dataset and WLM_SUCCESS in rstatus.

Parameters
rStatusA value of type WlmDataSourceStatusType that can be used to decide if there are still elements that have to be returned.
Returns
The next dataset that matches the given search mask, or an empty dataset if there are no more matching datasets in the worklist database files.

Implements WlmDataSource.

◆ operator=()

WlmDataSourceFileSystem& WlmDataSourceFileSystem::operator= ( const WlmDataSourceFileSystem Src)
protected

Protected undefined operator=.

Shall never be called.

Parameters
SrcSource object.
Returns
Reference to this.

◆ ReleaseReadlock()

OFBool WlmDataSourceFileSystem::ReleaseReadlock ( )
protected

This function releases a read lock on the LOCKFILE in the given directory.

Returns
true in case the read lock has been released successfully, false otherwise.

◆ SetDfPath()

void WlmDataSourceFileSystem::SetDfPath ( const OFString value)
virtual

Set value in member variable.

Parameters
valueThe value to set.

Reimplemented from WlmDataSource.

◆ SetEnableRejectionOfIncompleteWlFiles()

void WlmDataSourceFileSystem::SetEnableRejectionOfIncompleteWlFiles ( OFBool  value)
virtual

Set value in member variable.

Parameters
valueThe value to set.

Reimplemented from WlmDataSource.

◆ SetReadlock()

OFBool WlmDataSourceFileSystem::SetReadlock ( )
protected

This function sets a read lock on the LOCKFILE in the directory that is specified through dfPath and calledApplicationEntityTitle.

Returns
true in case the read lock has been set successfully, false otherwise.

◆ StartFindRequest()

WlmDataSourceStatusType WlmDataSourceFileSystem::StartFindRequest ( const DcmDataset findRequestIdentifiers)
virtual

Based on the search mask which was passed, this function determines all the records in the worklist database files which match the values of matching key attributes in the search mask.

For each matching record, a DcmDataset structure is generated which will later be returned to the SCU as a result of query. The DcmDataset structures for all matching records will be stored in the protected member variable matchingDatasets.

Parameters
findRequestIdentifiersContains the search mask.
Returns
A WlmDataSourceStatusType value denoting the following: WLM_SUCCESS: No matching records found; WLM_PENDING: Matching records found, all return keys supported by this application; WLM_PENDING_WARNING: Matching records found, not all return keys supported by this application; WLM_FAILED_IDENTIFIER_DOES_NOT_MATCH_SOP_CLASS: Error in the search mask encountered.

Implements WlmDataSource.


The documentation for this class was generated from the following file:


Generated on Thu Jan 14 2021 for DCMTK Version 3.6.6 by Doxygen 1.8.18