use of com.nedap.archie.rm.composition.IsmTransition in project openEHR_SDK by ehrbase.
the class ActionAttributes method toMap.
public Map<String, Object> toMap(Action action) {
if (action.getTime() != null && !action.getTime().equals(new DvDateTime())) {
map = toMap(TAG_TIME, action.getTime(), action.getName());
}
if (action.getInstructionDetails() != null) {
InstructionDetails instructionDetails = action.getInstructionDetails();
map.put(TAG_INSTRUCTION_DETAILS, new RmObjectEncoding(instructionDetails).toMap());
}
if (action.getIsmTransition() != null) {
IsmTransition ismTransition = action.getIsmTransition();
if (ismTransition != null) {
map.put(TAG_ISM_TRANSITION, new RmObjectEncoding(ismTransition).toMap());
}
}
map = super.toMap(action);
return map;
}
use of com.nedap.archie.rm.composition.IsmTransition in project openEHR_SDK by ehrbase.
the class ActionValueInserter method insert.
@Override
public void insert(Action rmObject, DefaultValues defaultValues) {
if (RMHelper.isEmpty(rmObject.getTime()) && (defaultValues.containsDefaultValue(DefaultValuePath.TIME) || defaultValues.containsDefaultValue(DefaultValuePath.ACTION_TIME))) {
TemporalAccessor defaultTemporalAccessor = Stream.of(DefaultValuePath.ACTION_TIME, DefaultValuePath.TIME).map(defaultValues::getDefaultValue).filter(Objects::nonNull).findFirst().orElseThrow();
rmObject.setTime(new DvDateTime(defaultTemporalAccessor));
}
if (rmObject.getIsmTransition() == null) {
rmObject.setIsmTransition(new IsmTransition());
}
new IsmTransitionValueInserter().insert(rmObject.getIsmTransition(), defaultValues);
if (RMHelper.isEmpty(rmObject.getIsmTransition())) {
rmObject.setIsmTransition(null);
}
}
Aggregations