Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeasureEvaluator Instance Creation #304

Open
c-schuler opened this issue Jun 20, 2024 · 4 comments
Open

MeasureEvaluator Instance Creation #304

c-schuler opened this issue Jun 20, 2024 · 4 comments
Labels
question Further information is requested

Comments

@c-schuler
Copy link
Collaborator

The MeasureEvaluator employs a private constructor requiring the use of a static method (compile(FhirContext fhirContext, Bundle bundle)) to create a new instance. That is fine, but the compile method actually evaluates the measure with hardcoded parameters and ignores the result. I am confused with this functionality and am skeptical of its usefulness. Shouldn't the compile method simply return a new instance of the MeasureEvaluator based on the passed in FhirContext and Bundle?

@c-schuler c-schuler added the question Further information is requested label Jun 20, 2024
@seanmcilvenna
Copy link
Contributor

I'm going to lean on @smailliwcs a bit to explain this... But, I believe we do that with hard-coded parameters once to initiate things. We evaluate against a hard-coded single-patient bundle for the measure and fhir context to initiate the compilation, which we don't have direct access to. Without it, the first call to evaluate() takes extra time because it's doing that compilation step. For metrics and monitoring, we want to get that out of the way when the service launches asap.

@c-schuler
Copy link
Collaborator Author

So basically a pre-flight request to populate the cache?

@smailliwcs
Copy link
Contributor

Exactly. Otherwise the first calls to evaluate (can be multiple due to concurrent requests) take longer than they would with a warm cache.

Historically, there was another reason to do this "precompilation" step: a thread-safety issue in ensureSupplementalDataElementSearchParameter could cause exceptions to be thrown on n - 1 threads (out of n concurrent evaluations). But I don't think that's a problem with our current setup (in-process evaluation using InMemoryFhirRepository).

@seanmcilvenna
Copy link
Contributor

Is this question answered? Can we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants