use of com.nedap.archie.rm.support.identification.ArchetypeID in project openEHR_SDK by ehrbase.
the class ToCompositionWalker method postHandle.
@Override
protected void postHandle(Context<T> context) {
RMObject currentRM = context.getRmObjectDeque().peek();
WebTemplateNode currentNode = context.getNodeDeque().peek();
if (currentRM instanceof Locatable) {
org.ehrbase.webtemplate.parser.NodeId nodeId = new NodeId(currentNode.getNodeId());
if (nodeId.isArchetypeId()) {
Archetyped archetyped = new Archetyped();
archetyped.setArchetypeId(new ArchetypeID(nodeId.getNodeId()));
archetyped.setRmVersion(RM_VERSION_1_4_0);
TemplateId templateId = new TemplateId();
templateId.setValue(context.getTemplateId());
archetyped.setTemplateId(templateId);
((Locatable) currentRM).setArchetypeDetails(archetyped);
((Locatable) currentRM).setArchetypeNodeId(nodeId.getNodeId());
}
}
normalise(currentRM);
}
use of com.nedap.archie.rm.support.identification.ArchetypeID in project openEHR_SDK by ehrbase.
the class WebTemplateSkeletonBuilder method build.
public static Composition build(WebTemplate template, boolean withChildren) {
Composition composition = build(template.getTree(), withChildren, Composition.class);
composition.setArchetypeDetails(new Archetyped());
composition.getArchetypeDetails().setTemplateId(new TemplateId());
composition.getArchetypeDetails().getTemplateId().setValue(template.getTemplateId());
composition.getArchetypeDetails().setRmVersion(RM_VERSION_1_4_0);
composition.getArchetypeDetails().setArchetypeId(new ArchetypeID(composition.getArchetypeNodeId()));
return composition;
}
use of com.nedap.archie.rm.support.identification.ArchetypeID in project ehrbase by ehrbase.
the class EntryAccess method buildArchetypeDetails.
private static void buildArchetypeDetails(EntryAccess entryAccess) {
Archetyped archetypeDetails = new Archetyped();
TemplateId templateId = new TemplateId();
templateId.setValue(entryAccess.getTemplateId());
archetypeDetails.setTemplateId(templateId);
archetypeDetails.setArchetypeId(new ArchetypeID(entryAccess.getArchetypeId()));
archetypeDetails.setRmVersion(entryAccess.getRmVersion());
entryAccess.composition.setArchetypeDetails(archetypeDetails);
}
Aggregations