Commit 3b379c8
Optimize CQL library evaluation and consequently measure evaluation (#688)
* First attempt to flip measure and subject looping for population based measure reports.
* Document new unit test failures.
* Abandon previous experiment. Push up evaluate measure callers to the service layers for single and multi measures and collect data. Leave old evaluate measure code within processor for the time being as there are still unit test failures otherwise, hopefully limited to single measure evaluation.
* Capture discussion with Justin and requirements but lots of compile errors.
* Put in place changes agreed with Justin and all tests except one are passing.
* Fix CollectData unit test by making resolveParameterMap work with a mutable list.
* Spotless. Delete some cruft.
* Cleanup and new TODOs.
* Fix compile errors.
* Small tweaks and TODOs.
* Overhaul CompositeEvaluationResultsPerMeasure to include errors as well as successful results, and enhancing it to mutate a given MeasureDef with errors should they exist. Start cleaning up. Spotless.
* Cleanup. Spotless.
* Spotless.
* Handle new MeasureProcessorUtils#setMeasurePeriod, ensure all callers call it correctly, and get rid of duplicate methods.
* Clean up todos and ensure library checking is done in only one place.
* More refactoring and resolve TODOs.
* Resolve sonar warnings.
* Reverse a sonar change that caused errors. Fix other sonar issues. Tests pass now.
* Initialize the CqlEngine context at the beginning, pass it to down to the CQL library evaluation, and then to the measure evaluation.
* More cleanup of dead code, commented out code, and dead parameters.
* Fix compile error. Fix more sonar. Spotless. Get rid of unused constructor param.
* Get rid of legacy CQL evaluation and have DSTU3 use the new code.
* Fix sonar and reverse some minor changes.
* Fix DSTU3 tests and resolve last sonar.
* More refactoring to DRY and to remove unused fields.
* Small refactoring for multi-measure service.
* Optimize performance of CompositeEvaluationResultsPerMeasure.
* Spotless.
* Small refactoring.
* Spotless.
* Replace all java.annotation imports with jakarta.annotation.
* Add comment about new approach, as per code review.
* Slight fix to algorithm and TODO for CQL fix.
* Start integrating with new CQL branch with caching optimizations.
* Use the same made-up version of CQL that the CQL branch is using.
* Low risk changes including adding having CompositeEvaluationResultsPerMeasure handle adding multiple errors at once and a TODO to get rid of a record once fixes are complete.
* Grab changes from branch to integrate with CQL changes to validate library identifiers. Spotless.
* Fix compile error.
* Experiment more with algorithms. Thus far, if we pass more than one library identifier at a time, we cause definite failures in MultiMeasureServiceTest and intermittent failures on at least one other test if we run the whole module test suite.
* Flip to the new code from the old code in MeasureProcessorUtils. Add a TODO about what needs to be done to the test to make it pass under the new code. Add a TODO about another unexpected failure as well.
* Assert that the mulitmeasure "allsubjects" tests still pass but contain InvalidInterval errors.
* Leverage multi-measure error handling code added to CQL. Spotless. Still one test failing that I need to figure out.
* Set custom version in the pom for now.
* Add TODO. Reverse a bunch of logging changes. Ensure we don't queue up an evaluation result if the library did not evaluate successfully.
* Attempt to set up a successful complex layer library test but no success yet.
* Add unit test.
* Change approach to 1B testing to filter based on meta profiles. Add meta profiles to all encounters and change IDs accordingly. Adjust CQLs. Start trying to assert stratifiers from tests.
* Update to a new stub version ahead of the current master version of clinical-reasoning. Make R4PopulationBasisValidator more error tolerant, especially if CQL returns Iterators instead of Lists. Enhance MultiMeasure test util.
* Make final changes to MultiLibEvalComplexCqlTest. Add back some logging.
* First set of refactoring changes.
* More cleanup.
* Start merging old and new code bases. Clean up more cruft.
* More refactoring to merge old and new code branches. More cleanup.
* Small tweaks and integrate with latest CQL branch changes.
* Add temporary logging for db queries.
* Set up complex $evaluate test, which doesn't yet exercise multiple libraries.
* Adapt to new CQL result handling code, notably for error and exception handling.
* Adapt to new CQL exception handling code. Comment out RepositoryLoggingProxy.
* Adapt to new CQL library resolution/compilation code. Add a test that captures the scenario we're trying to optimize for. Start getting rid of logs.
* Fix test input directory structures to conform to new standard. Add unversioned local files.
* Fix some TODOs including tests, logging, and javadoc.
* Address rest of TODOs and add another test.
* Sync up with pom versions from master. Clean up more cruft.
* Change CQL version to 3.28.0.
* Fix tests for new evaluatedMeasures() logic.
* Fix capitalization
---------
Co-authored-by: JP <jonathan.percival@smilecdr.com>
Co-authored-by: Jonathan Percival <jonathan.i.percival@gmail.com>1 parent 61cd1a8 commit 3b379c8
100 files changed
Lines changed: 2598 additions & 274 deletions
File tree
- cqf-fhir-benchmark/src/test/java/org/opencds/cqf/fhir/benchmark/measure/r4
- cqf-fhir-cql/src
- main/java/org/opencds/cqf/fhir/cql
- test/java/org/opencds/cqf/fhir/cql
- cqf-fhir-cr-cli/src
- main/java/org/opencds/cqf/fhir/cr/cli/command
- test/java/org/opencds/cqf/fhir/cr/cli
- cqf-fhir-cr-hapi/src/main/java/org/opencds/cqf/fhir/cr/hapi/config/r4
- cqf-fhir-cr-spring/src/main/java/org/opencds/cqf/fhir/cr/spring/measure
- cqf-fhir-cr/src
- main/java/org/opencds/cqf/fhir/cr/measure
- common
- dstu3
- r4
- utils
- test
- java/org/opencds/cqf/fhir/cr
- cpg/r4
- measure
- helper
- r4
- resources/org/opencds/cqf/fhir/cr
- cpg/r4/libraryevalcomplexdeps/input
- cql
- resources/library
- tests
- encounter
- patient
- measure/r4
- CqlOptimize/input
- cql
- resources
- library
- measure
- tests
- encounter
- patient
- MultiLibEvalComplexCql/input
- cql
- resources
- library
- measure
- tests
- encounter
- patient
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 41 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
328 | | - | |
329 | | - | |
| 330 | + | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
339 | | - | |
340 | | - | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | | - | |
344 | | - | |
345 | | - | |
| 345 | + | |
| 346 | + | |
346 | 347 | | |
347 | | - | |
| 348 | + | |
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | | - | |
353 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
354 | 359 | | |
355 | 360 | | |
356 | 361 | | |
357 | 362 | | |
358 | 363 | | |
359 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
360 | 390 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 140 | + | |
147 | 141 | | |
148 | 142 | | |
149 | 143 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 51 | + | |
| 52 | + | |
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
| |||
90 | 85 | | |
91 | 86 | | |
92 | 87 | | |
93 | | - | |
94 | | - | |
| 88 | + | |
95 | 89 | | |
96 | 90 | | |
97 | 91 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 29 | + | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
Lines changed: 110 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
0 commit comments