Skip to content

Commit

Permalink
measure basis compliance rule (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
Capt-Mac authored Sep 24, 2024
1 parent f0439b3 commit 6100130
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ private void measureCompatibilityCheck(List<Measure> measures) {
for (Measure measure : measures) {
checkMeasureScoringType(measure);
checkMeasureImprovementNotation(measure);
checkMeasureBasis(measure);
}
}

private void checkMeasureBasis(Measure measure) {
R4MeasureBasisDef measureDef = new R4MeasureBasisDef();
if (!measureDef.isBooleanBasis(measure)) {
throw new IllegalArgumentException(
String.format("CareGaps can't process Measure: %s, it is not Boolean basis.", measure.getIdPart()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,28 @@ void ContinuousVariable_ScoringTypeError() {
"MeasureScoring type: Continuous Variable, is not an accepted Type for care-gaps service"));
}
}

// MinimalProportionResourceBasisSingleGroup
@Test
void MinimalProportionResourceBasisSingleGroup_Subject() {
try {
GIVEN_REPO
.when()
.subject("Patient/female-1988")
.periodStart("2024-01-01")
.periodEnd("2024-12-31")
.measureIds("MinimalProportionResourceBasisSingleGroup")
.statuses("closed-gap")
.statuses("open-gap")
.getCareGapsReport()
.then()
.hasBundleCount(1);
fail("resource based measures should fail");
} catch (IllegalArgumentException e) {
Assertions.assertTrue(
e.getMessage()
.contains(
"CareGaps can't process Measure: MinimalProportionResourceBasisSingleGroup, it is not Boolean basis"));
}
}
}

0 comments on commit 6100130

Please sign in to comment.