Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival committed Oct 16, 2024
1 parent 82d4818 commit 084910e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.cqframework.cql.cql2elm.StringLibrarySourceProvider;
import org.cqframework.fhir.npm.NpmProcessor;
import org.hl7.elm.r1.VersionedIdentifier;
import org.hl7.fhir.instance.model.api.IBase;
import org.hl7.fhir.instance.model.api.IBaseBundle;
Expand All @@ -38,17 +37,11 @@ public class LibraryEngine {
protected final Repository repository;
protected final FhirContext fhirContext;
protected final EvaluationSettings settings;
protected NpmProcessor npmProcessor;

public LibraryEngine(Repository repository, EvaluationSettings evaluationSettings) {
this(repository, evaluationSettings, null);
}

public LibraryEngine(Repository repository, EvaluationSettings evaluationSettings, NpmProcessor npmProcessor) {
this.repository = requireNonNull(repository, "repository can not be null");
this.settings = requireNonNull(evaluationSettings, "evaluationSettings can not be null");
fhirContext = repository.fhirContext();
this.npmProcessor = npmProcessor;
}

public Repository getRepository() {
Expand Down Expand Up @@ -135,7 +128,7 @@ public IBaseParameters evaluateExpression(
Set<String> expressions = new HashSet<>();
expressions.add("return");

var requestSettings = settings.clone().withNpmProcessor(npmProcessor);
var requestSettings = settings.clone();

requestSettings.getLibrarySourceProviders().add(new StringLibrarySourceProvider(Lists.newArrayList(cql)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public InputStream getLibraryContent(VersionedIdentifier libraryIdentifier, Libr
});
var evaluationSettings = EvaluationSettings.getDefault().withLibrarySourceProviders(libraryResourceProvider);

libraryEngine = new LibraryEngine(repository, evaluationSettings, null);
libraryEngine = new LibraryEngine(repository, evaluationSettings);
repository.create(new Patient().addName(new HumanName().addGiven("me")).setId("Patient/Patient1"));
var patientId = "Patient/Patient1";
var expression =
Expand Down

0 comments on commit 084910e

Please sign in to comment.