Add support for -txCache parameter

This commit is contained in:
Grahame Grieve 2024-09-24 20:42:48 -04:00
parent 176b0caf63
commit f4096319a3
1 changed files with 6 additions and 2 deletions

View File

@ -529,14 +529,18 @@ public class ValidationService {
} }
@Nonnull @Nonnull
protected ValidationEngine buildValidationEngine( CliContext cliContext, String definitions, TimeTracker timeTracker) throws IOException, URISyntaxException { protected ValidationEngine buildValidationEngine(CliContext cliContext, String definitions, TimeTracker timeTracker) throws IOException, URISyntaxException {
System.out.print(" Load FHIR v" + cliContext.getSv() + " from " + definitions); System.out.print(" Load FHIR v" + cliContext.getSv() + " from " + definitions);
ValidationEngine validationEngine = getValidationEngineBuilder().withTHO(false).withVersion(cliContext.getSv()).withTimeTracker(timeTracker).withUserAgent(Common.getValidatorUserAgent()).fromSource(definitions); ValidationEngine validationEngine = getValidationEngineBuilder().withTHO(false).withVersion(cliContext.getSv()).withTimeTracker(timeTracker).withUserAgent(Common.getValidatorUserAgent()).fromSource(definitions);
System.out.println(" - " + validationEngine.getContext().countAllCaches() + " resources (" + timeTracker.milestone() + ")"); System.out.println(" - " + validationEngine.getContext().countAllCaches() + " resources (" + timeTracker.milestone() + ")");
loadIgsAndExtensions(validationEngine, cliContext, timeTracker); loadIgsAndExtensions(validationEngine, cliContext, timeTracker);
if (validationEngine.getContext().getTxCache() == null) { if (cliContext.getTxCache() != null) {
TerminologyCache cache = new TerminologyCache(new Object(), cliContext.getTxCache());
validationEngine.getContext().initTxCache(cache);
}
if (validationEngine.getContext().getTxCache().getFolder() == null) {
System.out.println(" No Terminology Cache"); System.out.println(" No Terminology Cache");
} else { } else {
System.out.println(" Terminology Cache at "+validationEngine.getContext().getTxCache().getFolder()); System.out.println(" Terminology Cache at "+validationEngine.getContext().getTxCache().getFolder());