Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

wlds.h

00001 /*
00002  *
00003  *  Copyright (C) 1996-2004, 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: (Partially) abstract class for connecting to an arbitrary data source.
00023  *
00024  *  Last Update:      $Author: joergr $
00025  *  Update Date:      $Date: 2004/04/06 18:19:28 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmwlm/include/wlds.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.20 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef WlmDataSource_h
00035 #define WlmDataSource_h
00036 
00037 #include "osconfig.h"
00038 
00039 class DcmDataset;
00040 class DcmList;
00041 class DcmAttributeTag;
00042 class DcmLongString;
00043 class DcmTagKey;
00044 class DcmElement;
00045 class OFConsole;
00046 class OFCondition;
00047 class DcmSequenceOfItems;
00048 
00052 class WlmDataSource
00053 {
00054   protected:
00056     OFBool failOnInvalidQuery;
00058     char *calledApplicationEntityTitle;
00060     OFBool verbose;
00062     OFBool debug;
00064     DcmDataset *identifiers;
00066     DcmAttributeTag *errorElements;
00068     DcmAttributeTag *offendingElements;
00070     DcmLongString *errorComment;
00072     OFBool foundUnsupportedOptionalKey;
00074     OFBool readLockSetOnDataSource;
00076     OFConsole *logStream;
00078     OFBool noSequenceExpansion;
00080     WlmReturnedCharacterSetType returnedCharacterSet;
00082     DcmDataset **matchingDatasets;
00084     unsigned long numOfMatchingDatasets;
00086     OFString specificCharacterSet;
00088     WlmSuperiorSequenceInfoType *superiorSequenceArray;
00090     unsigned long numOfSuperiorSequences;
00091 
00097     OFBool CheckSearchMask( DcmDataset *searchMask );
00098 
00108     void CheckNonSequenceElementInSearchMask( DcmDataset *searchMask, int &invalidMatchingKeyAttributeCount, DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
00109 
00121     void CheckSequenceElementInSearchMask( DcmDataset *searchMask, int &invalidMatchingKeyAttributeCount, DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
00122 
00131     void ExpandEmptySequenceInSearchMask( DcmElement *&element );
00132 
00157     OFBool IsSupportedMatchingKeyAttribute( DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
00158 
00252     OFBool IsSupportedReturnKeyAttribute( DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
00253 
00257     void ClearDataset( DcmDataset *idents );
00258 
00264     void PutOffendingElements( DcmTagKey &tag );
00265 
00271     void PutErrorElements( DcmTagKey &tag );
00272 
00299     OFBool CheckMatchingKey( DcmElement *elem );
00300 
00308     OFBool ContainsOnlyValidCharacters( const char *s, const char *charset );
00309 
00314     OFBool IsValidDateOrDateRange( const char *value );
00315 
00323     OFBool IsValidDate( const char *value );
00324 
00329     OFBool IsValidTimeOrTimeRange( const char *value );
00330 
00344     OFBool IsValidTime( const char *value );
00345 
00351     char *GetStringValue( DcmElement *elem );
00352 
00357     void DumpMessage( const char *message );
00358 
00363     char *DeleteLeadingAndTrailingBlanks( const char *value );
00364 
00368     WlmDataSource( const WlmDataSource &Src );
00369 
00374     WlmDataSource &operator=( const WlmDataSource &Src );
00375 
00376 
00377   public:
00380     WlmDataSource();
00381 
00384     virtual ~WlmDataSource();
00385 
00389     virtual OFCondition ConnectToDataSource() = 0;
00390 
00394     virtual OFCondition DisconnectFromDataSource() = 0;
00395 
00399     void SetCalledApplicationEntityTitle( char *value );
00400 
00404     void SetFailOnInvalidQuery( OFBool value );
00405 
00409     void SetLogStream( OFConsole *value );
00410 
00414     void SetVerbose( OFBool value );
00415 
00419     void SetDebug( OFBool value );
00420 
00424     void SetNoSequenceExpansion( OFBool value );
00425 
00429     void SetReturnedCharacterSet( WlmReturnedCharacterSetType value );
00430 
00438     virtual OFBool IsCalledApplicationEntityTitleSupported() = 0;
00439 
00452     virtual WlmDataSourceStatusType StartFindRequest( DcmDataset &findRequestIdentifiers ) = 0;
00453 
00464     virtual DcmDataset *NextFindResponse( WlmDataSourceStatusType &rStatus ) = 0;
00465 
00472     WlmDataSourceStatusType CancelFindRequest();
00473 
00477     DcmAttributeTag *GetOffendingElements();
00478 
00482     DcmLongString *GetErrorComments();
00483 
00486     virtual void SetDbDsn( const char * /*value*/ ) {}
00487 
00490     virtual void SetDbUserName( const char * /*value*/ ) {}
00491 
00494     virtual void SetDbUserPassword( const char * /*value*/ ) {}
00495 
00498     virtual void SetCfgFileMatchRecords( const char * /*value*/ ) {}
00499 
00502     virtual void SetCfgFileSelectValues( const char * /*value*/ ) {}
00503 
00506     virtual void SetDatabaseType( WlmDatabaseType /*value*/ ) {}
00507 
00511     virtual void SetSerialNumber( const int /*value*/ ) {}
00512 
00516     virtual void SetInstitutionId( const unsigned int /*value*/ ) {}
00517 
00520     virtual void SetDfPath( const char * /*value*/ ) {}
00521 
00524     virtual void SetCreateNullvalues( OFBool /*value*/ ) {}
00525 
00528     virtual void SetPfFileName( const char * /*value*/ ) {}
00529 
00532     virtual void SetModalityToReturn( const char * /*value*/ ) {}
00533 
00536     virtual void SetCommaSeparatePatientName( OFBool /*value*/ ) {}
00537 
00540     virtual void SetReturnPatientUidInAccessionNumber( OFBool /*value*/ ) {}
00541 };
00542 
00543 #endif
00544 
00545 /*
00546 ** CVS Log
00547 ** $Log: wlds.h,v $
00548 ** Revision 1.20  2004/04/06 18:19:28  joergr
00549 ** Updated data dictionary, UIDs and transfer syntaxes for the latest Final Text
00550 ** Supplements (42 and 47) and Correction Proposals (CP 25).
00551 **
00552 ** Revision 1.19  2004/01/15 12:01:24  wilkens
00553 ** Added function to Worklist Management Data Source Base Class. This function
00554 ** is needed in the private part of this toolkit.
00555 **
00556 ** Revision 1.18  2004/01/07 09:52:18  wilkens
00557 ** Fixed typo in comment.
00558 **
00559 ** Revision 1.17  2004/01/07 08:32:28  wilkens
00560 ** Added new sequence type return key attributes to wlmscpfs. Fixed bug that for
00561 ** equally named attributes in sequences always the same value will be returned.
00562 ** Added functionality that also more than one item will be returned in sequence
00563 ** type return key attributes.
00564 **
00565 ** Revision 1.16  2004/01/02 13:56:14  wilkens
00566 ** Integrated new return key attributes into wlmscpfs and updated function that
00567 ** checks integrity of matching key attribute values (added support for new VR).
00568 **
00569 ** Revision 1.15  2003/12/23 13:04:36  wilkens
00570 ** Integrated new matching key attributes into wlmscpfs.
00571 **
00572 ** Revision 1.14  2003/12/11 10:45:33  wilkens
00573 ** Added function to Worklist Management Data Source Base Class. This function
00574 ** is needed in the private part of this toolkit.
00575 **
00576 ** Revision 1.13  2003/08/21 13:38:23  wilkens
00577 ** Moved declaration and initialization of member variables matchingDatasets and
00578 ** numOfMatchingDatasets to base class.
00579 ** Got rid of superfluous member variable objlist and of superfluous function
00580 ** ClearObjList().
00581 **
00582 ** Revision 1.12  2003/07/02 09:17:55  wilkens
00583 ** Updated documentation to get rid of doxygen warnings.
00584 **
00585 ** Revision 1.11  2003/02/17 12:02:03  wilkens
00586 ** Made some minor modifications to be able to modify a special variant of the
00587 ** worklist SCP implementation (wlmscpki).
00588 **
00589 ** Revision 1.10  2002/12/16 11:08:33  wilkens
00590 ** Added missing #include "osconfig.h" to certain files.
00591 **
00592 ** Revision 1.9  2002/08/12 10:56:07  wilkens
00593 ** Made some modifications in in order to be able to create a new application
00594 ** which contains both wlmscpdb and ppsscpdb and another application which
00595 ** contains both wlmscpfs and ppsscpfs.
00596 **
00597 ** Revision 1.8  2002/07/17 13:10:36  wilkens
00598 ** Corrected some minor logical errors in the wlmscpdb sources and completely
00599 ** updated the wlmscpfs so that it does not use the original wlistctn sources
00600 ** any more but standard wlm sources which are now used by all three variants
00601 ** of wlmscps.
00602 **
00603 ** Revision 1.7  2002/07/01 14:13:56  wilkens
00604 ** Some more corrections to get rid of msvc6's warnings.
00605 **
00606 ** Revision 1.6  2002/06/10 11:25:05  wilkens
00607 ** Made some corrections to keep gcc 2.95.3 quiet.
00608 **
00609 ** Revision 1.5  2002/05/08 13:20:51  wilkens
00610 ** Added new command line option -nse to wlmscpki and wlmscpdb.
00611 **
00612 ** Revision 1.4  2002/04/18 14:20:08  wilkens
00613 ** Modified Makefiles. Updated latest changes again. These are the latest
00614 ** sources. Added configure file.
00615 **
00616 ** Revision 1.3  2002/01/08 17:45:34  joergr
00617 ** Reformatted source files (replaced Windows newlines by Unix ones, replaced
00618 ** tabulator characters by spaces, etc.)
00619 **
00620 ** Revision 1.2  2002/01/08 16:50:12  joergr
00621 ** Added preliminary database support using OTL interface library (modified by
00622 ** MC/JR on 2001-12-21).
00623 **
00624 ** Revision 1.1  2002/01/08 16:30:59  joergr
00625 ** Added new module "dcmwlm" developed by Thomas Wilkens (initial release for
00626 ** Windows, dated 2001-12-20).
00627 **
00628 **
00629 */


Generated on 29 Apr 2005 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.4.2