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"); } }
} else throw new DefinitionException("Unsupported fixed value type for discriminator(" + discriminator + ") for slice " + ed.getId() + ": " + fixed.getClass().getName()); } else if (criteriaElement.hasBinding() && criteriaElement.getBinding().hasStrength() && criteriaElement.getBinding().getStrength().equals(BindingStrength.REQUIRED) && criteriaElement.getBinding().getValueSetReference()!=null) { expression = expression + " and " + discriminator + " in '" + criteriaElement.getBinding().getValueSetReference().getReference() + "'"; } else if (criteriaElement.hasMin() && criteriaElement.getMin()>0) { expression = expression + " and " + discriminator + ".exists()";
ElementDefinitionBindingComponent binding = elementContext.getBinding(); if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) { ValueSet vs = resolveBindingReference(profile, binding.getValueSet(), profile.getUrl());
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 (checkCode(errors, element, path, code, system, display)) if (theElementCntext != null && theElementCntext.hasBinding()) { ElementDefinitionBindingComponent binding = theElementCntext.getBinding(); if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, binding != null, "Binding for " + path + " missing")) { if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) {
private void checkCodeableConcept(List<ValidationMessage> errors, String path, Element element, StructureDefinition profile, ElementDefinition theElementCntext) { if (!noTerminologyChecks && theElementCntext != null && theElementCntext.hasBinding()) { ElementDefinitionBindingComponent binding = theElementCntext.getBinding(); if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, binding != null, "Binding for " + path + " missing (cc)")) { if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) {
/** * Finds internal references in an Element's Binding and StructureDefinition references (in TypeRef) and bases them on the given url * @param url - the base url to use to turn internal references into absolute references * @param element - the Element to update * @return - the updated Element */ private ElementDefinition updateURLs(String url, ElementDefinition element) { if (element != null) { ElementDefinition defn = element; if (defn.hasBinding() && defn.getBinding().getValueSet() instanceof Reference && ((Reference)defn.getBinding().getValueSet()).getReference().startsWith("#")) ((Reference)defn.getBinding().getValueSet()).setReference(url+((Reference)defn.getBinding().getValueSet()).getReference()); for (TypeRefComponent t : defn.getType()) { if (t.hasProfile()) { if (t.getProfile().startsWith("#")) t.setProfile(url+t.getProfile()); } if (t.hasTargetProfile()) { if (t.getTargetProfile().startsWith("#")) t.setTargetProfile(url+t.getTargetProfile()); } } } return element; }
} else throw new DefinitionException("Unsupported fixed value type for discriminator(" + discriminator + ") for slice " + ed.getId() + ": " + fixed.getClass().getName()); } else if (criteriaElement.hasBinding() && criteriaElement.getBinding().hasStrength() && criteriaElement.getBinding().getStrength().equals(BindingStrength.REQUIRED) && criteriaElement.getBinding().getValueSetReference()!=null) { expression = expression + " and " + discriminator + " in '" + criteriaElement.getBinding().getValueSetReference().getReference() + "'"; } else if (criteriaElement.hasMin() && criteriaElement.getMin()>0) { expression = expression + " and " + discriminator + ".exists()";
tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertElementDefinitionMappingComponent(t));
tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertElementDefinitionMappingComponent(t));
if (!full && !(deep || vdeep) && ved != null && ved.hasBinding()) { c.addPiece(gen.new Piece("br")); BindingResolution br = pkp.resolveBinding(ed, ved.getBinding(), ved.getPath()); c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !pkp.prependLinks() ? br.url : corePath+br.url, br.display, null))); if (ved.getBinding().hasStrength()) { c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, " (", null))); c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(corePath+"terminologies.html#"+ved.getBinding().getStrength().toCode(), egt(ved.getBinding().getStrengthElement()), ved.getBinding().getStrength().getDefinition()))); c.getPieces().add(gen.new Piece(null, ")", null));
ElementDefinitionBindingComponent binding = elementContext.getBinding(); if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) { ValueSet vs = resolveBindingReference(profile, binding.getValueSet(), profile.getUrl());
line.addValue((ed.hasMaxLength() ? Integer.toString(ed.getMaxLength()) : "")); if (ed.hasBinding()) { line.addString(ed.getBinding().getStrength()!=null ? ed.getBinding().getStrength().toCode() : ""); line.addString(ed.getBinding().getDescription()); if (ed.getBinding().getValueSet()==null) line.addString(""); else if (ed.getBinding().getValueSet() instanceof Reference) line.addString(ed.getBinding().getValueSetReference().getReference()); else line.addString(ed.getBinding().getValueSetUriType().getValue()); } else { line.addValue("");
pt.addProfile(tr.getProfile()); if (element.getDefinition().hasBinding()) pt.addBinding(element.getDefinition().getBinding()); type.addType(pt);
if (checkCode(errors, element, path, code, system, display)) if (theElementCntext != null && theElementCntext.hasBinding()) { ElementDefinitionBindingComponent binding = theElementCntext.getBinding(); if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, binding != null, "Binding for " + path + " missing")) { if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) {
private void checkCodeableConcept(List<ValidationMessage> errors, String path, Element element, StructureDefinition profile, ElementDefinition theElementCntext) { if (!noTerminologyChecks && theElementCntext != null && theElementCntext.hasBinding()) { ElementDefinitionBindingComponent binding = theElementCntext.getBinding(); if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, binding != null, "Binding for " + path + " missing (cc)")) { if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) {
case -1408783839: return getIsModifierElement(); case 1857548060: return getIsSummaryElement(); case -108220795: return getBinding(); case 837556430: return addMapping(); default: return super.makeProperty(hash, name);
res.setMustSupport(usage.getMustSupport()); if (usage.hasBinding()) res.setBinding(usage.getBinding().copy()); for (ElementDefinitionConstraintComponent c : usage.getConstraint()) res.addConstraint(c);
tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertElementDefinitionMappingComponent(t));
tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertElementDefinitionMappingComponent(t));