diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java index 97d851c94..327bf0d05 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java @@ -61,6 +61,7 @@ import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.utils.FHIRLexer.FHIRLexerException; import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext.FunctionDetails; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; +import org.hl7.fhir.utilities.MarkDownProcessor; import org.hl7.fhir.utilities.MergedList; import org.hl7.fhir.utilities.MergedList.MergeNode; import org.hl7.fhir.utilities.SourceLocation; @@ -4173,6 +4174,10 @@ public class FHIRPathEngine { result.add(new StringType(Utilities.escapeXml(cnt))); } else if ("json".equals(param)) { result.add(new StringType(Utilities.escapeJson(cnt))); + } else if ("url".equals(param)) { + result.add(new StringType(Utilities.URLEncode(cnt))); + } else if ("md".equals(param)) { + result.add(new StringType(MarkDownProcessor.makeStringSafeAsMarkdown(cnt))); } } @@ -4190,6 +4195,10 @@ public class FHIRPathEngine { result.add(new StringType(Utilities.unescapeXml(cnt))); } else if ("json".equals(param)) { result.add(new StringType(Utilities.unescapeJson(cnt))); + } else if ("url".equals(param)) { + result.add(new StringType(Utilities.URLDecode(cnt))); + } else if ("md".equals(param)) { + result.add(new StringType(MarkDownProcessor.makeMarkdownForString(cnt))); } } @@ -4222,9 +4231,14 @@ public class FHIRPathEngine { private List funcJoin(ExecutionContext context, List focus, ExpressionNode exp) { List nl = execute(context, focus, exp.getParameters().get(0), true); String param = nl.get(0).primitiveValue(); - + String param2 = param; + if (exp.getParameters().size() == 2) { + nl = execute(context, focus, exp.getParameters().get(1), true); + param2 = nl.get(0).primitiveValue(); + } + List result = new ArrayList(); - CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(param); + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(param, param2); for (Base i : focus) { b.append(i.primitiveValue()); }