1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
6 Date: $Date: 2004/08/01 02:39:09 $
7 Version: $Revision: 1.10 $
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.htm 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"
23 //-----------------------------------------------------------------------------
24 // Constructor / Destructor
26 * \ingroup gdcmDicomDirPatient
28 * @param s SQ Item holding the elements related to this "PATIENT" part
29 * @param ptagHT pointer to the HTable (gdcmObject needs it
30 * to build the gdcmHeaderEntries)
32 gdcmDicomDirPatient::gdcmDicomDirPatient(gdcmSQItem *s, TagDocEntryHT *ptagHT):
35 docEntries = s->GetDocEntries();
38 * \ingroup gdcmDicomDirPatient
40 * @param ptagHT pointer to the HTable (gdcmObject needs it
41 * to build the gdcmHeaderEntries)
43 gdcmDicomDirPatient::gdcmDicomDirPatient(TagDocEntryHT *ptagHT):
48 * \ingroup gdcmDicomDirPatient
49 * \brief Canonical destructor.
51 gdcmDicomDirPatient::~gdcmDicomDirPatient()
53 for(ListDicomDirStudy::iterator cc = studies.begin();
54 cc != studies.end(); ++cc)
60 //-----------------------------------------------------------------------------
63 * \ingroup gdcmDicomDirPatient
64 * \brief Prints the Object
67 void gdcmDicomDirPatient::Print(std::ostream &os)
69 os << "PATIENT" << std::endl;
70 gdcmObject::Print(os);
72 for(ListDicomDirStudy::iterator cc = studies.begin();
73 cc != studies.end(); ++cc)
75 (*cc)->SetPrintLevel(PrintLevel);
80 //-----------------------------------------------------------------------------
84 * \ingroup gdcmDicomDir
85 * \brief adds a new Patient at the begining of the PatientList
86 * of a partially created DICOMDIR
88 gdcmDicomDirStudy * gdcmDicomDirPatient::NewStudy()
90 std::list<gdcmElement> elemList =
91 gdcmGlobal::GetDicomDirElements()->GetDicomDirStudyElements();
93 gdcmDicomDirStudy *st = new gdcmDicomDirStudy( PtagHT );
94 st->FillObject(elemList);
96 studies.push_front(st);
100 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------