OFFIS DCMTK  Version 3.6.0
wlds.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: (Partially) abstract class for connecting to an arbitrary data source.
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:38 $
22  * CVS/RCS Revision: $Revision: 1.28 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef WlmDataSource_h
30 #define WlmDataSource_h
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/dcmwlm/wltypdef.h"
34 #include "dcmtk/dcmdata/dcdatset.h"
35 #include "dcmtk/oflog/oflog.h"
36 
37 OFLogger DCM_dcmwlmGetLogger();
38 
39 #define DCMWLM_TRACE(msg) OFLOG_TRACE(DCM_dcmwlmGetLogger(), msg)
40 #define DCMWLM_DEBUG(msg) OFLOG_DEBUG(DCM_dcmwlmGetLogger(), msg)
41 #define DCMWLM_INFO(msg) OFLOG_INFO(DCM_dcmwlmGetLogger(), msg)
42 #define DCMWLM_WARN(msg) OFLOG_WARN(DCM_dcmwlmGetLogger(), msg)
43 #define DCMWLM_ERROR(msg) OFLOG_ERROR(DCM_dcmwlmGetLogger(), msg)
44 #define DCMWLM_FATAL(msg) OFLOG_FATAL(DCM_dcmwlmGetLogger(), msg)
45 
46 class DcmAttributeTag;
47 class DcmLongString;
48 
53 {
54  protected:
55 
75  WlmReturnedCharacterSetType returnedCharacterSet;
83  unsigned long numOfSuperiorSequences;
84 
90  OFBool CheckSearchMask( DcmDataset *searchMask );
91 
101  void CheckNonSequenceElementInSearchMask( DcmDataset *searchMask, int &invalidMatchingKeyAttributeCount, DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
102 
114  void CheckSequenceElementInSearchMask( DcmDataset *searchMask, int &invalidMatchingKeyAttributeCount, DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
115 
125 
151  OFBool IsSupportedMatchingKeyAttribute( DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
152 
246  OFBool IsSupportedReturnKeyAttribute( DcmElement *element, DcmSequenceOfItems *supSequenceElement=NULL );
247 
251  void ClearDataset( DcmDataset *idents );
252 
258  void PutOffendingElements( const DcmTagKey &tag );
259 
265  void PutErrorElements( const DcmTagKey &tag );
266 
294  OFBool CheckMatchingKey( const DcmElement *elem );
295 
303  OFBool ContainsOnlyValidCharacters( const char *s, const char *charset );
304 
309  OFBool IsValidDateOrDateRange( const OFString& value );
310 
318  OFBool IsValidDate( const OFString& value );
319 
324  OFBool IsValidTimeOrTimeRange( const OFString& value );
325 
339  OFBool IsValidTime( const OFString& value );
340 
349  OFBool GetStringValue( const DcmElement *elem,
350  OFString& resultVal );
351 
357 
361  WlmDataSource( const WlmDataSource &Src );
362 
367  WlmDataSource &operator=( const WlmDataSource &Src );
368 
369 
370  public:
373  WlmDataSource();
374 
377  virtual ~WlmDataSource();
378 
382  virtual OFCondition ConnectToDataSource() = 0;
383 
388 
392  void SetCalledApplicationEntityTitle( const OFString& value );
393 
397  void SetFailOnInvalidQuery( OFBool value );
398 
402  void SetNoSequenceExpansion( OFBool value );
403 
407  void SetReturnedCharacterSet( WlmReturnedCharacterSetType value );
408 
416  virtual OFBool IsCalledApplicationEntityTitleSupported() = 0;
417 
430  virtual WlmDataSourceStatusType StartFindRequest( const DcmDataset &findRequestIdentifiers ) = 0;
431 
442  virtual DcmDataset *NextFindResponse( WlmDataSourceStatusType &rStatus ) = 0;
443 
450  WlmDataSourceStatusType CancelFindRequest();
451 
456 
461 
464  virtual void SetDbDsn( const OFString& /*value*/ ) {}
465 
468  virtual void SetDbUserName( const OFString& /*value*/ ) {}
469 
472  virtual void SetDbUserPassword( const OFString& /*value*/ ) {}
473 
476  virtual void SetCfgFileMatchRecords( const OFString& /*value*/ ) {}
477 
480  virtual void SetCfgFileSelectValues( const OFString& /*value*/ ) {}
481 
484  virtual void SetDatabaseType( WlmDatabaseType /*value*/ ) {}
485 
489  virtual void SetSerialNumber( const int /*value*/ ) {}
490 
494  virtual void SetInstitutionId( const unsigned int /*value*/ ) {}
495 
498  virtual void SetDfPath( const OFString& /*value*/ ) {}
499 
502  virtual void SetEnableRejectionOfIncompleteWlFiles( OFBool /*value*/ ) {}
503 
506  virtual void SetCreateNullvalues( OFBool /*value*/ ) {}
507 
510  virtual void SetPfFileName( const OFString& /*value*/ ) {}
511 
514  virtual void SetModalityToReturn( const OFString& /*value*/ ) {}
515 
518  virtual void SetCommaSeparatePatientName( OFBool /*value*/ ) {}
519 
522  virtual void SetReturnPatientUidInAccessionNumber( OFBool /*value*/ ) {}
523 };
524 
525 #endif
526 
527 /*
528 ** CVS Log
529 ** $Log: wlds.h,v $
530 ** Revision 1.28 2010-10-14 13:16:38 joergr
531 ** Updated copyright header. Added reference to COPYRIGHT file.
532 **
533 ** Revision 1.27 2010-08-09 13:29:38 joergr
534 ** Updated data dictionary to 2009 edition of the DICOM standard. From now on,
535 ** the official "keyword" is used for the attribute name which results in a
536 ** number of minor changes (e.g. "PatientsName" is now called "PatientName").
537 **
538 ** Revision 1.26 2009-11-24 10:40:01 uli
539 ** Switched to logging mechanism provided by the "new" oflog module.
540 **
541 ** Revision 1.25 2009-09-30 08:40:34 uli
542 ** Make dcmwlm's include headers self-sufficient by including all
543 ** needed headers directly.
544 **
545 ** Revision 1.24 2006-12-15 14:49:21 onken
546 ** Removed excessive use char* and C-array in favour of OFString and
547 ** OFList. Simplified some implementation details.
548 **
549 ** Revision 1.23 2005/12/08 16:05:40 meichel
550 ** Changed include path schema for all DCMTK header files
551 **
552 ** Revision 1.22 2005/09/23 12:56:40 wilkens
553 ** Added attribute PatientsBirthDate as a matching key attribute to wlmscpfs.
554 ** Thanks to Andre M. Descombes <andre@descombes.info> for the code template.
555 **
556 ** Revision 1.21 2005/05/04 11:34:31 wilkens
557 ** Added two command line options --enable-file-reject (default) and
558 ** --disable-file-reject to wlmscpfs: these options can be used to enable or
559 ** disable a file rejection mechanism which makes sure only complete worklist files
560 ** will be used during the matching process. A worklist file is considered to be
561 ** complete if it contains all necessary type 1 information which the SCP might
562 ** have to return to an SCU in a C-Find response message.
563 **
564 ** Revision 1.20 2004/04/06 18:19:28 joergr
565 ** Updated data dictionary, UIDs and transfer syntaxes for the latest Final Text
566 ** Supplements (42 and 47) and Correction Proposals (CP 25).
567 **
568 ** Revision 1.19 2004/01/15 12:01:24 wilkens
569 ** Added function to Worklist Management Data Source Base Class. This function
570 ** is needed in the private part of this toolkit.
571 **
572 ** Revision 1.18 2004/01/07 09:52:18 wilkens
573 ** Fixed typo in comment.
574 **
575 ** Revision 1.17 2004/01/07 08:32:28 wilkens
576 ** Added new sequence type return key attributes to wlmscpfs. Fixed bug that for
577 ** equally named attributes in sequences always the same value will be returned.
578 ** Added functionality that also more than one item will be returned in sequence
579 ** type return key attributes.
580 **
581 ** Revision 1.16 2004/01/02 13:56:14 wilkens
582 ** Integrated new return key attributes into wlmscpfs and updated function that
583 ** checks integrity of matching key attribute values (added support for new VR).
584 **
585 ** Revision 1.15 2003/12/23 13:04:36 wilkens
586 ** Integrated new matching key attributes into wlmscpfs.
587 **
588 ** Revision 1.14 2003/12/11 10:45:33 wilkens
589 ** Added function to Worklist Management Data Source Base Class. This function
590 ** is needed in the private part of this toolkit.
591 **
592 ** Revision 1.13 2003/08/21 13:38:23 wilkens
593 ** Moved declaration and initialization of member variables matchingDatasets and
594 ** numOfMatchingDatasets to base class.
595 ** Got rid of superfluous member variable objlist and of superfluous function
596 ** ClearObjList().
597 **
598 ** Revision 1.12 2003/07/02 09:17:55 wilkens
599 ** Updated documentation to get rid of doxygen warnings.
600 **
601 ** Revision 1.11 2003/02/17 12:02:03 wilkens
602 ** Made some minor modifications to be able to modify a special variant of the
603 ** worklist SCP implementation (wlmscpki).
604 **
605 ** Revision 1.10 2002/12/16 11:08:33 wilkens
606 ** Added missing #include "osconfig.h" to certain files.
607 **
608 ** Revision 1.9 2002/08/12 10:56:07 wilkens
609 ** Made some modifications in in order to be able to create a new application
610 ** which contains both wlmscpdb and ppsscpdb and another application which
611 ** contains both wlmscpfs and ppsscpfs.
612 **
613 ** Revision 1.8 2002/07/17 13:10:36 wilkens
614 ** Corrected some minor logical errors in the wlmscpdb sources and completely
615 ** updated the wlmscpfs so that it does not use the original wlistctn sources
616 ** any more but standard wlm sources which are now used by all three variants
617 ** of wlmscps.
618 **
619 ** Revision 1.7 2002/07/01 14:13:56 wilkens
620 ** Some more corrections to get rid of msvc6's warnings.
621 **
622 ** Revision 1.6 2002/06/10 11:25:05 wilkens
623 ** Made some corrections to keep gcc 2.95.3 quiet.
624 **
625 ** Revision 1.5 2002/05/08 13:20:51 wilkens
626 ** Added new command line option -nse to wlmscpki and wlmscpdb.
627 **
628 ** Revision 1.4 2002/04/18 14:20:08 wilkens
629 ** Modified Makefiles. Updated latest changes again. These are the latest
630 ** sources. Added configure file.
631 **
632 ** Revision 1.3 2002/01/08 17:45:34 joergr
633 ** Reformatted source files (replaced Windows newlines by Unix ones, replaced
634 ** tabulator characters by spaces, etc.)
635 **
636 ** Revision 1.2 2002/01/08 16:50:12 joergr
637 ** Added preliminary database support using OTL interface library (modified by
638 ** MC/JR on 2001-12-21).
639 **
640 ** Revision 1.1 2002/01/08 16:30:59 joergr
641 ** Added new module "dcmwlm" developed by Thomas Wilkens (initial release for
642 ** Windows, dated 2001-12-20).
643 **
644 **
645 */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2