/** * Checks the archetype definition typename validity: The topmost typename mentioned * in the archetype definition section must match the type mentioned in the type-name * slot of the first segment of the archetype id. * * @param archetype * @param errors */ public void checkArchetypeDefinitionTypename(Archetype archetype, List<ValidationError> errors) { String conceptType = archetype.getArchetypeId().rmEntity(); String topType = archetype.getDefinition().getRmTypeName(); ValidationError error = null; if (!conceptType.equals(topType)) { error = new ValidationError(ErrorType.VARDT, null, topType, conceptType); errors.add(error); } }
public void loadArchetypeObjects() { String archId = ar.getArchetypeId().getValue(); String rmEntry = ar.getArchetypeId().rmEntity(); processCObject(ar.getDefinition()); Collection<ArchetypeElementVO> rmArchetypeElements = OpenEHRRMUtil.getRMElements(archId, templateId, rmEntry); for (ClusterVO clusterVO : clusterVOs) { if (OpenEHRConst.isEntry(clusterVO.getType()) && !clusterVO.getPath().equals("/")) { rmArchetypeElements.addAll(OpenEHRRMUtil.getRMElements(archId, templateId, clusterVO.getType(), clusterVO.getPath())); } } clusterVOs.addAll(OpenEHRRMUtil.getRMClusters(archId, templateId, rmEntry)); archetypeElementVOs.addAll(rmArchetypeElements); }