10 #include <boost/date_time/posix_time/posix_time.hpp> 12 #include <fwTools/dateAndTime.hpp> 14 #include <fwAtoms/String.hpp> 16 #include "fwStructuralPatch/fwData/Patient/V1ToFwMedDataPatientV1.hpp" 51 const ::fwAtoms::Object::sptr& current,
52 ::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
54 IStructuralPatch::apply(previous, current, newVersions);
71 std::string nameSeperation =
"^";
72 if( previous->getAttribute(
"name")->getString().empty() ||
73 previous->getAttribute(
"firstname")->getString().empty() )
78 std::string newName = previous->getAttribute(
"name")->getString()
80 + previous->getAttribute(
"firstname")->getString();
84 ::boost::posix_time::ptime bithdate =
85 ::boost::posix_time::time_from_string(previous->getAttribute(
"birthdate")->getString());
90 !(previous->getAttribute(
"is_male")->getString().compare(
"true")) ?
"M" :
"F"));
This class contains helper to generate Medical Data (SeriesDB, ImageSeries, ...). ...
virtual FWSTRUCTURALPATCH_API void apply(const ::fwAtoms::Object::sptr &previous, const ::fwAtoms::Object::sptr ¤t,::fwAtomsPatch::IPatch::NewVersionsType &newVersions) override
Applies patch.
FWSTRUCTURALPATCH_API ~V1ToFwMedDataPatientV1()
Destructor.
FWSTRUCTURALPATCH_API V1ToFwMedDataPatientV1()
Constructor.
FWATOMSPATCH_API void updateVersion(std::shared_ptr< ::fwAtoms::Object > current)
Updates the version of the patched object.
static FWATOMS_API String::sptr New(std::string value)
Construct a new Object represented a string.
FWATOMSPATCH_API void renameAttribute(const std::string &name, const std::string &newName, conditions::Abstract::sptr condition=conditions::Abstract::New())
Renames an attribute.
FWATOMSPATCH_API void removeAttribute(const std::string &name, conditions::Abstract::sptr condition=conditions::Abstract::New())
Removes an attribute.
Contains base functionalities used to transform objects from a version to another.
std::string m_targetClassname
Target type.
FWATOMSPATCH_API IStructuralPatch()
Constructor.
std::string m_originClassname
Origin classname of the object.
Contains creators and structural patches.
FWATOMSPATCH_API void replaceAttribute(const std::string &name,::fwAtoms::Base::sptr newValue, conditions::Abstract::sptr condition=conditions::Abstract::New())
Replaces an attribute.
std::string m_originVersion
Origin version of the object.
std::string m_targetVersion
Target version.
Contains the representation of the data objects used in the framework.
Transforms a ::fwData::Patient to a fwMedData::Patient.