]> Creatis software - gdcm.git/blob - src/gdcmDicomDirPatient.h
2005-01-15 Jean-Pierre Roux <jpr@creatis.univ-lyon1.fr>
[gdcm.git] / src / gdcmDicomDirPatient.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirPatient.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/17 10:59:52 $
7   Version:   $Revision: 1.19 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMPATIENT_H
20 #define GDCMPATIENT_H
21
22 #include "gdcmDicomDirObject.h"
23
24 namespace gdcm 
25 {
26 class DicomDirStudy;
27
28 //-----------------------------------------------------------------------------
29 typedef std::list<DicomDirStudy*> ListDicomDirStudy;
30
31 //-----------------------------------------------------------------------------
32 /**
33  * \brief   describes a PATIENT within a DICOMDIR (DicomDir)
34  */
35
36 class GDCM_EXPORT DicomDirPatient : public DicomDirObject 
37 {
38 public:
39    DicomDirPatient(); 
40    ~DicomDirPatient();
41
42    void Print(std::ostream &os = std::cout, std::string const & indent = "" );
43    void WriteContent(std::ofstream *fp, FileType t);
44
45     // TODO Remove GetDicomDirStudies
46     // use InitTraversal + GetNextEntry instead.
47   
48    /// Returns the STUDY chained List for this PATIENT.
49    ListDicomDirStudy const &GetDicomDirStudies() const { return Studies; };
50
51    // should avoid exposing internal mechanism
52    void InitTraversal();
53    DicomDirStudy *GetNextEntry();
54
55    /// adds the passed STUDY to the STUDY chained List for this PATIENT.
56    void AddDicomDirStudy (DicomDirStudy *obj) { Studies.push_back(obj); };
57
58    DicomDirStudy *NewStudy(); 
59          
60 private:
61
62    /// chained list of DicomDirStudy  (to be exploited recursively)
63    ListDicomDirStudy Studies;
64    /// iterator on the DicomDirStudies of the current DicomDirPatient
65    ListDicomDirStudy::iterator ItDicomDirStudy;
66 };
67 } // end namespace gdcm
68
69 //-----------------------------------------------------------------------------
70 #endif