Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9e82758
Introduce clinical-reasoning changes to support HEDIS measures. Take…
lukedegruchy Jun 24, 2025
533ed79
Cleanup. Remove comments. Remove sysouts. Remove useless logging. …
lukedegruchy Jun 24, 2025
7964b1c
More Sonar.
lukedegruchy Jun 24, 2025
046f62c
Add traces to debug Linux test failures.
lukedegruchy Jun 25, 2025
009f584
Add more debug info.
lukedegruchy Jun 25, 2025
858181e
Try capitalizing first letter and lowercasing the rest for fhir types…
lukedegruchy Jun 25, 2025
064d288
Try making a case-insensitive subdirectory match.
lukedegruchy Jun 25, 2025
9e6ff56
Use case-insensitive resolve pattern for the entire class.
lukedegruchy Jun 25, 2025
3a856c0
Fix path verified by unit test to use the correct spacing for all lay…
lukedegruchy Jun 25, 2025
37b6307
Revert to some case-sensitive FS operations in order to fix LibraryEn…
lukedegruchy Jun 25, 2025
0f36a89
Rename the "Patient" test folder to "patient". Revert to previous f…
lukedegruchy Jun 25, 2025
7922e67
Rename another patient test directory.
lukedegruchy Jun 25, 2025
7a74bdb
Add more logging.
lukedegruchy Jun 25, 2025
7a8d3c8
Make Compartment lowercase in the IgRepository compartment. Rename C…
lukedegruchy Jun 25, 2025
86b0d2f
Clean up logging. First round of ni2 refactoring.
lukedegruchy Jun 25, 2025
44c9a7d
Finish nio2 refactoring. Spotless.
lukedegruchy Jun 25, 2025
6a00bf9
Spotless.
lukedegruchy Jun 25, 2025
d261052
Optimize CqlCommand code for nio2 and use of Streams to join strings.…
lukedegruchy Jun 26, 2025
2e82e63
Spotless.
lukedegruchy Jun 26, 2025
fa9aeb8
Fix Sonar issues.
lukedegruchy Jun 26, 2025
0d60835
Small tweaks.
lukedegruchy Jun 26, 2025
1dfa428
Add testing for measure reports and txtresults files to CliTest. Als…
lukedegruchy Jun 27, 2025
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
15 changes: 14 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,18 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
"configurations": [
{
"type": "java",
"name": "Launch Java Program",
"request": "launch",
"mainClass": "org.opencds.cqf.fhir.cr.cli.Main",
"projectName": "cqf-fhir-cr-cli",
"args": [
"argfile",
"args.txt"
],
}

]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.EnumSet;
import java.util.Set;
import java.util.StringJoiner;
import org.opencds.cqf.cql.engine.execution.CqlEngine;

// TODO: Eventually, the cql-engine needs to expose these itself.
Expand All @@ -12,6 +13,7 @@ public class CqlEngineOptions {
private Integer pageSize;
private Integer maxCodesPerQuery;
private Integer queryBatchThreshold;
private boolean enableHedisCompatibilityMode = false;

public Set<CqlEngine.Options> getOptions() {
return this.options;
Expand Down Expand Up @@ -61,9 +63,30 @@ public void setQueryBatchThreshold(Integer value) {
this.queryBatchThreshold = value;
}

public void setEnableHedisCompatibilityMode(boolean enableHedisCompatibilityMode) {
this.enableHedisCompatibilityMode = enableHedisCompatibilityMode;
}

public boolean isEnableHedisCompatibilityMode() {
return this.enableHedisCompatibilityMode;
}

public static CqlEngineOptions defaultOptions() {
CqlEngineOptions result = new CqlEngineOptions();
result.options.add(CqlEngine.Options.EnableExpressionCaching);
return result;
}

@Override
public String toString() {
return new StringJoiner(", ", CqlEngineOptions.class.getSimpleName() + "[", "]")
.add("options=" + options)
.add("isDebugLoggingEnabled=" + isDebugLoggingEnabled)
.add("shouldExpandValueSets=" + shouldExpandValueSets)
.add("pageSize=" + pageSize)
.add("maxCodesPerQuery=" + maxCodesPerQuery)
.add("queryBatchThreshold=" + queryBatchThreshold)
.add("enableHedisCompatibilityMode=" + enableHedisCompatibilityMode)
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.repository.IRepository;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -16,6 +17,7 @@
import org.opencds.cqf.cql.engine.runtime.Interval;
import org.opencds.cqf.cql.engine.terminology.TerminologyProvider;
import org.opencds.cqf.fhir.utility.iterable.BundleMappingIterable;
import org.opencds.cqf.fhir.utility.repository.ig.IgRepository;

public class RepositoryRetrieveProvider extends BaseRetrieveProvider {
private final IRepository repository;
Expand Down Expand Up @@ -54,12 +56,23 @@ public Iterable<Object> retrieve(
this.configureProfile(config, dataType, templateId);
this.configureDates(config, dataType, datePath, dateLowPath, dateHighPath, dateRange);

var resources = this.repository.search(bt, resourceType, config.searchParams);
Map<String, String> headers = headersForContext(context, contextValue);

var resources = this.repository.search(bt, resourceType, config.searchParams, headers);

var iter = new BundleMappingIterable<>(repository, resources, p -> p.getResource());
return iter.toStream().filter(config.filter).collect(Collectors.toList());
}

// Create headers for the FHIR compartment search (e.g. X-FHIR-Compartment: Patient/123)
private Map<String, String> headersForContext(String context, Object contextValue) {
if (context == null || contextValue == null) {
return Collections.emptyMap();
}

return Map.of(IgRepository.FHIR_COMPARTMENT_HEADER, context + "/" + contextValue.toString());
}

private void configureProfile(SearchConfig config, String dataType, String templateId) {
var mode = this.getRetrieveSettings().getSearchParameterMode();
switch (mode) {
Expand Down
6 changes: 6 additions & 0 deletions cqf-fhir-cr-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
<version>3.23.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opencds.cqf.fhir</groupId>
<artifactId>cqf-fhir-cr</artifactId>
<version>3.23.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
Loading