private Base getParam(Variables vars, StructureMapGroupRuleTargetParameterComponent parameter) throws DefinitionException { Type p = parameter.getValue(); if (!(p instanceof IdType)) return p; else { String n = ((IdType) p).asStringValue(); Base 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; } }
private static void renderTransformParam(StringBuilder b, StructureMapGroupRuleTargetParameterComponent rtp) { try { if (rtp.hasValueBooleanType()) b.append(rtp.getValueBooleanType().asStringValue()); else if (rtp.hasValueDecimalType()) b.append(rtp.getValueDecimalType().asStringValue()); else if (rtp.hasValueIdType()) b.append(rtp.getValueIdType().asStringValue()); else if (rtp.hasValueDecimalType()) b.append(rtp.getValueDecimalType().asStringValue()); else if (rtp.hasValueIntegerType()) b.append(rtp.getValueIntegerType().asStringValue()); else b.append("\""+Utilities.escapeJava(rtp.getValueStringType().asStringValue())+"\""); } catch (FHIRException e) { e.printStackTrace(); b.append("error!"); } }
b.append(rt.getTransform().toCode()); b.append("("); b.append(((IdType) rt.getParameter().get(0).getValue()).asStringValue()); b.append("\""+((StringType) rt.getParameter().get(1).getValue()).asStringValue()+"\""); b.append(")");
private TypeDetails getParam(VariablesForProfiling vars, StructureMapGroupRuleTargetParameterComponent parameter) throws DefinitionException { Type p = parameter.getValue(); if (!(p instanceof IdType)) return new TypeDetails(CollectionStatus.SINGLETON, "http://hl7.org/fhir/StructureDefinition/"+p.fhirType()); 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(); } }
Base b = getParam(vars, tgt.getParameter().get(0)); if (b == null) throw new FHIRException("Rule \""+ruleId+"\": Unable to find parameter "+((IdType) tgt.getParameter().get(0).getValue()).asStringValue()); if (!b.isResource()) throw new FHIRException("Rule \""+ruleId+"\": Transform engine cannot point at an element of type "+b.fhirType());
for (StructureMapGroupRuleTargetParameterComponent p : tgt.getParameter()) { Type pr = p.getValue(); if (pr instanceof IdType && ((IdType) pr).asStringValue().equals(tv)) mapsSrc = true;