private void buildFixedExpression(ElementDefinition ed, StringBuilder expression, String discriminator, ElementDefinition criteriaElement) throws DefinitionException { Type fixed = criteriaElement.getFixed(); if (fixed instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) fixed; buildCodeableConceptExpression(ed, expression, discriminator, cc); } else { expression.append(" and (" + discriminator + " = "); if (fixed instanceof StringType) { Gson gson = new Gson(); String json = gson.toJson((StringType)fixed); String escapedString = json.substring(json.indexOf(":")+2); escapedString = escapedString.substring(0, escapedString.indexOf(",\"myStringValue")-1); expression.append("'" + escapedString + "'"); } else if (fixed instanceof UriType) { expression.append("'" + ((UriType)fixed).asStringValue() + "'"); } else if (fixed instanceof IntegerType) { expression.append(((IntegerType)fixed).asStringValue()); } else if (fixed instanceof DecimalType) { expression.append(((IntegerType)fixed).asStringValue()); } else if (fixed instanceof BooleanType) { expression.append(((BooleanType)fixed).asStringValue()); } else throw new DefinitionException("Unsupported fixed value type for discriminator(" + discriminator + ") for slice " + ed.getId() + ": " + fixed.getClass().getName()); expression.append(")"); } }
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!"); } }
public static String readStringExtension(DomainResource c, String uri) { Extension ex = getExtension(c, uri); if (ex == null) return null; if ((ex.getValue() instanceof StringType)) return ((StringType) ex.getValue()).getValue(); if ((ex.getValue() instanceof UriType)) return ((UriType) ex.getValue()).getValue(); if (ex.getValue() instanceof CodeType) return ((CodeType) ex.getValue()).getValue(); if (ex.getValue() instanceof IntegerType) return ((IntegerType) ex.getValue()).asStringValue(); if ((ex.getValue() instanceof MarkdownType)) return ((MarkdownType) ex.getValue()).getValue(); return null; }
public static String readStringExtension(Element c, String uri) { Extension ex = ExtensionHelper.getExtension(c, uri); if (ex == null) return null; if (ex.getValue() instanceof UriType) return ((UriType) ex.getValue()).getValue(); if (ex.getValue() instanceof CanonicalType) return ((CanonicalType) ex.getValue()).getValue(); if (ex.getValue() instanceof CodeType) return ((CodeType) ex.getValue()).getValue(); if (ex.getValue() instanceof IntegerType) return ((IntegerType) ex.getValue()).asStringValue(); if ((ex.getValue() instanceof MarkdownType)) return ((MarkdownType) ex.getValue()).getValue(); if (!(ex.getValue() instanceof StringType)) return null; return ((StringType) ex.getValue()).getValue(); }
"Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.BooleanType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.IntegerType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.IntegerType) fixed).asStringValue(), value), "Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.IntegerType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.DecimalType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.DecimalType) fixed).asStringValue(), value),
private void buildFixedExpression(ElementDefinition ed, StringBuilder expression, String discriminator, ElementDefinition criteriaElement) throws DefinitionException { Type fixed = criteriaElement.getFixed(); if (fixed instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) fixed; buildCodeableConceptExpression(ed, expression, discriminator, cc); } else { expression.append(" and (" + discriminator + " = "); if (fixed instanceof StringType) { Gson gson = new Gson(); String json = gson.toJson((StringType)fixed); String escapedString = json.substring(json.indexOf(":")+2); escapedString = escapedString.substring(0, escapedString.indexOf(",\"myStringValue")-1); expression.append("'" + escapedString + "'"); } else if (fixed instanceof UriType) { expression.append("'" + ((UriType)fixed).asStringValue() + "'"); } else if (fixed instanceof IntegerType) { expression.append(((IntegerType)fixed).asStringValue()); } else if (fixed instanceof DecimalType) { expression.append(((IntegerType)fixed).asStringValue()); } else if (fixed instanceof BooleanType) { expression.append(((BooleanType)fixed).asStringValue()); } else throw new DefinitionException("Unsupported fixed value type for discriminator(" + discriminator + ") for slice " + ed.getId() + ": " + fixed.getClass().getName()); expression.append(")"); } }
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!"); } }
public static String readStringExtension(DomainResource c, String uri) { Extension ex = getExtension(c, uri); if (ex == null) return null; if ((ex.getValue() instanceof StringType)) return ((StringType) ex.getValue()).getValue(); if ((ex.getValue() instanceof UriType)) return ((UriType) ex.getValue()).getValue(); if (ex.getValue() instanceof CodeType) return ((CodeType) ex.getValue()).getValue(); if (ex.getValue() instanceof IntegerType) return ((IntegerType) ex.getValue()).asStringValue(); if ((ex.getValue() instanceof MarkdownType)) return ((MarkdownType) ex.getValue()).getValue(); return null; }
public static String readStringExtension(Element c, String uri) { Extension ex = ExtensionHelper.getExtension(c, uri); if (ex == null) return null; if (ex.getValue() instanceof UriType) return ((UriType) ex.getValue()).getValue(); if (ex.getValue() instanceof CanonicalType) return ((CanonicalType) ex.getValue()).getValue(); if (ex.getValue() instanceof CodeType) return ((CodeType) ex.getValue()).getValue(); if (ex.getValue() instanceof IntegerType) return ((IntegerType) ex.getValue()).asStringValue(); if ((ex.getValue() instanceof MarkdownType)) return ((MarkdownType) ex.getValue()).getValue(); if (!(ex.getValue() instanceof StringType)) return null; return ((StringType) ex.getValue()).getValue(); }
"Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.BooleanType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.IntegerType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.IntegerType) fixed).asStringValue(), value), "Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.IntegerType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.DecimalType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.DecimalType) fixed).asStringValue(), value),