From f2b7c518c5d1548994ac008a867bbb3336830dae Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 15 Jan 2020 08:07:20 +1100 Subject: [PATCH] handle validation for current version better --- .../java/org/hl7/fhir/r5/validation/ValidationEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java index f73be0eea..6d66ac2c2 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java @@ -875,7 +875,7 @@ public class ValidationEngine implements IValidatorResourceFetcher { throw new Exception("Unsupported format for "+fn); VersionConvertorAdvisor50 advisor = new org.hl7.fhir.convertors.IGR2ConvertorAdvisor5(); r = new VersionConvertor_10_50(advisor ).convertResource(res); - } else if (version.equals(Constants.VERSION)) { + } else if (version.equals(Constants.VERSION) || "current".equals(version)) { if (fn.endsWith(".xml") && !fn.endsWith("template.xml")) r = new XmlParser().parse(new ByteArrayInputStream(content)); else if (fn.endsWith(".json") && !fn.endsWith("template.json")) @@ -1702,7 +1702,7 @@ public class ValidationEngine implements IValidatorResourceFetcher { else throw new Exception("Unsupported format for "+fn); } else - throw new Exception("Unsupported version "+version); + throw new Exception("Encounted unsupported configured version "+version+" loading "+fn); s.close(); }