use of com.nedap.archie.rm.datavalues.encapsulated.DvParsable in project openEHR_SDK by ehrbase.
the class FeederAuditConfig method buildChildValues.
/**
* {@inheritDoc}
*/
@Override
public Map<String, Object> buildChildValues(String currentTerm, FeederAudit rmObject, Context<Map<String, Object>> context) {
Map<String, Object> result = new HashMap<>();
if (rmObject.getOriginalContent() instanceof DvParsable) {
result.putAll(DV_PARSABLE_CONFIG.buildChildValues(currentTerm + "/original_content", (DvParsable) rmObject.getOriginalContent(), context));
} else if (rmObject.getOriginalContent() instanceof DvMultimedia) {
result.putAll(DV_MULTIMEDIA_CONFIG.buildChildValues(currentTerm + "/original_content_multimedia", (DvMultimedia) rmObject.getOriginalContent(), context));
}
IntStream.range(0, rmObject.getFeederSystemItemIds().size()).forEach(i -> {
DvIdentifier identifier = rmObject.getFeederSystemItemIds().get(i);
result.putAll(DV_IDENTIFIER_CONFIG.buildChildValues(currentTerm + "/feeder_system_item_id:" + i, identifier, context));
});
IntStream.range(0, rmObject.getOriginatingSystemItemIds().size()).forEach(i -> {
DvIdentifier identifier = rmObject.getOriginatingSystemItemIds().get(i);
result.putAll(DV_IDENTIFIER_CONFIG.buildChildValues(currentTerm + "/originating_system_item_id:" + i, identifier, context));
});
if (rmObject.getOriginatingSystemAudit() != null) {
result.putAll(FEEDER_AUDI_DETAILS_STD_CONFIG.buildChildValues(currentTerm + "/originating_system_audit", rmObject.getOriginatingSystemAudit(), context));
}
return result;
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvParsable in project openEHR_SDK by ehrbase.
the class InstructionPostprocessor method process.
/**
* {@inheritDoc}
*/
@Override
public void process(String term, Instruction rmObject, Map<FlatPathDto, String> values, Set<String> consumedPaths, Context<Map<FlatPathDto, String>> context) {
Map<FlatPathDto, String> wfDefinition = values.entrySet().stream().filter(e -> e.getKey().startsWith(term + PATH_DIVIDER + "_wf_definition")).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
if (!wfDefinition.isEmpty()) {
rmObject.setWfDefinition(new DvParsable());
handleRmAttribute(term, rmObject.getWfDefinition(), wfDefinition, consumedPaths, context, "wf_definition");
}
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvParsable in project openEHR_SDK by ehrbase.
the class ActivityValueInserter method insert.
@Override
public void insert(Activity rmObject, DefaultValues defaultValues) {
if (RMHelper.isEmpty(rmObject.getTiming()) && defaultValues.containsDefaultValue(DefaultValuePath.ACTIVITY_TIMING)) {
if (rmObject.getTiming() == null) {
rmObject.setTiming(new DvParsable());
}
rmObject.getTiming().setValue(defaultValues.getDefaultValue(DefaultValuePath.ACTIVITY_TIMING));
rmObject.getTiming().setFormalism("timing");
}
if (rmObject.getTiming() != null && rmObject.getTiming().getFormalism() == null) {
// default
rmObject.getTiming().setFormalism("timing");
}
if (rmObject.getActionArchetypeId() == null) {
rmObject.setActionArchetypeId("/.*/");
}
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvParsable in project openEHR_SDK by ehrbase.
the class FeederAuditRMUnmarshaller method handle.
@Override
public void handle(String currentTerm, FeederAudit rmObject, Map<FlatPathDto, String> currentValues, Context<Map<FlatPathDto, String>> context, Set<String> consumedPaths) {
Map<FlatPathDto, String> originalContentValues = FlatHelper.filter(currentValues, currentTerm + "/original_content", false);
if (!originalContentValues.isEmpty()) {
rmObject.setOriginalContent(new DvParsable());
DV_PARSABLE_RM_UNMARSHALLER.handle(currentTerm + "/original_content", (DvParsable) rmObject.getOriginalContent(), originalContentValues, context, consumedPaths);
}
Map<FlatPathDto, String> originalContentMultimediaValues = FlatHelper.filter(currentValues, currentTerm + "/original_content_multimedia", false);
if (!originalContentMultimediaValues.isEmpty()) {
rmObject.setOriginalContent(new DvMultimedia());
DV_MULTIMEDIA_RM_UNMARSHALLER.handle(currentTerm + "/original_content_multimedia", (DvMultimedia) rmObject.getOriginalContent(), originalContentMultimediaValues, context, consumedPaths);
}
Map<FlatPathDto, String> originatingSystemAuditValues = FlatHelper.filter(currentValues, currentTerm + "/originating_system_audit", false);
if (!originatingSystemAuditValues.isEmpty()) {
rmObject.setOriginatingSystemAudit(new FeederAuditDetails());
FEEDER_AUDIT_DETAILS_RM_UNMARSHALLER.handle(currentTerm + "/originating_system_audit", rmObject.getOriginatingSystemAudit(), currentValues, context, consumedPaths);
}
Map<Integer, Map<String, String>> feederSystemIds = extractMultiValued(currentTerm, "feeder_system_item_id", currentValues);
rmObject.getFeederSystemItemIds().addAll(feederSystemIds.values().stream().map(DefaultValues::toDvIdentifier).collect(Collectors.toList()));
consumeAllMatching(currentTerm + PATH_DIVIDER + "feeder_system_item_id", currentValues, consumedPaths, false);
Map<Integer, Map<String, String>> originatingSystemIds = extractMultiValued(currentTerm, "originating_system_item_id", currentValues);
rmObject.getOriginatingSystemItemIds().addAll(originatingSystemIds.values().stream().map(DefaultValues::toDvIdentifier).collect(Collectors.toList()));
consumeAllMatching(currentTerm + PATH_DIVIDER + "originating_system_item_id", currentValues, consumedPaths, false);
}
Aggregations