use of org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent in project org.hl7.fhir.core by hapifhir.
the class StructureMap30_50 method convertStructureMapGroupRuleDependentComponent.
public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent();
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(Id30_50.convertId(src.getNameElement()));
for (StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addVariable(t.getValue().primitiveValue());
return tgt;
}
use of org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent in project org.hl7.fhir.core by hapifhir.
the class StructureMap40_50 method convertStructureMapGroupRuleDependentComponent.
// DIRTY
public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent();
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(Id40_50.convertId(src.getNameElement()));
for (StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) {
tgt.getVariable().add(convertStructureMapGroupRuleTargetParameterComponentToString(t));
}
return tgt;
}
use of org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent in project org.hl7.fhir.core by hapifhir.
the class StructureMapUtilities method translate.
private Base translate(TransformContext context, StructureMap map, Variables vars, List<StructureMapGroupRuleTargetParameterComponent> parameter) throws FHIRException {
Base src = getParam(vars, parameter.get(0));
String id = getParamString(vars, parameter.get(1));
String fld = getParamString(vars, parameter.get(2));
return translate(context, map, src, id, fld);
}
use of org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent in project org.hl7.fhir.core by hapifhir.
the class StructureMapUtilities method renderTarget.
private static void renderTarget(StringBuilder b, StructureMapGroupRuleTargetComponent rt, boolean abbreviate) {
if (rt.hasContext()) {
if (rt.getContextType() == StructureMapContextType.TYPE)
b.append("@");
b.append(rt.getContext());
if (rt.hasElement()) {
b.append('.');
b.append(rt.getElement());
}
}
if (!abbreviate && rt.hasTransform()) {
if (rt.hasContext())
b.append(" = ");
if (rt.getTransform() == StructureMapTransform.COPY && rt.getParameter().size() == 1) {
renderTransformParam(b, rt.getParameter().get(0));
} else if (rt.getTransform() == StructureMapTransform.EVALUATE && rt.getParameter().size() == 1) {
b.append("(");
b.append("\"" + ((StringType) rt.getParameter().get(0).getValue()).asStringValue() + "\"");
b.append(")");
} else if (rt.getTransform() == StructureMapTransform.EVALUATE && rt.getParameter().size() == 2) {
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(")");
} else {
b.append(rt.getTransform().toCode());
b.append("(");
boolean first = true;
for (StructureMapGroupRuleTargetParameterComponent rtp : rt.getParameter()) {
if (first)
first = false;
else
b.append(", ");
renderTransformParam(b, rtp);
}
b.append(")");
}
}
if (!abbreviate && rt.hasVariable()) {
b.append(" as ");
b.append(rt.getVariable());
}
for (Enumeration<StructureMapTargetListMode> lm : rt.getListMode()) {
b.append(" ");
b.append(lm.getValue().toCode());
if (lm.getValue() == StructureMapTargetListMode.SHARE) {
b.append(" ");
b.append(rt.getListRuleId());
}
}
}
use of org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent in project org.hl7.fhir.core by hapifhir.
the class StructureMapUtilities method paramToString.
public static String paramToString(StructureMapGroupRuleTargetParameterComponent rtp) {
StringBuilder b = new StringBuilder();
renderTransformParam(b, rtp);
return b.toString();
}
Aggregations