OFFIS DCMTK  Version 3.6.0
wlfsim.h
1 /*
2  *
3  * Copyright (C) 1996-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmwlm
15  *
16  * Author: Thomas Wilkens
17  *
18  * Purpose: Class for managing file system interaction.
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:39 $
22  * CVS/RCS Revision: $Revision: 1.18 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef WlmFileSystemInteractionManager_h
30 #define WlmFileSystemInteractionManager_h
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/ofstd/ofstring.h"
34 #include "dcmtk/ofstd/oftypes.h" /* for OFBool */
35 
36 template <class T> class OFOrderedSet;
38 class DcmDataset;
39 class DcmTagKey;
40 class OFConsole;
41 class OFCondition;
42 class DcmItem;
43 
49 {
50  private:
55 
60 
61  protected:
71  unsigned long numOfMatchingRecords;
72 
78  void DetermineWorklistFiles( OFOrderedSet<OFString> &worklistFiles );
79 
85  OFBool IsWorklistFile( const char *fname );
86 
121  OFBool DatasetIsComplete( DcmDataset *dataset );
122 
131 
138  OFBool DescriptionAndCodeSequenceAttributesAreIncomplete( DcmTagKey descriptionTagKey, DcmTagKey codeSequenceTagKey, DcmItem *dset );
139 
145  OFBool AttributeIsAbsentOrEmpty( DcmTagKey elemTagKey, DcmItem *dset );
146 
153  OFBool DatasetMatchesSearchMask( DcmDataset *dataset, DcmDataset *searchMask );
154 
160  void DetermineMatchingKeyAttributeValues( DcmDataset *dataset, const char **&matchingKeyAttrValues );
161 
168  OFBool ScheduledStationAETitlesMatch( const char *datasetValue, const char *searchMaskValue );
169 
179  OFBool ScheduledProcedureStepStartDateTimesMatch( const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue );
180 
187  OFBool ModalitiesMatch( const char *datasetValue, const char *searchMaskValue );
188 
195  OFBool ScheduledPerformingPhysicianNamesMatch( const char *datasetValue, const char *searchMaskValue );
196 
203  OFBool PatientsNamesMatch( const char *datasetValue, const char *searchMaskValue );
204 
211  OFBool PatientsIDsMatch( const char *datasetValue, const char *searchMaskValue );
212 
219  OFBool AccessionNumbersMatch( const char *datasetValue, const char *searchMaskValue );
220 
227  OFBool RequestedProcedureIdsMatch( const char *datasetValue, const char *searchMaskValue );
228 
235  OFBool ReferringPhysicianNamesMatch( const char *datasetValue, const char *searchMaskValue );
236 
243  OFBool PatientsSexesMatch( const char *datasetValue, const char *searchMaskValue );
244 
251  OFBool RequestingPhysiciansMatch( const char *datasetValue, const char *searchMaskValue );
252 
259  OFBool AdmissionIdsMatch( const char *datasetValue, const char *searchMaskValue );
260 
267  OFBool RequestedProcedurePrioritiesMatch( const char *datasetValue, const char *searchMaskValue );
268 
275  OFBool PatientsBirthDatesMatch( const char *datasetValue, const char *searchMaskValue );
276 
286  OFBool DateTimeRangeMatch( const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue );
287 
295  OFBool DateRangeMatch( const char *datasetDateValue, const char *searchMaskDateValue );
296 
304  OFBool TimeRangeMatch( const char *datasetTimeValue, const char *searchMaskTimeValue );
305 
315  OFBool DateTimeSingleValueMatch( const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue );
316 
324  OFBool DateSingleValueMatch( const char *datasetDateValue, const char *searchMaskDateValue );
325 
333  OFBool TimeSingleValueMatch( const char *datasetTimeValue, const char *searchMaskTimeValue );
334 
342  OFBool CaseSensitiveSingleValueMatch( const char *datasetValue, const char *searchMaskValue );
343 
350  OFBool WildcardMatch( const char *datasetValue, const char *searchMaskValue );
351 
361  OFBool MatchStarSymbol( const char *dv, const char *sv );
362 
371  void ExtractValuesFromRange( const char *range, char *&lower, char *&upper );
372 
373  public:
377 
381 
385  void SetEnableRejectionOfIncompleteWlFiles( OFBool value );
386 
391  OFCondition ConnectToFileSystem( const OFString& dfPathv );
392 
397 
405  OFBool IsCalledApplicationEntityTitleSupported( const OFString& calledApplicationEntityTitlev );
406 
414  unsigned long DetermineMatchingRecords( DcmDataset *searchMask );
415 
431  unsigned long GetNumberOfSequenceItemsForMatchingRecord( DcmTagKey sequenceTag, WlmSuperiorSequenceInfoType *superiorSequenceArray, unsigned long numOfSuperiorSequences, unsigned long idx );
432 
443  void GetAttributeValueForMatchingRecord( DcmTagKey tag, WlmSuperiorSequenceInfoType *superiorSequenceArray, unsigned long numOfSuperiorSequences, unsigned long idx, char *&value );
444 
448  void ClearMatchingRecords();
449 };
450 
451 #endif
452 
453 /*
454 ** CVS Log
455 ** $Log: wlfsim.h,v $
456 ** Revision 1.18 2010-10-14 13:16:39 joergr
457 ** Updated copyright header. Added reference to COPYRIGHT file.
458 **
459 ** Revision 1.17 2010-08-09 13:29:39 joergr
460 ** Updated data dictionary to 2009 edition of the DICOM standard. From now on,
461 ** the official "keyword" is used for the attribute name which results in a
462 ** number of minor changes (e.g. "PatientsName" is now called "PatientName").
463 **
464 ** Revision 1.16 2009-11-24 10:40:01 uli
465 ** Switched to logging mechanism provided by the "new" oflog module.
466 **
467 ** Revision 1.15 2009-11-02 15:50:25 joergr
468 ** Changed forward declaration from "class" to "struct" in order to avoid
469 ** warning messages reported by VisualStudio 2008.
470 **
471 ** Revision 1.14 2009-09-30 08:40:34 uli
472 ** Make dcmwlm's include headers self-sufficient by including all
473 ** needed headers directly.
474 **
475 ** Revision 1.13 2006-12-15 14:49:21 onken
476 ** Removed excessive use char* and C-array in favour of OFString and
477 ** OFList. Simplified some implementation details.
478 **
479 ** Revision 1.12 2006/01/27 15:06:32 joergr
480 ** Fixed issue with missing type 2 attributes in worklist files being reported
481 ** as incomplete. Now, the attributes are inserted automatically if required.
482 ** Removed email address from CVS log.
483 **
484 ** Revision 1.11 2005/12/08 16:05:42 meichel
485 ** Changed include path schema for all DCMTK header files
486 **
487 ** Revision 1.10 2005/09/23 12:56:40 wilkens
488 ** Added attribute PatientsBirthDate as a matching key attribute to wlmscpfs.
489 **
490 ** Revision 1.9 2005/06/16 08:06:51 meichel
491 ** Removed redundant class name, needed for gcc 3.4
492 **
493 ** Revision 1.8 2005/05/04 11:34:31 wilkens
494 ** Added two command line options --enable-file-reject (default) and
495 ** --disable-file-reject to wlmscpfs: these options can be used to enable or
496 ** disable a file rejection mechanism which makes sure only complete worklist files
497 ** will be used during the matching process. A worklist file is considered to be
498 ** complete if it contains all necessary type 1 information which the SCP might
499 ** have to return to an SCU in a C-Find response message.
500 **
501 ** Revision 1.7 2004/01/07 08:32:28 wilkens
502 ** Added new sequence type return key attributes to wlmscpfs. Fixed bug that for
503 ** equally named attributes in sequences always the same value will be returned.
504 ** Added functionality that also more than one item will be returned in sequence
505 ** type return key attributes.
506 **
507 ** Revision 1.6 2003/12/23 13:04:36 wilkens
508 ** Integrated new matching key attributes into wlmscpfs.
509 **
510 ** Revision 1.5 2003/07/02 09:17:55 wilkens
511 ** Updated documentation to get rid of doxygen warnings.
512 **
513 ** Revision 1.4 2002/12/16 11:08:35 wilkens
514 ** Added missing #include "osconfig.h" to certain files.
515 **
516 ** Revision 1.3 2002/12/09 13:41:43 joergr
517 ** Renamed parameter to avoid name clash with global function index().
518 ** Added private undefined copy constructor and/or assignment operator.
519 **
520 ** Revision 1.2 2002/08/12 10:56:08 wilkens
521 ** Made some modifications in in order to be able to create a new application
522 ** which contains both wlmscpdb and ppsscpdb and another application which
523 ** contains both wlmscpfs and ppsscpfs.
524 **
525 ** Revision 1.1 2002/08/05 09:09:58 wilkens
526 ** Modfified the project's structure in order to be able to create a new
527 ** application which contains both wlmscpdb and ppsscpdb.
528 **
529 ** Revision 1.1 2002/07/17 13:10:21 wilkens
530 ** Corrected some minor logical errors in the wlmscpdb sources and completely
531 ** updated the wlmscpfs so that it does not use the original wlistctn sources
532 ** any more but standard wlm sources which are now used by all three variants
533 ** of wlmscps.
534 **
535 **
536 */
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
class maintaining a attribute tag (group and element number)
Definition: dctagkey.h:46
OFBool DateSingleValueMatch(const char *datasetDateValue, const char *searchMaskDateValue)
This function performs a date single value match and returns OFTrue if the dataset's and the search m...
OFCondition ConnectToFileSystem(const OFString &dfPathv)
Connects to the worklist file system database.
OFBool PatientsIDsMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute patient id ma...
OFBool TimeSingleValueMatch(const char *datasetTimeValue, const char *searchMaskTimeValue)
This function performs a time single value match and returns OFTrue if the dataset's and the search m...
OFBool MatchStarSymbol(const char *dv, const char *sv)
This function is called, if the search pattern contains a star symbol.
OFBool DateRangeMatch(const char *datasetDateValue, const char *searchMaskDateValue)
This function performs a date range match and returns OFTrue if the dataset's and the search mask's v...
void ExtractValuesFromRange(const char *range, char *&lower, char *&upper)
This function extracts the actual lower and upper date or time values from a given date or time range...
OFBool PatientsSexesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute patient sex m...
OFString dfPath
path to database files
Definition: wlfsim.h:63
DcmDataset ** matchingRecords
array of matching records
Definition: wlfsim.h:69
OFBool PatientsBirthDatesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute patient's bir...
OFBool DateTimeRangeMatch(const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue)
This function performs a date time range match and returns OFTrue if the dataset's and the search mas...
OFBool ScheduledPerformingPhysicianNamesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute scheduled per...
This template class provides a data structure and operations for administrating an ordered set of ele...
Definition: wlfsim.h:36
OFBool IsCalledApplicationEntityTitleSupported(const OFString &calledApplicationEntityTitlev)
Checks if the given called application entity title is supported.
OFBool AttributeIsAbsentOrEmpty(DcmTagKey elemTagKey, DcmItem *dset)
This function checks if the specified attribute is absent or contains an empty value in the given dat...
OFBool DatasetMatchesSearchMask(DcmDataset *dataset, DcmDataset *searchMask)
This function returns OFTrue, if the matching key attribute values in the dataset match the matching ...
void SetEnableRejectionOfIncompleteWlFiles(OFBool value)
Set value in member variable.
unsigned long numOfMatchingRecords
number of array fields
Definition: wlfsim.h:71
OFBool RequestedProcedurePrioritiesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute requested pro...
void ClearMatchingRecords()
This function frees the memory which was occupied by matchingRecords.
OFString calledApplicationEntityTitle
called AE title
Definition: wlfsim.h:67
OFBool PatientsNamesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute patient's nam...
OFBool DateTimeSingleValueMatch(const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue)
This function performs a date time single value match and returns OFTrue if the dataset's and the sea...
OFBool CaseSensitiveSingleValueMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values match while performing a c...
OFBool ReferringPhysicianNamesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute referring phy...
OFBool RequestingPhysiciansMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute requesting ph...
OFCondition DisconnectFromFileSystem()
Disconnects from the worklist file system database.
This class encapsulates data structures and operations for managing data base interaction in the fram...
Definition: wlfsim.h:48
unsigned long DetermineMatchingRecords(DcmDataset *searchMask)
This function determines the records from the worklist files which match the given search mask and re...
OFBool enableRejectionOfIncompleteWlFiles
indicates if wl-files which are lacking return type 1 attributes or information in such attributes sh...
Definition: wlfsim.h:65
OFBool ScheduledStationAETitlesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute scheduled sta...
OFBool ModalitiesMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute modality matc...
OFBool DescriptionAndCodeSequenceAttributesAreIncomplete(DcmTagKey descriptionTagKey, DcmTagKey codeSequenceTagKey, DcmItem *dset)
This function checks if the specified description and code sequence attribute are both incomplete in ...
unsigned long GetNumberOfSequenceItemsForMatchingRecord(DcmTagKey sequenceTag, WlmSuperiorSequenceInfoType *superiorSequenceArray, unsigned long numOfSuperiorSequences, unsigned long idx)
For the matching record that is identified through idx, this function returns the number of items tha...
WlmFileSystemInteractionManager & operator=(const WlmFileSystemInteractionManager &obj)
Privately defined assignment operator.
void DetermineMatchingKeyAttributeValues(DcmDataset *dataset, const char **&matchingKeyAttrValues)
This function determines the values of the matching key attributes in the given dataset.
OFBool ReferencedStudyOrPatientSequenceIsAbsentOrExistentButNonEmptyAndIncomplete(DcmTagKey sequenceTagKey, DcmItem *dset)
This function checks if the specified sequence attribute is absent or existent but non-empty and inco...
OFBool IsWorklistFile(const char *fname)
This function returns OFTrue if the given filename refers to a worklist file, i.e.
a class handling the DICOM dataset format (files without meta header)
Definition: dcdatset.h:46
structure for handling arbitrary types of superior sequences in query result datasets ...
Definition: wltypdef.h:128
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
OFBool ScheduledProcedureStepStartDateTimesMatch(const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue)
This function returns OFTrue if the dataset's and the search mask's values in attributes scheduled pr...
OFBool AdmissionIdsMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute admission id ...
~WlmFileSystemInteractionManager()
destructor
WlmFileSystemInteractionManager()
default constructor.
Singleton class which provides thread-safe access to the standard console output and error streams...
Definition: ofconsol.h:79
void DetermineWorklistFiles(OFOrderedSet< OFString > &worklistFiles)
This function determines all worklist files in the directory specified by dfPath and calledApplicatio...
OFBool AccessionNumbersMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute accession num...
OFBool WildcardMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values match while performing a w...
OFBool TimeRangeMatch(const char *datasetTimeValue, const char *searchMaskTimeValue)
This function performs a time range match and returns OFTrue if the dataset's and the search mask's v...
OFBool DatasetIsComplete(DcmDataset *dataset)
This function checks if the given dataset (which represents the information from a worklist file) con...
OFBool RequestedProcedureIdsMatch(const char *datasetValue, const char *searchMaskValue)
This function returns OFTrue if the dataset's and the search mask's values in attribute requested pro...
void GetAttributeValueForMatchingRecord(DcmTagKey tag, WlmSuperiorSequenceInfoType *superiorSequenceArray, unsigned long numOfSuperiorSequences, unsigned long idx, char *&value)
This function determines an attribute value of a matching record and returns this value in a newly cr...
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Jan 4 2017 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.6