7 #include <fwTools/UUID.hpp> 9 #include <fwAtoms/Object.hpp> 10 #include <fwAtoms/Object.hxx> 11 #include <fwAtoms/String.hpp> 13 #include <fwAtomsPatch/helper/functions.hpp> 15 #include "fwMDSemanticPatch/V1/V2/fwData/Acquisition.hpp" 48 const ::fwAtoms::Object::sptr& previous,
49 const ::fwAtoms::Object::sptr& current,
50 ::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
52 ISemanticPatch::apply(previous, current, newVersions);
53 ::fwAtomsPatch::helper::cleanFields( current );
55 ::fwAtoms::Object::sptr image = current->getAttribute<
::fwAtoms::Object >(
"image");
56 ::fwAtoms::Map::sptr fields = image->getAttribute<
::fwAtoms::Map >(
"fields");
58 ::fwAtoms::Map::ConstIteratorType it = fields->find(
"m_commentId");
60 if ( it != fields->end() )
62 ::fwAtoms::Object::sptr value = ::fwAtoms::Object::dynamicCast( it->second );
66 ::fwAtoms::String::sptr uid = current->getAttribute<
::fwAtoms::String >(
"instance_uid");
67 if( uid->getValue().empty() )
Contains the semantic patches within the context "MedicalData".
FWMDSEMANTICPATCH_API ~Acquisition()
Destructor.
static FWATOMS_API String::sptr New(std::string value)
Construct a new Object represented a string.
virtual FWMDSEMANTICPATCH_API void apply(const ::fwAtoms::Object::sptr &previous, const ::fwAtoms::Object::sptr ¤t,::fwAtomsPatch::IPatch::NewVersionsType &newVersions) override
Applies patch.
Contains base functionalities used to transform objects from a version to another.
Class represented a fwData::Object.
std::string m_originClassname
Origin classname of the object.
virtual FWATOMSPATCH_API void addContext(const std::string &context, const std::string &originVersion, const std::string &targetVersion)
Add a context where the patch can be applied.
FWATOMSPATCH_API void replaceAttribute(const std::string &name,::fwAtoms::Base::sptr newValue, conditions::Abstract::sptr condition=conditions::Abstract::New())
Replaces an attribute.
Map is a container for mapping representation.
std::string m_originVersion
Origin version of the object.
FWMDSEMANTICPATCH_API Acquisition()
Constructor.
FWATOMSPATCH_API ISemanticPatch()
Constructor.
Patch an acquisition from version 'V1' to 'V2' within 'MedicalData' context.
Contains the representation of the data objects used in the framework.
Class represented a String.