1 // gdcmDicomDirPatient.cxx
2 //-----------------------------------------------------------------------------
3 #include "gdcmDicomDirPatient.h"
4 #include "gdcmDicomDirElement.h"
5 #include "gdcmGlobal.h"
7 //-----------------------------------------------------------------------------
8 // Constructor / Destructor
10 * \ingroup gdcmDicomDirPatient
12 * @param s SQ Item holding the elements related to this "PATIENT" part
13 * @param ptagHT pointer to the HTable (gdcmObject needs it
14 * to build the gdcmHeaderEntries)
16 gdcmDicomDirPatient::gdcmDicomDirPatient(gdcmSQItem *s, TagDocEntryHT *ptagHT):
19 docEntries = s->GetDocEntries();
22 * \ingroup gdcmDicomDirPatient
24 * @param ptagHT pointer to the HTable (gdcmObject needs it
25 * to build the gdcmHeaderEntries)
27 gdcmDicomDirPatient::gdcmDicomDirPatient(TagDocEntryHT *ptagHT):
32 * \ingroup gdcmDicomDirPatient
33 * \brief Canonical destructor.
35 gdcmDicomDirPatient::~gdcmDicomDirPatient()
37 for(ListDicomDirStudy::iterator cc = studies.begin();cc != studies.end();++cc)
43 //-----------------------------------------------------------------------------
46 * \ingroup gdcmDicomDirPatient
47 * \brief Prints the Object
50 void gdcmDicomDirPatient::Print(std::ostream &os)
52 os<<"PATIENT"<<std::endl;
53 gdcmObject::Print(os);
55 for(ListDicomDirStudy::iterator cc = studies.begin();cc!=studies.end();++cc)
57 (*cc)->SetPrintLevel(printLevel);
62 //-----------------------------------------------------------------------------
66 * \ingroup gdcmDicomDir
67 * \brief adds a new Patient at the begining of the PatientList
68 * of a partially created DICOMDIR
70 gdcmDicomDirStudy * gdcmDicomDirPatient::NewStudy(void) {
71 std::list<gdcmElement> elemList;
72 elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirStudyElements();
74 gdcmDicomDirStudy *st = new gdcmDicomDirStudy( ptagHT);
75 st->FillObject(elemList);
77 studies.push_front(st);
83 //-----------------------------------------------------------------------------
86 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------