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) {
if (context.hasBinding() && e.primitiveValue() != null) { checkPrimitiveBinding(errors, path, type, context, e, profile);
try { 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")) {
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)")) {
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 boolean onlyInformationIsMapping(ElementDefinition d) { return !d.hasShort() && !d.hasDefinition() && !d.hasRequirements() && !d.getAlias().isEmpty() && !d.hasMinElement() && !d.hasMax() && !d.getType().isEmpty() && !d.hasContentReference() && !d.hasExample() && !d.hasFixed() && !d.hasMaxLengthElement() && !d.getCondition().isEmpty() && !d.getConstraint().isEmpty() && !d.hasMustSupportElement() && !d.hasBinding(); }
tgt.setIsModifier(src.getIsModifier()); tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
} 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) {
if (src.hasIsSummary()) tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
/** * 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; }
if (!full && !(deep || vdeep) && ved != null && ved.hasBinding()) { c.addPiece(gen.new Piece("br")); BindingResolution br = pkp.resolveBinding(ed, ved.getBinding(), ved.getPath());
if (context.hasBinding() && e.primitiveValue() != null) { checkPrimitiveBinding(errors, path, type, context, e, profile);
if (tr.hasProfile()) pt.addProfile(tr.getProfile()); if (element.getDefinition().hasBinding()) pt.addBinding(element.getDefinition().getBinding()); type.addType(pt);
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)")) {
try { 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")) {
line.addString(ed.hasMaxValue() ? renderType(ed.getMaxValue()) : ""); 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 (usage.hasMustSupport()) res.setMustSupport(usage.getMustSupport()); if (usage.hasBinding()) res.setBinding(usage.getBinding().copy()); for (ElementDefinitionConstraintComponent c : usage.getConstraint())
tgt.setIsModifier(src.getIsModifier()); tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
if (src.hasIsSummary()) tgt.setIsSummary(src.getIsSummary()); if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())