fw4spl
io/fwGdcmIO/src/fwGdcmIO/writer/ie/Patient.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwGdcmIO/writer/ie/Patient.hpp"
8 
9 #include "fwGdcmIO/helper/DicomDataWriter.hxx"
10 
11 #include <fwMedData/Patient.hpp>
12 
13 namespace fwGdcmIO
14 {
15 namespace writer
16 {
17 namespace ie
18 {
19 
20 //------------------------------------------------------------------------------
21 
22 Patient::Patient(const SPTR(::gdcm::Writer)& writer,
23  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
24  const ::fwMedData::Patient::csptr& patient,
25  const ::fwLog::Logger::sptr& logger,
26  ProgressCallback progress,
27  CancelRequestedCallback cancel) :
28  ::fwGdcmIO::writer::ie::InformationEntity< ::fwMedData::Patient >(writer, instance, patient,
29  logger, progress, cancel)
30 {
31 }
32 
33 //------------------------------------------------------------------------------
34 
36 {
37 }
38 
39 //------------------------------------------------------------------------------
40 
42 {
43  // Retrieve dataset
44  ::gdcm::DataSet& dataset = m_writer->GetFile().GetDataSet();
45 
46  // Patient's name - Type 2
47  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0010, 0x0010 >(m_object->getName(), dataset);
48 
49  // Patient's ID - Type 2
50  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0010, 0x0020 >(m_object->getPatientId(), dataset);
51 
52  // Patient's birth date - Type 2
53  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0010, 0x0030 >(m_object->getBirthdate(), dataset);
54 
55  // Patient's sex - Type 2
56  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0010, 0x0040 >(m_object->getSex(), dataset);
57 }
58 
59 //------------------------------------------------------------------------------
60 
61 } // namespace ie
62 } // namespace writer
63 } // namespace fwGdcmIO
#define SPTR(_cls_)
Namespace containing medical data.
virtual FWGDCMIO_API void writePatientModule()
Write Patient Module tags.
InformationEntity base class used to write modules.
This class defines a DICOM SOP instance. It is useful during the whole writing process. This class allows to share data between module writers.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
FWGDCMIO_API Patient(const std::shared_ptr< ::gdcm::Writer > &writer, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const ::fwMedData::Patient::csptr &patient, const ::fwLog::Logger::sptr &logger=nullptr, ProgressCallback progress=nullptr, CancelRequestedCallback cancel=nullptr)
Constructor.
std::shared_ptr< const ::fwMedData::Patient > m_object
FW4SPL Object.