return getElementDefinitionById(sd, ed.getContentReference()); } else return new ElementDefinitionMatch(ed, null); return new ElementDefinitionMatch(ed, null); if (allowTypedName && ed.getPath().endsWith("[x]") && path.startsWith(ed.getPath().substring(0, ed.getPath().length()-3)) && path.length() > ed.getPath().length()-3) { String s = Utilities.uncapitalize(path.substring(ed.getPath().length()-3)); if (primitiveTypes.contains(s)) return new ElementDefinitionMatch(ed, s); else return new ElementDefinitionMatch(ed, path.substring(ed.getPath().length()-3));
if (!Utilities.noString(ed.getFixedType())) result.addType(ed.getFixedType()); else for (TypeRefComponent t : ed.getDefinition().getType()) { if (Utilities.noString(t.getCode())) { if (Utilities.existsInList(ed.getDefinition().getId(), "Element.id", "Extension.url")) result.addType(TypeDetails.FP_NS, "string"); break; // throw new PathEngineException("Illegal reference to primitive value attribute @ "+path); if (t.hasProfile()) pt.addProfiles(t.getProfile()); if (ed.getDefinition().hasBinding()) pt.addBinding(ed.getDefinition().getBinding()); result.addType(pt);
if (!Utilities.noString(ed.getFixedType())) result.addType(ed.getFixedType()); else for (TypeRefComponent t : ed.getDefinition().getType()) { if (Utilities.noString(t.getCode())) { if (Utilities.existsInList(ed.getDefinition().getId(), "Element.id", "Extension.url")) result.addType(TypeDetails.FP_NS, "string"); break; // throw new PathEngineException("Illegal reference to primitive value attribute @ "+path); if (t.hasProfile()) pt.addProfiles(t.getProfile()); if (ed.getDefinition().hasBinding()) pt.addBinding(ed.getDefinition().getBinding()); result.addType(pt);
if (ed.fixedType != null) types = new TypeDetails(CollectionStatus.SINGLETON, ed.fixedType); else if (ed.getDefinition().getType().isEmpty() || isAbstractType(ed.getDefinition().getType())) types = new TypeDetails(CollectionStatus.SINGLETON, ctxt+"#"+context); else { types = new TypeDetails(CollectionStatus.SINGLETON); for (TypeRefComponent t : ed.getDefinition().getType()) types.addType(t.getCode());
return getElementDefinitionById(sd, ed.getContentReference()); } else return new ElementDefinitionMatch(ed, null); return new ElementDefinitionMatch(ed, null); if (allowTypedName && ed.getPath().endsWith("[x]") && path.startsWith(ed.getPath().substring(0, ed.getPath().length()-3)) && path.length() > ed.getPath().length()-3) { String s = Utilities.uncapitalize(path.substring(ed.getPath().length()-3)); if (primitiveTypes.contains(s)) return new ElementDefinitionMatch(ed, s); else return new ElementDefinitionMatch(ed, path.substring(ed.getPath().length()-3));
public TypeDetails check(Object appContext, StructureDefinition sd, String context, ExpressionNode expr) throws FHIRLexerException, PathEngineException, DefinitionException { // if context is a path that refers to a type, do that conversion now TypeDetails types; if (!context.contains(".")) { types = new TypeDetails(CollectionStatus.SINGLETON, sd.getUrl()); } else { ElementDefinitionMatch ed = getElementDefinition(sd, context, true); if (ed == null) throw new PathEngineException("Unknown context element "+context); if (ed.fixedType != null) types = new TypeDetails(CollectionStatus.SINGLETON, ed.fixedType); else if (ed.getDefinition().getType().isEmpty() || isAbstractType(ed.getDefinition().getType())) types = new TypeDetails(CollectionStatus.SINGLETON, sd.getUrl()+"#"+context); else { types = new TypeDetails(CollectionStatus.SINGLETON); for (TypeRefComponent t : ed.getDefinition().getType()) types.addType(t.getCode()); } } return executeType(new ExecutionTypeContext(appContext, sd.getUrl(), types, types), types, expr, true); }
private ElementDefinitionMatch getElementDefinitionById(StructureDefinition sd, String ref) { for (ElementDefinition ed : sd.getSnapshot().getElement()) { if (ref.equals("#"+ed.getId())) return new ElementDefinitionMatch(ed, null); } return null; }
if (ed.fixedType != null) types = new TypeDetails(CollectionStatus.SINGLETON, ed.fixedType); else if (ed.getDefinition().getType().isEmpty() || isAbstractType(ed.getDefinition().getType())) types = new TypeDetails(CollectionStatus.SINGLETON, ctxt+"#"+context); else { types = new TypeDetails(CollectionStatus.SINGLETON); for (TypeRefComponent t : ed.getDefinition().getType()) types.addType(t.getCode());
public TypeDetails check(Object appContext, StructureDefinition sd, String context, ExpressionNode expr) throws FHIRLexerException, PathEngineException, DefinitionException { // if context is a path that refers to a type, do that conversion now TypeDetails types; if (!context.contains(".")) { types = new TypeDetails(CollectionStatus.SINGLETON, sd.getUrl()); } else { ElementDefinitionMatch ed = getElementDefinition(sd, context, true); if (ed == null) throw new PathEngineException("Unknown context element "+context); if (ed.fixedType != null) types = new TypeDetails(CollectionStatus.SINGLETON, ed.fixedType); else if (ed.getDefinition().getType().isEmpty() || isAbstractType(ed.getDefinition().getType())) types = new TypeDetails(CollectionStatus.SINGLETON, sd.getUrl()+"#"+context); else { types = new TypeDetails(CollectionStatus.SINGLETON); for (TypeRefComponent t : ed.getDefinition().getType()) types.addType(t.getCode()); } } return executeType(new ExecutionTypeContext(appContext, sd.getUrl(), types, types), types, expr, true); }
private ElementDefinitionMatch getElementDefinitionById(StructureDefinition sd, String ref) { for (ElementDefinition ed : sd.getSnapshot().getElement()) { if (ref.equals("#"+ed.getId())) return new ElementDefinitionMatch(ed, null); } return null; }