1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
6 Date: $Date: 2004/12/03 17:13:18 $
7 Version: $Revision: 1.20 $
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"
25 //-----------------------------------------------------------------------------
26 // Constructor / Destructor
29 * @param ptagHT pointer to the HTable (DicomDirObject needs it
30 * to build the HeaderEntries)
32 DicomDirPatient::DicomDirPatient():
37 * \brief Canonical destructor.
39 DicomDirPatient::~DicomDirPatient()
41 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
49 //-----------------------------------------------------------------------------
52 * \brief Prints the Object
55 void DicomDirPatient::Print(std::ostream& os)
57 os << "PATIENT" << std::endl;
58 DicomDirObject::Print(os);
60 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
64 (*cc)->SetPrintLevel(PrintLevel);
70 * \brief Writes the Object
73 void DicomDirPatient::WriteContent(std::ofstream* fp, FileType t)
75 DicomDirObject::WriteContent(fp, t);
77 for(ListDicomDirStudy::iterator cc = Studies.begin();
81 (*cc)->WriteContent( fp, t );
84 //-----------------------------------------------------------------------------
88 * \brief adds a new Patient at the begining of the PatientList
89 * of a partially created DICOMDIR
91 DicomDirStudy* DicomDirPatient::NewStudy()
93 ListDicomDirStudyElem const & elemList =
94 Global::GetDicomDirElements()->GetDicomDirStudyElements();
96 DicomDirStudy* st = new DicomDirStudy();
97 st->FillObject(elemList);
99 Studies.push_front(st);
103 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
111 } // end namespace gdcm