Skip to content

Refactor $cql operation processor to be version agnostic#922

Merged
JPercival merged 7 commits intomasterfrom
refactor-cql-processor-2
Feb 19, 2026
Merged

Refactor $cql operation processor to be version agnostic#922
JPercival merged 7 commits intomasterfrom
refactor-cql-processor-2

Conversation

@barhodes
Copy link
Contributor

@barhodes barhodes commented Feb 18, 2026

Refactored the processor for the $cql operation to be version agnostic and aligned with the other CR processors. Added support for the prefetchData parameter for both the $cql and Library/$evaluate operations.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Formatting check succeeded!

@barhodes barhodes force-pushed the refactor-cql-processor-2 branch from 1877799 to c1708a9 Compare February 19, 2026 12:50
@sonarqubecloud
Copy link

@barhodes barhodes marked this pull request as ready for review February 19, 2026 13:32
@JPercival JPercival merged commit bd8dc73 into master Feb 19, 2026
8 of 9 checks passed
@JPercival JPercival deleted the refactor-cql-processor-2 branch February 19, 2026 20:14
Copy link
Contributor

@c-schuler c-schuler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good! A few minor recommendations/comments. A bigger concern is the gaps in testing. The processor is now version agnostic, but it appears as though the tests are R4-only.

translatedLibrary.getIdentifier() == null
? null
: translatedLibrary.getIdentifier().getId())
.withVersion(translatedLibrary.getIdentifier().getVersion());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null check for withId(), but not for withVersion()?

IRepository dataRepository,
IRepository contentRepository,
IRepository terminologyRepository) {
repository = proxy(repository, useServerData, dataRepository, contentRepository, terminologyRepository);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This looks like a preexisting project-wide problem, but we should really be using a local variable here, right? Won't this cause a cascading wrap scenario if a CqlProcessor is reused across multiple evaluate() calls? For example, on construction this.repository would be the "originalRepo", then the first call would be ProxyRepository(originalRepo,...), then the second call would be ProxyRepository(ProxyRepository(originalRepo...)), and so on with subsequent calls. Seems like a lot of potential issues could spring from this pattern (performance, stale endpoint references, etc).

Not saying this needs to be addressed in this PR, but maybe we should create an issue to call this out?

fhirVersion = libraryEngine.getRepository().fhirContext().getVersion().getVersion();
this.libraryEngine = libraryEngine;
this.subjectId = subjectId;
if (expression == null && content == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check for empty expression string? If expression is "", would it fail downstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments