private boolean valueMatchesCriteria(Element value, ElementDefinition criteria) throws FHIRException { if (criteria.hasFixed()) { List<ValidationMessage> msgs = new ArrayList<ValidationMessage>(); checkFixedValue(msgs, "{virtual}", value, criteria.getFixed(), "value", null); return msgs.size() == 0; } else if (criteria.hasBinding() && criteria.getBinding().getStrength() == BindingStrength.REQUIRED && criteria.getBinding().hasValueSet()) { throw new FHIRException("Unable to resolve slice matching - slice matching by value set not done"); } else { throw new FHIRException("Unable to resolve slice matching - no fixed value or required value set"); } }
if (c.getPath().endsWith(".url") && c.hasFixed() && c.getFixed() instanceof UriType && ((UriType)c.getFixed()).equals(qualifier)) { found = true; break; if (c.getPath().endsWith(".url") && c.hasFixed() && c.getFixed() instanceof UriType && ((UriType)c.getFixed()).equals(qualifier)) { found = true; ed = t;
} else if (criteriaElement.hasFixed()) { expression = expression + " and " + discriminator + " = "; Type fixed = criteriaElement.getFixed(); if (fixed instanceof StringType) { Gson gson = new Gson();
checkFixedValue(errors,path,e, context.getFixed(), context.getSliceName(), null);
@Override public Type getExampleValue(ElementDefinition ed) { if (ed.hasFixed()) return ed.getFixed(); if (ed.hasExample()) return ed.getExample().get(0).getValue(); else return null; }
@Override public Type getExampleValue(ElementDefinition ed) { if (ed.hasFixed()) return ed.getFixed(); for (Extension ex : ed.getExtension()) { String ndx = ToolingExtensions.readStringExtension(ex, "index"); Type value = ToolingExtensions.getExtension(ex, "exValue").getValue(); if (index.equals(ndx) && value != null) return value; } return null; } @Override
private boolean valueMatchesCriteria(Element value, ElementDefinition criteria) throws FHIRException { if (criteria.hasFixed()) { List<ValidationMessage> msgs = new ArrayList<ValidationMessage>(); checkFixedValue(msgs, "{virtual}", value, criteria.getFixed(), "value", null); return msgs.size() == 0; } else if (criteria.hasBinding() && criteria.getBinding().getStrength() == BindingStrength.REQUIRED && criteria.getBinding().hasValueSet()) { throw new FHIRException("Unable to resolve slice matching - slice matching by value set not done"); } else { throw new FHIRException("Unable to resolve slice matching - no fixed value or required value set"); } }
private Slicer generateSlicer(ElementDefinition child, ElementDefinitionSlicingComponent slicing, StructureDefinition structure) { // given a child in a structure, it's sliced. figure out the slicing xpath if (child.getPath().endsWith(".extension")) { ElementDefinition ued = getUrlFor(structure, child); if ((ued == null || !ued.hasFixed()) && !(child.hasType() && (child.getType().get(0).hasProfile()))) return new Slicer(false); else { Slicer s = new Slicer(true); String url = (ued == null || !ued.hasFixed()) ? child.getType().get(0).getProfile() : ((UriType) ued.getFixed()).asStringValue(); s.name = " with URL = '"+url+"'"; s.criteria = "[@url = '"+url+"']"; return s; } } else return new Slicer(false); }
tgt.setDefaultValue(convertType(src.getDefaultValue())); tgt.setMeaningWhenMissing(src.getMeaningWhenMissing()); tgt.setFixed(convertType(src.getFixed())); tgt.setPattern(convertType(src.getPattern())); if (src.hasExample())
if (src.hasMeaningWhenMissing()) tgt.setMeaningWhenMissing(src.getMeaningWhenMissing()); tgt.setFixed(convertType(src.getFixed())); tgt.setPattern(convertType(src.getPattern())); if (src.hasExample())
b.append(summarise(ed.getFixed()));
c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "\""+buildJson(definition.getFixed())+"\"", null).addStyle("color: darkgreen"))); } else { if (url != null) { c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, buildJson(definition.getFixed()), null).addStyle("color: darkgreen"))); } else if (definition.hasPattern()) { if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br"));
Row r1 = gen.new Row(); r.getSubRows().add(r1); r1.getCells().add(gen.new Cell(null, defFile == null ? "" : defFile+"-definitions.html#extension."+ed.getName(), ((UriType) ued.getFixed()).getValue(), null, null)); r1.getCells().add(gen.new Cell()); r1.getCells().add(gen.new Cell(null, null, describeCardinality(c, null, new UnusedTracker()), null, null));
checkFixedValue(errors,path,e, context.getFixed(), context.getSliceName(), null);
line.addString(ed.getDefaultValue()!=null ? renderType(ed.getDefaultValue()) : ""); line.addString(ed.getMeaningWhenMissing()); line.addString(ed.hasFixed() ? renderType(ed.getFixed()) : ""); line.addString(ed.hasPattern() ? renderType(ed.getPattern()) : ""); line.addString(ed.hasExample() ? renderType(ed.getExample().get(0).getValue()) : ""); // todo...?
res.setFixed(usage.getFixed()); if (usage.hasPattern()) res.setPattern(usage.getPattern());
tgt.setDefaultValue(convertType(src.getDefaultValue())); tgt.setMeaningWhenMissing(src.getMeaningWhenMissing()); tgt.setFixed(convertType(src.getFixed())); tgt.setPattern(convertType(src.getPattern())); if (src.hasExample())
if (src.hasMeaningWhenMissing()) tgt.setMeaningWhenMissing(src.getMeaningWhenMissing()); tgt.setFixed(convertType(src.getFixed())); tgt.setPattern(convertType(src.getPattern())); if (src.hasExample())