public VariablesForProfiling copy() { VariablesForProfiling result = new VariablesForProfiling(optional, repeating); result.list.addAll(list); return result; }
@Override public TypeDetails resolveConstantType(Object appContext, String name) throws PathEngineException { if (!(appContext instanceof VariablesForProfiling)) throw new Error("Internal Logic Error (wrong type '"+appContext.getClass().getName()+"' in resolveConstantType)"); VariablesForProfiling vars = (VariablesForProfiling) appContext; VariableForProfiling v = vars.get(null, name); if (v == null) throw new PathEngineException("Unknown variable '"+name+"' from variables "+vars.summary()); return v.property.types; }
private VariablesForProfiling analyseSource(String ruleId, TransformContext context, VariablesForProfiling vars, StructureMapGroupRuleSourceComponent src, XhtmlNode td) throws Exception { VariableForProfiling var = vars.get(VariableMode.INPUT, src.getContext()); if (var == null) throw new FHIRException("Rule \""+ruleId+"\": Unknown input variable "+src.getContext()); if (element.getDefinition().getMax().equals("*")) repeating = true; VariablesForProfiling result = vars.copy(optional, repeating); TypeDetails type = new TypeDetails(CollectionStatus.SINGLETON); for (TypeRefComponent tr : element.getDefinition().getType()) { result.add(VariableMode.INPUT, src.getVariable(), new PropertyWithType(prop.getPath()+"."+src.getElement(), element, null, type)); return result; } else { return vars.copy(optional, repeating);
public void add(VariableMode mode, String name, String path, Property property, TypeDetails types) { add(mode, name, new PropertyWithType(path, property, null, types)); }
public void add(VariableMode mode, String name, String path, Property baseProperty, Property profileProperty, TypeDetails types) { add(mode, name, new PropertyWithType(path, baseProperty, profileProperty, types)); }
public VariablesForProfiling copy() { VariablesForProfiling result = new VariablesForProfiling(optional, repeating); result.list.addAll(list); return result; }
private boolean isParamId(VariablesForProfiling vars, StructureMapGroupRuleTargetParameterComponent parameter) { Type p = parameter.getValue(); if (p == null || !(p instanceof IdType)) return false; return vars.get(null, p.primitiveValue()) != null; }
private TypeDetails getParam(VariablesForProfiling vars, StructureMapGroupRuleTargetParameterComponent parameter) throws DefinitionException { Type p = parameter.getValue(); if (!(p instanceof IdType)) return new TypeDetails(CollectionStatus.SINGLETON, ProfileUtilities.sdNs(p.fhirType(), worker.getOverrideVersionNs())); else { String n = ((IdType) p).asStringValue(); VariableForProfiling b = vars.get(VariableMode.INPUT, n); if (b == null) b = vars.get(VariableMode.OUTPUT, n); if (b == null) throw new DefinitionException("Variable "+n+" not found ("+vars.summary()+")"); return b.getProperty().getTypes(); } }
public VariablesForProfiling copy(boolean optional, boolean repeating) { VariablesForProfiling result = new VariablesForProfiling(optional, repeating); result.list.addAll(list); return result; }
@Override public TypeDetails resolveConstantType(Object appContext, String name) throws PathEngineException { if (!(appContext instanceof VariablesForProfiling)) throw new Error("Internal Logic Error (wrong type '"+appContext.getClass().getName()+"' in resolveConstantType)"); VariablesForProfiling vars = (VariablesForProfiling) appContext; VariableForProfiling v = vars.get(null, name); if (v == null) throw new PathEngineException("Unknown variable '"+name+"' from variables "+vars.summary()); return v.property.types; }
private VariablesForProfiling analyseSource(String ruleId, TransformContext context, VariablesForProfiling vars, StructureMapGroupRuleSourceComponent src, XhtmlNode td) throws Exception { VariableForProfiling var = vars.get(VariableMode.INPUT, src.getContext()); if (var == null) throw new FHIRException("Rule \""+ruleId+"\": Unknown input variable "+src.getContext()); if (element.getDefinition().getMax().equals("*")) repeating = true; VariablesForProfiling result = vars.copy(optional, repeating); TypeDetails type = new TypeDetails(CollectionStatus.SINGLETON); for (TypeRefComponent tr : element.getDefinition().getType()) { result.add(VariableMode.INPUT, src.getVariable(), new PropertyWithType(prop.getPath()+"."+src.getElement(), element, null, type)); return result; } else { return vars.copy(optional, repeating);
private TypeDetails getParam(VariablesForProfiling vars, StructureMapGroupRuleTargetParameterComponent parameter) throws DefinitionException { Type p = parameter.getValue(); if (!(p instanceof IdType)) return new TypeDetails(CollectionStatus.SINGLETON, ProfileUtilities.sdNs(p.fhirType(), worker.getOverrideVersionNs())); else { String n = ((IdType) p).asStringValue(); VariableForProfiling b = vars.get(VariableMode.INPUT, n); if (b == null) b = vars.get(VariableMode.OUTPUT, n); if (b == null) throw new DefinitionException("Variable "+n+" not found ("+vars.summary()+")"); return b.getProperty().getTypes(); } }
public void add(VariableMode mode, String name, String path, Property baseProperty, Property profileProperty, TypeDetails types) { add(mode, name, new PropertyWithType(path, baseProperty, profileProperty, types)); }
public VariablesForProfiling copy(boolean optional, boolean repeating) { VariablesForProfiling result = new VariablesForProfiling(optional, repeating); result.list.addAll(list); return result; }
public void add(VariableMode mode, String name, String path, Property property, TypeDetails types) { add(mode, name, new PropertyWithType(path, property, null, types)); }
private boolean isParamId(VariablesForProfiling vars, StructureMapGroupRuleTargetParameterComponent parameter) { Type p = parameter.getValue(); if (p == null || !(p instanceof IdType)) return false; return vars.get(null, p.primitiveValue()) != null; }