-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sde for non-retrieve or in-cql resource return (#129)
* distinguish instance return besides retrieve * throe ResourceNotFound instead of Null pointer * assert contained resource * fix test * the reference for instance resource to be #preceeded
- Loading branch information
mdnazmulkarim
authored
Aug 2, 2022
1 parent
a4f1a21
commit 394fd90
Showing
6 changed files
with
5,174 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...a/org/opencds/cqf/cql/evaluator/measure/r4/MeasureProcessorSdeInstanceExpressionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.opencds.cqf.cql.evaluator.measure.r4; | ||
|
||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; | ||
import org.hl7.fhir.r4.model.MeasureReport; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.assertNotNull; | ||
import static org.testng.Assert.assertThrows; | ||
import static org.testng.Assert.assertTrue; | ||
|
||
public class MeasureProcessorSdeInstanceExpressionTest extends BaseMeasureProcessorTest { | ||
public MeasureProcessorSdeInstanceExpressionTest() { | ||
super("ConditionCategoryPoc.json"); | ||
} | ||
|
||
@Test | ||
public void measure_eval_non_retrieve_resource() { | ||
|
||
assertThrows(ResourceNotFoundException.class, | ||
() -> this.measureProcessor.evaluateMeasure("https://build.fhir.org/ig/HL7/davinci-ra/ConditionCategoryPOC", | ||
"2022-01-01", "2022-12-31", "subject", | ||
"Patient/hist-open-HCC189", null, null, | ||
endpoint, endpoint, endpoint, null)); | ||
|
||
MeasureReport report = this.measureProcessor.evaluateMeasure("https://build.fhir.org/ig/HL7/davinci-ra/ConditionCategoryPOC", | ||
"2022-01-01", "2022-12-31", "subject", | ||
"Patient/hist-closed-HCC189", null, null, | ||
endpoint, endpoint, endpoint, null); | ||
|
||
assertNotNull(report); | ||
|
||
assertTrue(report.getContained().stream().anyMatch( | ||
item -> item.getId().startsWith("hist-closed-HCC189-suspecting-algorithm-encounter"))); | ||
} | ||
} |
Oops, something went wrong.