private void loadProfiles(ValidationProfileSet profiles) throws DefinitionException { if (profiles != null) { for (String profile : profiles.getCanonicalUrls()) { StructureDefinition p = context.fetchResource(StructureDefinition.class, profile); if (p == null) throw new DefinitionException("StructureDefinition '" + profile + "' not found"); profiles.getDefinitions().add(p); } } }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, Resource resource, StructureDefinition profile) throws FHIRException { return validate(appContext, errors, resource, new ValidationProfileSet(profile)); }
public List<String> getCanonicalAll() { Set<String> res = new HashSet<String>(); res.addAll(getCanonicalUrls()); for (StructureDefinition sd : definitions) res.add(sd.getUrl()); return new ArrayList<String>(res); }
public void addProfiles(List<ValidationMessage> errors, ValidationProfileSet profiles, String path, Element element, boolean external) throws FHIRException { for (ProfileRegistration profile : profiles.getCanonical()) { StructureDefinition sd = profiles.fetch(profile.getProfile()); if (sd == null) sd = context.fetchResource(StructureDefinition.class, profile.getProfile());
public boolean addProfile(List<ValidationMessage> errors, String profile, boolean error, String path, Element element) { String effectiveProfile = profile; String version = null; if (profile.contains("|")) { effectiveProfile = profile.substring(0, profile.indexOf('|')); version = profile.substring(profile.indexOf('|')+1); } StructureDefinition sd = null; if (providedProfiles != null) sd = providedProfiles.fetch(effectiveProfile); if (sd == null) sd = context.fetchResource(StructureDefinition.class, effectiveProfile); if (warningOrError(error, errors, IssueType.INVALID, element.line(), element.col(), path, sd != null, "StructureDefinition reference \"{0}\" could not be resolved", profile)) { if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, version==null || (sd.getVersion()!=null && sd.getVersion().equals(version)), "Referenced version " + version + " does not match found version " + sd.getVersion() + " for profile " + sd.getUrl(), profile)) { if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, sd.hasSnapshot(), "StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided")) { if (!profiles.containsKey(sd)) { profiles.put(sd, new ProfileUsage(sd)); addAncestorProfiles(sd); return true; } } } } return false; }
public List<String> getCanonicalAll() { Set<String> res = new HashSet<String>(); res.addAll(getCanonicalUrls()); for (StructureDefinition sd : definitions) res.add(sd.getUrl()); return new ArrayList<String>(res); }
public void addProfiles(List<ValidationMessage> errors, ValidationProfileSet profiles, String path, Element element, boolean external) throws FHIRException { for (ProfileRegistration profile : profiles.getCanonical()) { StructureDefinition sd = profiles.fetch(profile.getProfile()); if (sd == null) sd = context.fetchResource(StructureDefinition.class, profile.getProfile());
public boolean addProfile(List<ValidationMessage> errors, String profile, boolean error, String path, Element element) { String effectiveProfile = profile; String version = null; if (profile.contains("|")) { effectiveProfile = profile.substring(0, profile.indexOf('|')); version = profile.substring(profile.indexOf('|')+1); } StructureDefinition sd = null; if (providedProfiles != null) sd = providedProfiles.fetch(effectiveProfile); if (sd == null) sd = context.fetchResource(StructureDefinition.class, effectiveProfile); if (warningOrError(error, errors, IssueType.INVALID, element.line(), element.col(), path, sd != null, "StructureDefinition reference \"{0}\" could not be resolved", profile)) { if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, version==null || (sd.getVersion()!=null && sd.getVersion().equals(version)), "Referenced version " + version + " does not match found version " + sd.getVersion() + " for profile " + sd.getUrl(), profile)) { if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, sd.hasSnapshot(), "StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided")) { if (!profiles.containsKey(sd)) { profiles.put(sd, new ProfileUsage(sd)); addAncestorProfiles(sd); return true; } } } } return false; }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, Document document, StructureDefinition profile) throws FHIRException { return validate(appContext, errors, document, new ValidationProfileSet(profile)); }
private void loadProfiles(ValidationProfileSet profiles) throws DefinitionException { if (profiles != null) { for (String profile : profiles.getCanonicalUrls()) { StructureDefinition p = context.fetchResource(StructureDefinition.class, profile); if (p == null) throw new DefinitionException("StructureDefinition '" + profile + "' not found"); profiles.getDefinitions().add(p); } } }
@Override public void validate(Object appContext, List<ValidationMessage> errors, Element element) throws FHIRException { ValidationProfileSet profileSet = new ValidationProfileSet(); validate(appContext, errors, element, profileSet); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, InputStream stream, FhirFormat format) throws FHIRException { return validate(appContext, errors, stream, format, new ValidationProfileSet()); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, org.w3c.dom.Element element, String profile) throws FHIRException { return validate(appContext, errors, element, new ValidationProfileSet(profile, true)); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, Document document, String profile) throws FHIRException { return validate(appContext, errors, document, new ValidationProfileSet(profile, true)); }
@Override public void validate(Object appContext, List<ValidationMessage> errors, Element element, StructureDefinition profile) throws FHIRException { validate(appContext, errors, element, new ValidationProfileSet(profile)); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, org.w3c.dom.Element element) throws FHIRException { return validate(appContext, errors, element, new ValidationProfileSet()); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, JsonObject object, String profile) throws FHIRException { return validate(appContext, errors, object, new ValidationProfileSet(profile, true)); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, InputStream stream, FhirFormat format, String profile) throws FHIRException { return validate(appContext, errors, stream, format, new ValidationProfileSet(profile, true)); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, Resource resource) throws FHIRException { return validate(appContext, errors, resource, new ValidationProfileSet()); }
@Override public org.hl7.fhir.r4.elementmodel.Element validate(Object appContext, List<ValidationMessage> errors, Resource resource, String profile) throws FHIRException { return validate(appContext, errors, resource, new ValidationProfileSet(profile, true)); }