wlfsim.h

00001 /*
00002 *
00003 *  Copyright (C) 1996-2005, OFFIS
00004 *
00005 *  This software and supporting documentation were developed by
00006 *
00007 *    Kuratorium OFFIS e.V.
00008 *    Healthcare Information and Communication Systems
00009 *    Escherweg 2
00010 *    D-26121 Oldenburg, Germany
00011 *
00012 *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013 *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014 *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015 *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016 *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017 *
00018 *  Module:  dcmwlm
00019 *
00020 *  Author:  Thomas Wilkens
00021 *
00022 *  Purpose: Class for managing file system interaction.
00023 *
00024 *  Last Update:      $Author: meichel $
00025 *  Update Date:      $Date: 2005/12/08 16:05:42 $
00026 *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmwlm/include/dcmtk/dcmwlm/wlfsim.h,v $
00027 *  CVS/RCS Revision: $Revision: 1.11 $
00028 *  Status:           $State: Exp $
00029 *
00030 *  CVS/RCS Log at end of file
00031 *
00032 */
00033 
00034 #ifndef WlmFileSystemInteractionManager_h
00035 #define WlmFileSystemInteractionManager_h
00036 
00037 #include "dcmtk/config/osconfig.h"
00038 
00039 template <class T> class OFOrderedSet;
00040 class DcmTagKey;
00041 class OFConsole;
00042 class OFCondition;
00043 
00048 class WlmFileSystemInteractionManager
00049 {
00050   private:
00054     WlmFileSystemInteractionManager(const WlmFileSystemInteractionManager &old);
00055 
00059     WlmFileSystemInteractionManager &operator=(const WlmFileSystemInteractionManager &obj);
00060 
00061   protected:
00063     OFBool verboseMode;
00065     OFBool debugMode;
00067     OFConsole *logStream;
00069     char *dfPath;
00071     OFBool enableRejectionOfIncompleteWlFiles;
00073     char *calledApplicationEntityTitle;
00075     DcmDataset **matchingRecords;
00077     unsigned long numOfMatchingRecords;
00078 
00083     void DumpMessage( const char *message );
00084 
00090     void DetermineWorklistFiles( OFOrderedSet<OFString> &worklistFiles );
00091 
00097     OFBool IsWorklistFile( const char *fname );
00098 
00133     OFBool DatasetIsComplete( DcmDataset *dataset );
00134 
00141     OFBool ReferencedStudyOrPatientSequenceIsAbsentOrExistentButNonEmptyAndIncomplete( DcmTagKey sequenceTagKey, DcmItem *dset );
00142 
00149     OFBool DescriptionAndCodeSequenceAttributesAreIncomplete( DcmTagKey descriptionTagKey, DcmTagKey codeSequenceTagKey, DcmItem *dset );
00150 
00156     OFBool AttributeIsAbsentOrEmpty( DcmTagKey elemTagKey, DcmItem *dset );
00157 
00164     OFBool DatasetMatchesSearchMask( DcmDataset *dataset, DcmDataset *searchMask );
00165 
00171     void DetermineMatchingKeyAttributeValues( DcmDataset *dataset, const char **&matchingKeyAttrValues );
00172 
00179     OFBool ScheduledStationAETitlesMatch( const char *datasetValue, const char *searchMaskValue );
00180 
00190     OFBool ScheduledProcedureStepStartDateTimesMatch( const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue );
00191 
00198     OFBool ModalitiesMatch( const char *datasetValue, const char *searchMaskValue );
00199 
00206     OFBool ScheduledPerformingPhysiciansNamesMatch( const char *datasetValue, const char *searchMaskValue );
00207 
00214     OFBool PatientsNamesMatch( const char *datasetValue, const char *searchMaskValue );
00215 
00222     OFBool PatientIdsMatch( const char *datasetValue, const char *searchMaskValue );
00223 
00230     OFBool AccessionNumbersMatch( const char *datasetValue, const char *searchMaskValue );
00231 
00238     OFBool RequestedProcedureIdsMatch( const char *datasetValue, const char *searchMaskValue );
00239 
00246     OFBool ReferringPhysiciansNamesMatch( const char *datasetValue, const char *searchMaskValue );
00247 
00254     OFBool PatientsSexesMatch( const char *datasetValue, const char *searchMaskValue );
00255 
00262     OFBool RequestingPhysiciansMatch( const char *datasetValue, const char *searchMaskValue );
00263 
00270     OFBool AdmissionIdsMatch( const char *datasetValue, const char *searchMaskValue );
00271 
00278     OFBool RequestedProcedurePrioritiesMatch( const char *datasetValue, const char *searchMaskValue );
00279 
00286     OFBool PatientsBirthDatesMatch( const char *datasetValue, const char *searchMaskValue );
00287 
00297     OFBool DateTimeRangeMatch( const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue );
00298 
00306     OFBool DateRangeMatch( const char *datasetDateValue, const char *searchMaskDateValue );
00307 
00315     OFBool TimeRangeMatch( const char *datasetTimeValue, const char *searchMaskTimeValue );
00316 
00326     OFBool DateTimeSingleValueMatch( const char *datasetDateValue, const char *datasetTimeValue, const char *searchMaskDateValue, const char *searchMaskTimeValue );
00327 
00335     OFBool DateSingleValueMatch( const char *datasetDateValue, const char *searchMaskDateValue );
00336 
00344     OFBool TimeSingleValueMatch( const char *datasetTimeValue, const char *searchMaskTimeValue );
00345 
00353     OFBool CaseSensitiveSingleValueMatch( const char *datasetValue, const char *searchMaskValue );
00354 
00361     OFBool WildcardMatch( const char *datasetValue, const char *searchMaskValue );
00362 
00372     OFBool MatchStarSymbol( const char *dv, const char *sv );
00373 
00382     void ExtractValuesFromRange( const char *range, char *&lower, char *&upper );
00383 
00384   public:
00387     WlmFileSystemInteractionManager();
00388 
00391     ~WlmFileSystemInteractionManager();
00392 
00396     void SetLogStream( OFConsole *value );
00397 
00401     void SetVerbose( OFBool value );
00402 
00406     void SetDebug( OFBool value );
00407 
00411     void SetEnableRejectionOfIncompleteWlFiles( OFBool value );
00412 
00417     OFCondition ConnectToFileSystem( char *dfPathv );
00418 
00422     OFCondition DisconnectFromFileSystem();
00423 
00431     OFBool IsCalledApplicationEntityTitleSupported( char *calledApplicationEntityTitlev );
00432 
00440     unsigned long DetermineMatchingRecords( DcmDataset *searchMask );
00441 
00457     unsigned long GetNumberOfSequenceItemsForMatchingRecord( DcmTagKey sequenceTag, WlmSuperiorSequenceInfoType *superiorSequenceArray, unsigned long numOfSuperiorSequences, unsigned long idx );
00458 
00469     void GetAttributeValueForMatchingRecord( DcmTagKey tag, WlmSuperiorSequenceInfoType *superiorSequenceArray, unsigned long numOfSuperiorSequences, unsigned long idx, char *&value );
00470 
00474     void ClearMatchingRecords();
00475 };
00476 
00477 #endif
00478 
00479 /*
00480 ** CVS Log
00481 ** $Log: wlfsim.h,v $
00482 ** Revision 1.11  2005/12/08 16:05:42  meichel
00483 ** Changed include path schema for all DCMTK header files
00484 **
00485 ** Revision 1.10  2005/09/23 12:56:40  wilkens
00486 ** Added attribute PatientsBirthDate as a matching key attribute to wlmscpfs.
00487 ** Thanks to Andre M. Descombes <andre@descombes.info> for the code template.
00488 **
00489 ** Revision 1.9  2005/06/16 08:06:51  meichel
00490 ** Removed redundant class name, needed for gcc 3.4
00491 **
00492 ** Revision 1.8  2005/05/04 11:34:31  wilkens
00493 ** Added two command line options --enable-file-reject (default) and
00494 ** --disable-file-reject to wlmscpfs: these options can be used to enable or
00495 ** disable a file rejection mechanism which makes sure only complete worklist files
00496 ** will be used during the matching process. A worklist file is considered to be
00497 ** complete if it contains all necessary type 1 information which the SCP might
00498 ** have to return to an SCU in a C-Find response message.
00499 **
00500 ** Revision 1.7  2004/01/07 08:32:28  wilkens
00501 ** Added new sequence type return key attributes to wlmscpfs. Fixed bug that for
00502 ** equally named attributes in sequences always the same value will be returned.
00503 ** Added functionality that also more than one item will be returned in sequence
00504 ** type return key attributes.
00505 **
00506 ** Revision 1.6  2003/12/23 13:04:36  wilkens
00507 ** Integrated new matching key attributes into wlmscpfs.
00508 **
00509 ** Revision 1.5  2003/07/02 09:17:55  wilkens
00510 ** Updated documentation to get rid of doxygen warnings.
00511 **
00512 ** Revision 1.4  2002/12/16 11:08:35  wilkens
00513 ** Added missing #include "osconfig.h" to certain files.
00514 **
00515 ** Revision 1.3  2002/12/09 13:41:43  joergr
00516 ** Renamed parameter to avoid name clash with global function index().
00517 ** Added private undefined copy constructor and/or assignment operator.
00518 **
00519 ** Revision 1.2  2002/08/12 10:56:08  wilkens
00520 ** Made some modifications in in order to be able to create a new application
00521 ** which contains both wlmscpdb and ppsscpdb and another application which
00522 ** contains both wlmscpfs and ppsscpfs.
00523 **
00524 ** Revision 1.1  2002/08/05 09:09:58  wilkens
00525 ** Modfified the project's structure in order to be able to create a new
00526 ** application which contains both wlmscpdb and ppsscpdb.
00527 **
00528 ** Revision 1.1  2002/07/17 13:10:21  wilkens
00529 ** Corrected some minor logical errors in the wlmscpdb sources and completely
00530 ** updated the wlmscpfs so that it does not use the original wlistctn sources
00531 ** any more but standard wlm sources which are now used by all three variants
00532 ** of wlmscps.
00533 **
00534 **
00535 **
00536 */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5