diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java index df051f7ec..a5838a0e4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java @@ -660,6 +660,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon List msgs = new ArrayList(); List errors = new ArrayList(); ProfileUtilities pu = new ProfileUtilities(this, msgs, this); + pu.setAutoFixSliceNames(true); pu.setThrowException(false); if (sd.getDerivation() == TypeDerivationRule.CONSTRAINT) { pu.sortDifferential(sd, p, p.getUrl(), errors, true); @@ -670,7 +671,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon pu.generateSnapshot(sd, p, p.getUrl(), Utilities.extractBaseUrl(sd.getUserString("path")), p.getName()); for (ValidationMessage msg : msgs) { if ((!ignoreProfileErrors && msg.getLevel() == ValidationMessage.IssueSeverity.ERROR) || msg.getLevel() == ValidationMessage.IssueSeverity.FATAL) - throw new DefinitionException("Profile "+p.getName()+" ("+p.getUrl()+"). Error generating snapshot: "+msg.getMessage()); + throw new DefinitionException("Profile "+p.getName()+" ("+p.getUrl()+"), element "+msg.getLocation()+". Error generating snapshot: "+msg.getMessage()); } if (!p.hasSnapshot()) throw new FHIRException("Profile "+p.getName()+" ("+p.getUrl()+"). Error generating snapshot");