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

measure basis compliance rule #526

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() {
Capt-Mac marked this conversation as resolved.
Show resolved Hide resolved
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"));
}
}
}