1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
6 Date: $Date: 2004/12/03 20:16:57 $
7 Version: $Revision: 1.21 $
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.
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.
17 =========================================================================*/
19 #include "gdcmDicomDirPatient.h"
20 #include "gdcmDicomDirElement.h"
21 #include "gdcmGlobal.h"
22 #include "gdcmDicomDirStudy.h"
23 #include "gdcmSQItem.h"
28 //-----------------------------------------------------------------------------
29 // Constructor / Destructor
32 * @param ptagHT pointer to the HTable (DicomDirObject needs it
33 * to build the HeaderEntries)
35 DicomDirPatient::DicomDirPatient():
40 * \brief Canonical destructor.
42 DicomDirPatient::~DicomDirPatient()
44 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
52 //-----------------------------------------------------------------------------
55 * \brief Prints the Object
58 void DicomDirPatient::Print(std::ostream& os)
60 os << "PATIENT" << std::endl;
61 DicomDirObject::Print(os);
63 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
67 (*cc)->SetPrintLevel(PrintLevel);
73 * \brief Writes the Object
76 void DicomDirPatient::WriteContent(std::ofstream* fp, FileType t)
78 DicomDirObject::WriteContent(fp, t);
80 for(ListDicomDirStudy::iterator cc = Studies.begin();
84 (*cc)->WriteContent( fp, t );
87 //-----------------------------------------------------------------------------
91 * \brief adds a new Patient at the begining of the PatientList
92 * of a partially created DICOMDIR
94 DicomDirStudy* DicomDirPatient::NewStudy()
96 ListDicomDirStudyElem const & elemList =
97 Global::GetDicomDirElements()->GetDicomDirStudyElements();
99 DicomDirStudy* st = new DicomDirStudy();
100 st->FillObject(elemList);
102 Studies.push_front(st);
106 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
114 } // end namespace gdcm