]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirPatient.cxx
Now the tree-like structure describing a DICOMDIR comming from an already
[gdcm.git] / src / gdcmDicomDirPatient.cxx
index 007eeaf0f9a53d6fa969cfcff265032cdaa9f4bf..2859349ea1fc050c94b8fb2c70512dd71fbc6f5c 100644 (file)
@@ -1,17 +1,29 @@
 // gdcmDicomDirPatient.cxx
 //-----------------------------------------------------------------------------
 #include "gdcmDicomDirPatient.h"
-
+#include "gdcmDicomDirElement.h"
+#include "gdcmUtil.h"
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
  * \ingroup gdcmDicomDirPatient
- * \brief   
- * @param   begin iterator of begin for the object
- * @param   end   iterator of end for the object
+ * \brief   Constructor
+ * @param  begin  iterator (inside the gdcmParser chained list)
+ *                on the first Header Entry (i.e Dicom Element)
+ *                related to this "PATIENT" part
+ * @param  end  iterator  (inside the gdcmParser chained list)
+ *              on the last Header Entry (i.e Dicom Element) 
+ *              related to this 'PATIENT' part
+ * @param ptagHT pointer to the HTable (gdcmObject needs it 
+ *               to build the gdcmHeaderEntries)
+ * @param plistEntries pointer to the chained List (gdcmObject needs it 
+ *               to build the gdcmHeaderEntries)
  */
-gdcmDicomDirPatient::gdcmDicomDirPatient(ListTag::iterator begin,ListTag::iterator end):
-   gdcmObject(begin,end)
+gdcmDicomDirPatient::gdcmDicomDirPatient(ListTag::iterator begin,
+                                         ListTag::iterator end,
+                                         TagHeaderEntryHT *ptagHT, 
+                                         ListTag *plistEntries):
+   gdcmObject(begin,end,ptagHT,plistEntries)
 {
 }
 
@@ -49,6 +61,23 @@ void gdcmDicomDirPatient::Print(std::ostream &os)
 //-----------------------------------------------------------------------------
 // Public
 
+/*
+ * \ingroup gdcmDicomDir
+ * \brief   adds a new Patient at the begining of the PatientList
+ *          of a partially created DICOMDIR
+ */
+gdcmDicomDirStudy * gdcmDicomDirPatient::NewStudy(void) {
+   std::list<gdcmElement> elemList;   
+   elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirStudyElements();
+      
+   FillObject(elemList);
+   gdcmDicomDirStudy *st = new gdcmDicomDirStudy(i, j, ptagHT, plistEntries);
+   studies.push_front(st);
+   return st; 
+
+  
+}   
+
 //-----------------------------------------------------------------------------
 // Protected