1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
6 Date: $Date: 2005/01/06 20:03:27 $
7 Version: $Revision: 1.23 $
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
33 DicomDirPatient::DicomDirPatient():
38 * \brief Canonical destructor.
40 DicomDirPatient::~DicomDirPatient()
42 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
50 //-----------------------------------------------------------------------------
53 * \brief Prints the Object
54 * @param os ostream to write to
56 void DicomDirPatient::Print(std::ostream &os)
58 os << "PATIENT" << std::endl;
59 DicomDirObject::Print(os);
61 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
65 (*cc)->SetPrintLevel(PrintLevel);
71 * \brief Writes the Object
72 * @param fp ofstream to write to
73 * @param t Type of the File (explicit VR, implicitVR, ...)
75 void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t)
77 DicomDirObject::WriteContent(fp, t);
79 for(ListDicomDirStudy::iterator cc = Studies.begin();
83 (*cc)->WriteContent( fp, t );
86 //-----------------------------------------------------------------------------
90 * \brief adds a new Patient at the begining of the PatientList
91 * of a partially created DICOMDIR
93 DicomDirStudy* DicomDirPatient::NewStudy()
95 ListDicomDirStudyElem const &elemList =
96 Global::GetDicomDirElements()->GetDicomDirStudyElements();
98 DicomDirStudy *st = new DicomDirStudy();
99 st->FillObject(elemList);
101 Studies.push_front(st);
105 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
113 } // end namespace gdcm