diff --git a/.vscode/settings.json b/.vscode/settings.json index e0f15db2e..70b6d9a78 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,8 @@ { - "java.configuration.updateBuildConfiguration": "automatic" + "java.configuration.updateBuildConfiguration": "automatic", + "cSpell.words": [ + "Careand", + "pagecontent", + "plandefinition" + ] } \ No newline at end of file diff --git a/src/main/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessor.java b/src/main/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessor.java index 5fbdcdc1e..4079bc88b 100644 --- a/src/main/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessor.java +++ b/src/main/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessor.java @@ -1,7 +1,6 @@ package org.opencds.cqf.tooling.library.r4; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java b/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java index c1c54c3d5..a93740414 100644 --- a/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java +++ b/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java @@ -18,7 +18,6 @@ import org.opencds.cqf.tooling.utilities.*; import org.opencds.cqf.tooling.utilities.IOUtils.Encoding; -import java.io.IOException; import java.util.*; import java.util.stream.Collectors; @@ -32,7 +31,6 @@ public static String getId(String baseId) { public static List refreshIgMeasureContent(BaseProcessor parentContext, Encoding outputEncoding, Boolean versioned, FhirContext fhirContext, String measureToRefreshPath) { System.out.println("Refreshing measures..."); - ArrayList refreshedMeasureNames = new ArrayList(); MeasureProcessor measureProcessor; switch (fhirContext.getVersion().getVersion()) { diff --git a/src/main/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessor.java b/src/main/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessor.java index 9e19882ee..185827687 100644 --- a/src/main/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessor.java +++ b/src/main/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessor.java @@ -1,6 +1,5 @@ package org.opencds.cqf.tooling.measure.r4; -import ca.uhn.fhir.context.FhirContext; import org.hl7.fhir.convertors.VersionConvertor_40_50; import org.hl7.fhir.r4.formats.FormatUtilities; import org.opencds.cqf.tooling.common.r4.CqfmSoftwareSystemHelper; @@ -9,7 +8,6 @@ import org.opencds.cqf.tooling.utilities.IOUtils; import java.io.File; -import java.io.IOException; import java.util.*; public class R4MeasureProcessor extends MeasureProcessor { diff --git a/src/main/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperation.java b/src/main/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperation.java index 312354a1d..b7c48faa6 100644 --- a/src/main/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperation.java +++ b/src/main/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperation.java @@ -75,7 +75,7 @@ private void refreshMeasureFromFile(File f) { public Measure refreshMeasure(Measure measure) { cqfmHelper.ensureCQFToolingExtensionAndDevice(measure, this.getFhirContext()); - R4MeasureProcessor refresher = new R4MeasureProcessor(); + // R4MeasureProcessor refresher = new R4MeasureProcessor(); //refresher.refreshMeasure(measure, ); return measure; } diff --git a/src/main/java/org/opencds/cqf/tooling/processor/CqlProcessor.java b/src/main/java/org/opencds/cqf/tooling/processor/CqlProcessor.java index 9430f5c63..765d67fa2 100644 --- a/src/main/java/org/opencds/cqf/tooling/processor/CqlProcessor.java +++ b/src/main/java/org/opencds/cqf/tooling/processor/CqlProcessor.java @@ -3,39 +3,29 @@ import java.io.File; import java.io.FilenameFilter; import java.nio.file.Paths; -import java.util.*; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.cqframework.cql.cql2elm.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.cqframework.cql.cql2elm.CqlTranslator; +import org.cqframework.cql.cql2elm.CqlTranslatorException; +import org.cqframework.cql.cql2elm.CqlTranslatorOptions; +import org.cqframework.cql.cql2elm.DefaultLibrarySourceProvider; +import org.cqframework.cql.cql2elm.DefaultModelInfoProvider; +import org.cqframework.cql.cql2elm.FhirLibrarySourceProvider; +import org.cqframework.cql.cql2elm.LibraryManager; +import org.cqframework.cql.cql2elm.ModelManager; +import org.cqframework.cql.cql2elm.NamespaceInfo; +import org.cqframework.cql.cql2elm.NamespaceManager; import org.cqframework.cql.cql2elm.model.TranslatedLibrary; import org.cqframework.cql.elm.tracking.TrackBack; import org.fhir.ucum.UcumService; -import org.hl7.cql.model.IntervalType; -import org.hl7.cql.model.ListType; -import org.hl7.cql.model.NamedType; -import org.hl7.elm.r1.AccessModifier; -import org.hl7.elm.r1.Code; -import org.hl7.elm.r1.CodeDef; -import org.hl7.elm.r1.CodeRef; -import org.hl7.elm.r1.CodeSystemDef; -import org.hl7.elm.r1.CodeSystemRef; -import org.hl7.elm.r1.Concept; -import org.hl7.elm.r1.ConceptDef; -import org.hl7.elm.r1.ConceptRef; -import org.hl7.elm.r1.Expression; -import org.hl7.elm.r1.ExpressionDef; -import org.hl7.elm.r1.FunctionDef; -import org.hl7.elm.r1.IncludeDef; -import org.hl7.elm.r1.ParameterDef; -import org.hl7.elm.r1.Retrieve; -import org.hl7.elm.r1.UsingDef; -import org.hl7.elm.r1.ValueSetDef; -import org.hl7.elm.r1.ValueSetRef; import org.hl7.elm.r1.VersionedIdentifier; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService; import org.hl7.fhir.r5.model.DataRequirement; -import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ParameterDefinition; import org.hl7.fhir.r5.model.RelatedArtifact; import org.hl7.fhir.utilities.npm.NpmPackage; diff --git a/src/main/java/org/opencds/cqf/tooling/processor/IGProcessor.java b/src/main/java/org/opencds/cqf/tooling/processor/IGProcessor.java index 9ee34973d..2d400ff44 100644 --- a/src/main/java/org/opencds/cqf/tooling/processor/IGProcessor.java +++ b/src/main/java/org/opencds/cqf/tooling/processor/IGProcessor.java @@ -7,7 +7,6 @@ import org.apache.commons.io.FilenameUtils; import org.hl7.fhir.utilities.Utilities; -import org.opencds.cqf.tooling.library.LibraryProcessor; import org.opencds.cqf.tooling.measure.MeasureProcessor; import org.opencds.cqf.tooling.parameter.RefreshIGParameters; import org.opencds.cqf.tooling.utilities.IGUtils; @@ -56,7 +55,7 @@ public void publishIG(RefreshIGParameters params) { //ScaffoldProcessor.scaffold(ScaffoldParameters); //Use case 2 while developing in Atom refresh content and run tests for either entire IG or targeted Artifact - //refreshcontent + //refreshContent LogUtils.info("IGProcessor.publishIG - refreshIG"); refreshIG(params); //validate diff --git a/src/main/java/org/opencds/cqf/tooling/visitor/ElmDataRequirement.java b/src/main/java/org/opencds/cqf/tooling/visitor/ElmDataRequirement.java index 83e089bb5..635b4b718 100644 --- a/src/main/java/org/opencds/cqf/tooling/visitor/ElmDataRequirement.java +++ b/src/main/java/org/opencds/cqf/tooling/visitor/ElmDataRequirement.java @@ -206,7 +206,7 @@ else if (context.getTypeResolver().isDateType(comparisonType)) { } // Determine operation and appropriate range // If right is interval-valued - // If the operation is equal, equivalent, sameas, in, or included in, the date range is the comparand + // If the operation is equal, equivalent, same as, in, or included in, the date range is the comparand Expression comparand = conditionRequirement.getComparand().getExpression(); if (context.getTypeResolver().isIntervalType(comparisonType)) { switch (conditionRequirement.getElement().getClass().getSimpleName()) { @@ -317,7 +317,7 @@ private void applyJoinRequirementTo(ElmJoinRequirement joinRequirement, Retrieve } // Search from the model info should be used to inform the selection, but will in general resolve to multiple choices - // May be a choice better left to the capabilitystatement-informed planning phase anyway + // May be a choice better left to the capabilityStatement-informed planning phase anyway } // In the absence of search information, either of these formulations is correct, favor primary query sources over withs diff --git a/src/main/java/org/opencds/cqf/tooling/visitor/ElmPropertyRequirement.java b/src/main/java/org/opencds/cqf/tooling/visitor/ElmPropertyRequirement.java index 4251007ab..d88d20cfc 100644 --- a/src/main/java/org/opencds/cqf/tooling/visitor/ElmPropertyRequirement.java +++ b/src/main/java/org/opencds/cqf/tooling/visitor/ElmPropertyRequirement.java @@ -1,7 +1,6 @@ package org.opencds.cqf.tooling.visitor; import org.hl7.elm.r1.Element; -import org.hl7.elm.r1.Expression; import org.hl7.elm.r1.Property; import org.hl7.elm.r1.VersionedIdentifier; diff --git a/src/main/java/org/opencds/cqf/tooling/visitor/ElmQueryAliasContext.java b/src/main/java/org/opencds/cqf/tooling/visitor/ElmQueryAliasContext.java index 1338bd693..ce9b6f142 100644 --- a/src/main/java/org/opencds/cqf/tooling/visitor/ElmQueryAliasContext.java +++ b/src/main/java/org/opencds/cqf/tooling/visitor/ElmQueryAliasContext.java @@ -1,7 +1,6 @@ package org.opencds.cqf.tooling.visitor; import org.hl7.elm.r1.AliasedQuerySource; -import org.hl7.elm.r1.Property; import org.hl7.elm.r1.Retrieve; import org.hl7.elm.r1.VersionedIdentifier; diff --git a/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirements.java b/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirements.java index 2f8e0e528..f92611582 100644 --- a/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirements.java +++ b/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirements.java @@ -1,14 +1,21 @@ package org.opencds.cqf.tooling.visitor; -import org.hl7.elm.r1.*; - -import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashSet; -import java.util.List; import java.util.stream.Collectors; -import static java.util.stream.Collectors.toList; +import org.hl7.elm.r1.CodeDef; +import org.hl7.elm.r1.CodeSystemDef; +import org.hl7.elm.r1.ConceptDef; +import org.hl7.elm.r1.Element; +import org.hl7.elm.r1.ExpressionDef; +import org.hl7.elm.r1.FunctionDef; +import org.hl7.elm.r1.IncludeDef; +import org.hl7.elm.r1.ParameterDef; +import org.hl7.elm.r1.Retrieve; +import org.hl7.elm.r1.UsingDef; +import org.hl7.elm.r1.ValueSetDef; +import org.hl7.elm.r1.VersionedIdentifier; public class ElmRequirements extends ElmRequirement { diff --git a/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirementsVisitor.java b/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirementsVisitor.java index 3d7b1134f..d65328719 100644 --- a/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirementsVisitor.java +++ b/src/main/java/org/opencds/cqf/tooling/visitor/ElmRequirementsVisitor.java @@ -3,8 +3,6 @@ import org.cqframework.cql.elm.visiting.ElmBaseLibraryVisitor; import org.hl7.elm.r1.*; -import javax.xml.namespace.QName; - public class ElmRequirementsVisitor extends ElmBaseLibraryVisitor { public ElmRequirementsVisitor() { @@ -105,7 +103,7 @@ public ElmRequirement visitParameterRef(ParameterRef elm, ElmRequirementsContext @Override public ElmRequirement visitRetrieve(Retrieve elm, ElmRequirementsContext context) { // TODO: childResult reporting? - ElmRequirement childResult = super.visitRetrieve(elm, context); + super.visitRetrieve(elm, context); ElmDataRequirement result = new ElmDataRequirement(context.getCurrentLibraryIdentifier(), elm); // If not in a query context, report the data requirement // If in a query context, the requirement will be reported as an inferred requirement at the query boundary @@ -324,7 +322,7 @@ public ElmRequirement visitChildren(BinaryExpression elm, ElmRequirementsContext case "ProperIncludes": case "ProperIncludedIn": default: { - ElmRequirement childResult = super.visitChildren(elm, context); + super.visitChildren(elm, context); return new ElmExpressionRequirement(context.getCurrentLibraryIdentifier(), elm); } } @@ -337,13 +335,13 @@ public ElmRequirement visitBinaryExpression(BinaryExpression elm, ElmRequirement @Override public ElmRequirement visitTernaryExpression(TernaryExpression elm, ElmRequirementsContext context) { - ElmRequirement childResult = super.visitTernaryExpression(elm, context); + super.visitTernaryExpression(elm, context); return new ElmExpressionRequirement(context.getCurrentLibraryIdentifier(), elm); } @Override public ElmRequirement visitNaryExpression(NaryExpression elm, ElmRequirementsContext context) { - ElmRequirement childResult = super.visitNaryExpression(elm, context); + super.visitNaryExpression(elm, context); return new ElmExpressionRequirement(context.getCurrentLibraryIdentifier(), elm); } @@ -659,7 +657,7 @@ public ElmRequirement visitCombine(Combine elm, ElmRequirementsContext context) @Override public ElmRequirement visitSplit(Split elm, ElmRequirementsContext context) { - // If the separtor is a literal, infer based only on the string to split argument + // If the separator is a literal, infer based only on the string to split argument if (elm.getSeparator() instanceof Literal) { return visitElement(elm.getStringToSplit(), context); } diff --git a/src/test/java/org/opencds/cqf/tooling/utilities/DataRequirementsProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/utilities/DataRequirementsProcessorTest.java index fd0313b19..7b46d2d1f 100644 --- a/src/test/java/org/opencds/cqf/tooling/utilities/DataRequirementsProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/utilities/DataRequirementsProcessorTest.java @@ -1,17 +1,7 @@ package org.opencds.cqf.tooling.utilities; -import ca.uhn.fhir.context.FhirContext; -import org.cqframework.cql.cql2elm.*; -import org.cqframework.cql.cql2elm.model.TranslatedLibrary; -import org.fhir.ucum.UcumEssenceService; -import org.fhir.ucum.UcumException; -import org.fhir.ucum.UcumService; -import org.hl7.elm.r1.*; -import ca.uhn.fhir.parser.IParser; -import org.hl7.elm.r1.Library; -import org.hl7.fhir.r5.model.*; -import org.junit.Test; -import org.opencds.cqf.tooling.processor.DataRequirementsProcessor; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; @@ -20,8 +10,43 @@ import java.util.List; import java.util.Set; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.cqframework.cql.cql2elm.CqlTranslator; +import org.cqframework.cql.cql2elm.CqlTranslatorOptions; +import org.cqframework.cql.cql2elm.DefaultLibrarySourceProvider; +import org.cqframework.cql.cql2elm.FhirLibrarySourceProvider; +import org.cqframework.cql.cql2elm.LibraryManager; +import org.cqframework.cql.cql2elm.ModelManager; +import org.cqframework.cql.cql2elm.NamespaceInfo; +import org.cqframework.cql.cql2elm.NamespaceManager; +import org.cqframework.cql.cql2elm.model.TranslatedLibrary; +import org.fhir.ucum.UcumEssenceService; +import org.fhir.ucum.UcumException; +import org.fhir.ucum.UcumService; +import org.hl7.elm.r1.AliasedQuerySource; +import org.hl7.elm.r1.CodeFilterElement; +import org.hl7.elm.r1.DateFilterElement; +import org.hl7.elm.r1.Exists; +import org.hl7.elm.r1.ExpressionDef; +import org.hl7.elm.r1.IncludeElement; +import org.hl7.elm.r1.LetClause; +import org.hl7.elm.r1.Literal; +import org.hl7.elm.r1.ParameterRef; +import org.hl7.elm.r1.Query; +import org.hl7.elm.r1.Retrieve; +import org.hl7.elm.r1.SingletonFrom; +import org.hl7.elm.r1.ValueSetRef; +import org.hl7.elm.r1.With; +import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.DataRequirement; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Extension; +import org.hl7.fhir.r5.model.ParameterDefinition; +import org.hl7.fhir.r5.model.RelatedArtifact; +import org.junit.Test; +import org.opencds.cqf.tooling.processor.DataRequirementsProcessor; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.IParser; public class DataRequirementsProcessorTest { private static ModelManager modelManager; @@ -56,7 +81,7 @@ public void TestDataRequirementsProcessor() { PreventiveCareandWellness-v0-0-001-FHIR-4-0-1.xml */ CqlTranslator translator = createTranslator("CompositeMeasures/cql/EXM124-9.0.000.cql", cqlTranslatorOptions);//"OpioidCDS/cql/OpioidCDSCommon.cql", cqlTranslatorOptions); - Library elmLibrary = translator.toELM(); + translator.toELM(); assertTrue(translator.getErrors().isEmpty()); cacheLibrary(translator.getTranslatedLibrary()); @@ -89,7 +114,7 @@ public void TestDataRequirementsProcessorWithExpressions() { // TODO - add expressions to expressions expressions.add("Conditions Indicating End of Life or With Limited Life Expectancy");//Active Ambulatory Opioid Rx"); CqlTranslator translator = createTranslator("OpioidCDS/cql/OpioidCDSCommon.cql", cqlTranslatorOptions); - Library elmLibrary = translator.toELM(); + translator.toELM(); assertTrue(translator.getErrors().isEmpty()); cacheLibrary(translator.getTranslatedLibrary()); DataRequirementsProcessor dqReqTrans = new DataRequirementsProcessor(); @@ -157,7 +182,7 @@ public void TestLibraryDataRequirements() { try { // CqlTranslator translator = createTranslator("/ecqm/resources/library-EXM506-2.2.000.json", cqlTranslatorOptions); CqlTranslator translator = createTranslator("CompositeMeasures/cql/BCSComponent.cql", cqlTranslatorOptions); - Library elmLibrary = translator.toELM(); + translator.toELM(); assertTrue(translator.getErrors().isEmpty()); cacheLibrary(translator.getTranslatedLibrary()); DataRequirementsProcessor dqReqTrans = new DataRequirementsProcessor(); @@ -225,7 +250,7 @@ private CqlTranslatorOptions getTranslatorOptions() { private CqlTranslator setupDataRequirementsAnalysis(String fileName, CqlTranslatorOptions cqlTranslatorOptions) throws IOException { CqlTranslator translator = createTranslator(fileName, cqlTranslatorOptions); - Library elmLibrary = translator.toELM(); + translator.toELM(); assertTrue(translator.getErrors().isEmpty()); cacheLibrary(translator.getTranslatedLibrary()); return translator; @@ -879,13 +904,9 @@ public static CqlTranslator createTranslator(NamespaceInfo namespaceInfo, String public static CqlTranslator createTranslator(NamespaceInfo namespaceInfo, String testFileName, CqlTranslatorOptions options) throws IOException { File translationTestFile = new File(DataRequirementsProcessorTest.class.getResource(testFileName).getFile()); - if(null != translationTestFile) { - reset(); - setup(translationTestFile.getParent()); - CqlTranslator translator = CqlTranslator.fromFile(namespaceInfo, translationTestFile, getModelManager(), getLibraryManager(), getUcumService(), options); - return translator; - - } - return null; + reset(); + setup(translationTestFile.getParent()); + CqlTranslator translator = CqlTranslator.fromFile(namespaceInfo, translationTestFile, getModelManager(), getLibraryManager(), getUcumService(), options); + return translator; } } diff --git a/src/test/java/org/opencds/cqf/tooling/utilities/ECQMCreatorTest.java b/src/test/java/org/opencds/cqf/tooling/utilities/ECQMCreatorTest.java index 219a94ffb..dfb37e142 100644 --- a/src/test/java/org/opencds/cqf/tooling/utilities/ECQMCreatorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/utilities/ECQMCreatorTest.java @@ -1,8 +1,20 @@ package org.opencds.cqf.tooling.utilities; -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.parser.IParser; -import org.cqframework.cql.cql2elm.*; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; + +import org.cqframework.cql.cql2elm.CqlTranslator; +import org.cqframework.cql.cql2elm.CqlTranslatorOptions; +import org.cqframework.cql.cql2elm.DefaultLibrarySourceProvider; +import org.cqframework.cql.cql2elm.FhirLibrarySourceProvider; +import org.cqframework.cql.cql2elm.LibraryManager; +import org.cqframework.cql.cql2elm.ModelManager; +import org.cqframework.cql.cql2elm.NamespaceInfo; +import org.cqframework.cql.cql2elm.NamespaceManager; import org.cqframework.cql.cql2elm.model.TranslatedLibrary; import org.fhir.ucum.UcumEssenceService; import org.fhir.ucum.UcumException; @@ -11,10 +23,8 @@ import org.junit.Test; import org.opencds.cqf.tooling.measure.MeasureRefreshProcessor; -import java.io.*; -import java.nio.file.Paths; - -import static org.junit.Assert.assertTrue; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.IParser; public class ECQMCreatorTest { private static ModelManager modelManager; @@ -26,7 +36,7 @@ private String refreshMeasure(String primaryLibraryPath, String measurePath) thr cqlTranslatorOptions.getFormats().add(CqlTranslator.Format.JSON); cqlTranslatorOptions.getOptions().add(CqlTranslator.Options.EnableAnnotations); CqlTranslator translator = createTranslator(primaryLibraryPath, cqlTranslatorOptions); - org.hl7.elm.r1.Library elmLibrary = translator.toELM(); + translator.toELM(); cacheLibrary(translator.getTranslatedLibrary()); FhirContext context = FhirContext.forR5(); IParser parser = measurePath.endsWith(".json") ? context.newJsonParser() : context.newXmlParser(); @@ -138,7 +148,7 @@ public void TestECQMCreatorDataRequirements() { String libraryPath = "CompositeMeasures/cql/BCSComponent.cql"; //EXM124-9.0.000.cql";//library-EXM124-9.0.000.json"; try { CqlTranslator translator = createTranslator(libraryPath, cqlTranslatorOptions); - org.hl7.elm.r1.Library elmLibrary = translator.toELM(); + translator.toELM(); cacheLibrary(translator.getTranslatedLibrary()); FhirContext context = FhirContext.forR5(); IParser parser = context.newJsonParser(); @@ -221,14 +231,10 @@ public static CqlTranslator createTranslator(NamespaceInfo namespaceInfo, String public static CqlTranslator createTranslator(NamespaceInfo namespaceInfo, String libraryName, CqlTranslatorOptions options) throws IOException { File translationTestFile = new File(ECQMCreatorTest.class.getResource(libraryName).getFile()); - if(null != translationTestFile) { - reset(); - setup(translationTestFile.getParent()); - CqlTranslator translator = CqlTranslator.fromFile(namespaceInfo, translationTestFile, getModelManager(), getLibraryManager(), getUcumService(), options); - return translator; - - } - return null; + reset(); + setup(translationTestFile.getParent()); + CqlTranslator translator = CqlTranslator.fromFile(namespaceInfo, translationTestFile, getModelManager(), getLibraryManager(), getUcumService(), options); + return translator; } }