fw4spl
Patient1.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
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 <fwAtoms/Numeric.hpp>
8 #include <fwAtoms/String.hpp>
9 #include <fwAtoms/Map.hpp>
10 
11 #include <fwAtomsPatch/helper/Object.hpp>
12 
13 #include "fwStructuralPatch/creator/fwMedData/Patient1.hpp"
14 
15 namespace fwStructuralPatch
16 {
17 namespace creator
18 {
19 namespace fwMedData
20 {
21 
23 {
24  m_classname = "::fwMedData::Patient";
25  m_version = "1";
26 }
27 
28 // ----------------------------------------------------------------------------
29 
31 {
32 }
33 
34 // ----------------------------------------------------------------------------
35 
37 {
38 }
39 
40 // ----------------------------------------------------------------------------
41 
42 ::fwAtoms::Object::sptr Patient1::create()
43 {
44  ::fwAtoms::Object::sptr patient = this->createObjBase();
45  ::fwAtomsPatch::helper::Object helper(patient);
46 
47  helper.addAttribute("name", ::fwAtoms::String::New(""));
48  helper.addAttribute("patient_id", ::fwAtoms::String::New(""));
49  helper.addAttribute("birth_date", ::fwAtoms::String::New(""));
50  helper.addAttribute("sex", ::fwAtoms::String::New(""));
51 
52  return patient;
53 }
54 
55 } // namespace fwMedData
56 } // namespace creator
57 } // namespace fwStructuralPatch
Namespace containing medical data.
std::string m_version
Object version.
static FWATOMS_API String::sptr New(std::string value)
Construct a new Object represented a string.
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
Contains creators and structural patches.
Definition: Landmarks1.hpp:13
FWATOMSPATCH_API::fwAtoms::Object::sptr createObjBase() const
Create the object base : create meta infos : classname, version and id.
FWATOMSPATCH_API void addAttribute(const std::string &name,::fwAtoms::Base::sptr value, conditions::Abstract::sptr condition=conditions::Abstract::New())
Adds a new attribute in the current object.
FWATOMSPATCH_API IStructuralCreator()
Constructor.
Structural creator for fwMedData::Patient version &#39;1&#39;.
Definition: Patient1.hpp:21
FWSTRUCTURALPATCH_API Patient1()
Constructor.
Definition: Patient1.cpp:22
virtual FWSTRUCTURALPATCH_API::fwAtoms::Object::sptr create() override
Creates the specified object (sets &#39;name&#39;, &#39;patient_id&#39;, &#39;birth_date&#39; and &#39;sex&#39; attributes).
Definition: Patient1.cpp:42
std::string m_classname
Object classname.
FWSTRUCTURALPATCH_API ~Patient1()
Destructor.
Definition: Patient1.cpp:30