1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
6 Date: $Date: 2004/10/25 04:08:20 $
7 Version: $Revision: 1.18 $
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 s SQ Item holding the elements related to this "PATIENT" part
30 * @param ptagHT pointer to the HTable (DicomDirObject needs it
31 * to build the HeaderEntries)
33 DicomDirPatient::DicomDirPatient(SQItem *s, TagDocEntryHT *ptagHT) :
34 DicomDirObject(ptagHT)
36 DocEntries = s->GetDocEntries();
40 * @param ptagHT pointer to the HTable (DicomDirObject needs it
41 * to build the HeaderEntries)
43 DicomDirPatient::DicomDirPatient(TagDocEntryHT* ptagHT):
44 DicomDirObject(ptagHT)
48 * \brief Canonical destructor.
50 DicomDirPatient::~DicomDirPatient()
52 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
60 //-----------------------------------------------------------------------------
63 * \brief Prints the Object
66 void DicomDirPatient::Print(std::ostream& os)
68 os << "PATIENT" << std::endl;
69 DicomDirObject::Print(os);
71 for(ListDicomDirStudy::const_iterator cc = Studies.begin();
75 (*cc)->SetPrintLevel(PrintLevel);
81 * \brief Writes the Object
84 void DicomDirPatient::Write(std::ofstream* fp, FileType t)
86 DicomDirObject::Write(fp, t);
88 for(ListDicomDirStudy::iterator cc = Studies.begin();
92 (*cc)->Write( fp, t );
95 //-----------------------------------------------------------------------------
99 * \brief adds a new Patient at the begining of the PatientList
100 * of a partially created DICOMDIR
102 DicomDirStudy* DicomDirPatient::NewStudy()
104 ListDicomDirStudyElem const & elemList =
105 Global::GetDicomDirElements()->GetDicomDirStudyElements();
107 DicomDirStudy* st = new DicomDirStudy( PtagHT );
108 st->FillObject(elemList);
110 Studies.push_front(st);
114 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
122 } // end namespace gdcm