Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.opencds.cqf.fhir.benchmark;

import static org.opencds.cqf.fhir.benchmark.questionnaire.TestQuestionnaire.given;
import static org.opencds.cqf.fhir.utility.r4.Parameters.parameters;
import static org.opencds.cqf.fhir.utility.r4.Parameters.stringPart;
import static org.opencds.cqf.fhir.utility.Parameters.newPart;
import static org.opencds.cqf.fhir.utility.Parameters.newStringPart;

import ca.uhn.fhir.context.FhirContext;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
import org.hl7.fhir.r4.model.IdType;
import org.opencds.cqf.fhir.benchmark.questionnaire.TestQuestionnaire.When;
import org.openjdk.jmh.annotations.Benchmark;
Expand Down Expand Up @@ -33,11 +35,27 @@ public void setupTrial() throws Exception {
this.result = given().repositoryFor(FHIR_CONTEXT, "r4/pa-aslp")
.when()
.questionnaireId(new IdType("Questionnaire", "ASLPA1"))
.subjectId("positive")
.parameters(parameters(
stringPart("Service Request Id", "SleepStudy"),
stringPart("Service Request Id", "SleepStudy2"),
stringPart("Coverage Id", "Coverage-positive")));
.context(Arrays.asList(
(IBaseBackboneElement) newPart(
FHIR_CONTEXT,
"context",
newStringPart(FHIR_CONTEXT, "name", "patient"),
newPart(FHIR_CONTEXT, "Reference", "content", "Patient/positive")),
(IBaseBackboneElement) newPart(
FHIR_CONTEXT,
"context",
newStringPart(FHIR_CONTEXT, "name", "ServiceRequest"),
newPart(FHIR_CONTEXT, "Reference", "content", "ServiceRequest/SleepStudy")),
(IBaseBackboneElement) newPart(
FHIR_CONTEXT,
"context",
newStringPart(FHIR_CONTEXT, "name", "ServiceRequest"),
newPart(FHIR_CONTEXT, "Reference", "content", "ServiceRequest/SleepStudy2")),
(IBaseBackboneElement) newPart(
FHIR_CONTEXT,
"context",
newStringPart(FHIR_CONTEXT, "name", "Coverage"),
newPart(FHIR_CONTEXT, "Reference", "content", "Coverage/Coverage-positive"))));
}

@Benchmark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import java.util.List;
import org.hl7.fhir.instance.model.api.IBaseDatatype;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.opencds.cqf.fhir.cql.LibraryEngine;
Expand Down Expand Up @@ -101,7 +102,7 @@ public static GenerateRequest newGenerateRequestForVersion(
}

public static GenerateRequest newGenerateRequestForVersion(IBaseResource profile, LibraryEngine libraryEngine) {
return new GenerateRequest(profile, false, true, libraryEngine);
return new GenerateRequest(List.of(profile), false, true, libraryEngine);
}

public static PopulateRequest newPopulateRequestForVersion(
Expand All @@ -111,7 +112,6 @@ public static PopulateRequest newPopulateRequestForVersion(
Ids.newId(fhirVersion, Ids.ensureIdType(PATIENT_ID, "Patient")),
null,
null,
null,
libraryEngine);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.opencds.cqf.fhir.benchmark.helpers;

import org.opencds.cqf.fhir.cql.EvaluationSettings;
import org.opencds.cqf.fhir.cql.engine.retrieve.RetrieveSettings.SEARCH_FILTER_MODE;
import org.opencds.cqf.fhir.cql.engine.retrieve.RetrieveSettings.TERMINOLOGY_FILTER_MODE;
import org.opencds.cqf.fhir.cql.engine.terminology.TerminologySettings.VALUESET_EXPANSION_MODE;

public class TestEvaluationSettings {

public static EvaluationSettings defaultTestEvaluationSettings() {
var evaluationSettings = EvaluationSettings.getDefault();
evaluationSettings
.getRetrieveSettings()
.setSearchParameterMode(SEARCH_FILTER_MODE.FILTER_IN_MEMORY)
.setTerminologyParameterMode(TERMINOLOGY_FILTER_MODE.FILTER_IN_MEMORY);
evaluationSettings
.getTerminologySettings()
.setValuesetExpansionMode(VALUESET_EXPANSION_MODE.PERFORM_NAIVE_EXPANSION);
return evaluationSettings;
}
}
Loading
Loading