1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
6 Date: $Date: 2004/09/27 08:39:06 $
7 Version: $Revision: 1.14 $
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"
23 //-----------------------------------------------------------------------------
24 // Constructor / Destructor
27 * @param s SQ Item holding the elements related to this "PATIENT" part
28 * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
29 * to build the gdcmHeaderEntries)
31 gdcmDicomDirPatient::gdcmDicomDirPatient(gdcmSQItem *s, TagDocEntryHT *ptagHT):
32 gdcmDicomDirObject(ptagHT)
34 docEntries = s->GetDocEntries();
38 * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
39 * to build the gdcmHeaderEntries)
41 gdcmDicomDirPatient::gdcmDicomDirPatient(TagDocEntryHT* ptagHT):
42 gdcmDicomDirObject(ptagHT)
46 * \brief Canonical destructor.
48 gdcmDicomDirPatient::~gdcmDicomDirPatient()
50 for(ListDicomDirStudy::iterator cc = studies.begin();
51 cc != studies.end(); ++cc)
57 //-----------------------------------------------------------------------------
60 * \brief Prints the Object
63 void gdcmDicomDirPatient::Print(std::ostream& os)
65 os << "PATIENT" << std::endl;
66 gdcmDicomDirObject::Print(os);
68 for(ListDicomDirStudy::iterator cc = studies.begin();
69 cc != studies.end(); ++cc)
71 (*cc)->SetPrintLevel(PrintLevel);
77 * \brief Writes the Object
80 void gdcmDicomDirPatient::Write(FILE* fp, FileType t)
82 gdcmDicomDirObject::Write(fp, t);
84 for(ListDicomDirStudy::iterator cc = studies.begin();cc!=studies.end();++cc)
86 (*cc)->Write( fp, t );
89 //-----------------------------------------------------------------------------
93 * \brief adds a new Patient at the begining of the PatientList
94 * of a partially created DICOMDIR
96 gdcmDicomDirStudy* gdcmDicomDirPatient::NewStudy()
98 std::list<gdcmElement> elemList =
99 gdcmGlobal::GetDicomDirElements()->GetDicomDirStudyElements();
101 gdcmDicomDirStudy* st = new gdcmDicomDirStudy( PtagHT );
102 st->FillObject(elemList);
104 studies.push_front(st);
108 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------