diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java index 8c430a7cb..987e4da94 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java @@ -250,11 +250,7 @@ public class ContextUtilities implements ProfileKnowledgeProvider { * @throws FHIRException */ public void generateSnapshot(StructureDefinition p) throws DefinitionException, FHIRException { - generateSnapshot(p, false); - } - - public void generateSnapshot(StructureDefinition p, boolean ifLogical) { - if ((!p.hasSnapshot() || isProfileNeedsRegenerate(p) ) && (ifLogical || p.getKind() != StructureDefinitionKind.LOGICAL)) { + if ((!p.hasSnapshot() || isProfileNeedsRegenerate(p))) { if (!p.hasBaseDefinition()) throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE___HAS_NO_BASE_AND_NO_SNAPSHOT, p.getName(), p.getUrl())); StructureDefinition sd = context.fetchResource(StructureDefinition.class, p.getBaseDefinition(), p); diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java index dd409aa01..baa385b70 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java @@ -43,7 +43,7 @@ public class CDARoundTripTests { for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (!sd.hasSnapshot()) { // System.out.println("generate snapshot for " + sd.getUrl()); - new ContextUtilities(context).generateSnapshot(sd, true); + new ContextUtilities(context).generateSnapshot(sd); } } } diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java index 19d1e4653..51378abfb 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java @@ -41,7 +41,7 @@ public class XmlParserTests { for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (!sd.hasSnapshot()) { System.out.println("generate snapshot for " + sd.getUrl()); - new ContextUtilities(context).generateSnapshot(sd, true); + new ContextUtilities(context).generateSnapshot(sd); } } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java index 4ecdafef5..8e1fc845d 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java @@ -366,11 +366,7 @@ public class ValidationService { List structures = cu.allStructures(); for (StructureDefinition sd : structures) { if (!sd.hasSnapshot()) { - if (sd.getKind() != null && sd.getKind() == StructureDefinitionKind.LOGICAL) { - cu.generateSnapshot(sd, true); - } else { - cu.generateSnapshot(sd, false); - } + cu.generateSnapshot(sd); } } validator.setMapLog(cliContext.getMapLog()); @@ -402,11 +398,7 @@ public class ValidationService { List structures = cu.allStructures(); for (StructureDefinition sd : structures) { if (!sd.hasSnapshot()) { - if (sd.getKind() != null && sd.getKind() == StructureDefinitionKind.LOGICAL) { - cu.generateSnapshot(sd, true); - } else { - cu.generateSnapshot(sd, false); - } + cu.generateSnapshot(sd); } } validator.setMapLog(cliContext.getMapLog()); diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java index b84d0a7fc..d7993f563 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java @@ -76,7 +76,7 @@ public class StructureMappingTests { for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (!sd.hasSnapshot()) { System.out.println("generate snapshot for " + sd.getUrl()); - new ContextUtilities(context).generateSnapshot(sd, true); + new ContextUtilities(context).generateSnapshot(sd); } } if (context.getValidatorFactory() == null) { diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java index 4f3e022e5..9e7c4c7cf 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java @@ -384,7 +384,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe String contents = TestingUtilities.loadTestResource("validator", filename); CanonicalResource mr = (CanonicalResource) loadResource(filename, contents); if (mr instanceof StructureDefinition) { - new ContextUtilities(val.getContext()).generateSnapshot((StructureDefinition) mr, true); + new ContextUtilities(val.getContext()).generateSnapshot((StructureDefinition) mr); } logOutput("load resource "+mr.getUrl()); val.getContext().cacheResource(mr);