Skip to content

Commit df61716

Browse files
authored
Merge pull request #1107 from CMSgov/feature/QPPSF-8127_Y5_CPCPlus
QPPSF-8127: 2021 CPC+ Updates
2 parents c15ddd5 + 44aeaf0 commit df61716

File tree

117 files changed

+489715
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+489715
-11
lines changed

ERROR_MESSAGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,4 @@ Any text in the following format `(Example)` are considered variables to be fill
8888
* 101 : CT - Denominator count must be equal to Initial Population count for CPC Plus measure population `(measure population id)`.
8989
* 102 : CT - A PI section cannot contain PI_HIE_5 with PI_HIE_1, PI_LVOTC_1, PI_HIE_4, or PI_LVITC_2
9090
* 103 : CT - PCF Submissions must have at least `(PCF Measure minimum)` of the following measures: `(Listing of valid measure ids)`
91+
* 104 : CT - The file contains Promoting Interoperability (PI) data; PI data must not be reported for CPC+

commons/src/main/java/gov/cms/qpp/conversion/model/error/ProblemCode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public enum ProblemCode implements LocalizedProblem {
189189
CPC_PCF_PLUS_DENOMINATOR_COUNT_INVALID(101, "Denominator count must be equal to Initial Population count for CPC Plus measure population `(measure population id)`.", true),
190190
PI_RESTRICTED_MEASURES(102, "A PI section cannot contain PI_HIE_5 with PI_HIE_1, PI_LVOTC_1, PI_HIE_4, or PI_LVITC_2", false),
191191
PCF_TOO_FEW_QUALITY_MEASURE_CATEGORY(103, "PCF Submissions must have at least `(PCF Measure minimum)` "
192-
+ "of the following measures: `(Listing of valid measure ids)`", true);
192+
+ "of the following measures: `(Listing of valid measure ids)`", true),
193+
CPC_PLUS_NO_PI(104, "The file contains Promoting Interoperability (PI) data; PI data must not be reported for CPC+");
193194

194195

195196
private static final Map<Integer, ProblemCode> CODE_TO_VALUE = Arrays.stream(values())

converter/src/main/java/gov/cms/qpp/conversion/validate/CpcClinicalDocumentValidator.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ protected void performValidation(Node node) {
8888

8989

9090
if (Program.isCpc(node)) {
91-
checkErrors(node)
91+
forceCheckErrors(node)
9292
.singleValue(ProblemCode.CPC_PCF_CLINICAL_DOCUMENT_ONLY_ONE_APM_ALLOWED, ClinicalDocumentDecoder.PRACTICE_ID)
93-
.valueIsNotEmpty(ProblemCode.CPC_PCF_CLINICAL_DOCUMENT_EMPTY_APM, ClinicalDocumentDecoder.PRACTICE_ID);
93+
.valueIsNotEmpty(ProblemCode.CPC_PCF_CLINICAL_DOCUMENT_EMPTY_APM, ClinicalDocumentDecoder.PRACTICE_ID)
94+
.doesNotHaveChildren(ProblemCode.CPC_PLUS_NO_PI, TemplateId.PI_SECTION_V2);
95+
checkWarnings(node)
96+
.doesNotHaveChildren(ProblemCode.CPC_PCF_PLUS_NO_IA_OR_PI, TemplateId.IA_SECTION);
9497
validateApmEntityId(node, ClinicalDocumentDecoder.PRACTICE_ID);
98+
} else {
99+
checkWarnings(node)
100+
.doesNotHaveChildren(ProblemCode.CPC_PCF_PLUS_NO_IA_OR_PI, TemplateId.IA_SECTION, TemplateId.PI_SECTION_V2);
95101
}
96-
checkWarnings(node)
97-
.doesNotHaveChildren(ProblemCode.CPC_PCF_PLUS_NO_IA_OR_PI, TemplateId.IA_SECTION, TemplateId.PI_SECTION_V2);
98102

99103
if (hasTinAndNpi(node)) {
100104
validateNumberOfTinsAndNpis(node);

converter/src/main/java/gov/cms/qpp/conversion/validate/PcfQualityMeasureSectionValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import gov.cms.qpp.conversion.model.error.ProblemCode;
99

1010
/**
11-
* Validates a measure groupings for a CPC+ Quality Measure Section node.
11+
* Validates a measure groupings for a PCF Quality Measure Section node.
1212
*/
1313
@Validator(value = TemplateId.MEASURE_SECTION_V4, program = Program.PCF)
1414
public class PcfQualityMeasureSectionValidator extends NodeValidator {
@@ -33,7 +33,7 @@ protected void performValidation(Node node) {
3333
}
3434

3535
/**
36-
* Verify that CPC+ measurement group minimums are met.
36+
* Verify that PCF measurement group minimums are met.
3737
* @param checker node validator helper
3838
*/
3939
void checkGroupMinimum(Checker checker) {
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package gov.cms.qpp.acceptance.cpc;
2+
3+
import gov.cms.qpp.conversion.Context;
4+
import gov.cms.qpp.conversion.Converter;
5+
import gov.cms.qpp.conversion.PathSource;
6+
import gov.cms.qpp.conversion.model.error.AllErrors;
7+
import gov.cms.qpp.conversion.model.error.Detail;
8+
import gov.cms.qpp.conversion.model.error.TransformException;
9+
import gov.cms.qpp.conversion.model.validation.ApmEntityIds;
10+
import org.junit.jupiter.api.Assertions;
11+
import org.junit.jupiter.params.ParameterizedTest;
12+
import org.junit.jupiter.params.provider.MethodSource;
13+
14+
import java.nio.file.Path;
15+
import java.nio.file.Paths;
16+
import java.util.List;
17+
import java.util.stream.Stream;
18+
19+
import static com.google.common.truth.Truth.assertThat;
20+
import static gov.cms.qpp.acceptance.Util.getXml;
21+
22+
public class CpcPlus2021AcceptanceTest {
23+
private static final Path BASE = Paths.get("src/test/resources/cpc_plus/acceptance2021");
24+
private static final Path SUCCESS = BASE.resolve("success");
25+
private static final Path SUCCESS_WARNING = BASE.resolve("warning");
26+
private static final Path FAILURE = BASE.resolve("failure");
27+
private final ApmEntityIds apmEntityIds = new ApmEntityIds("test_apm_entity_ids.json");
28+
29+
static Stream<Path> successData() {
30+
return getXml(SUCCESS);
31+
}
32+
33+
static Stream<Path> failureData() {
34+
return getXml(FAILURE);
35+
}
36+
37+
static Stream<Path> successWithWarningsData() {
38+
return getXml(SUCCESS_WARNING);
39+
}
40+
41+
@ParameterizedTest
42+
@MethodSource("failureData")
43+
void failure(Path entry) {
44+
Converter converter = new Converter(new PathSource(entry), new Context(apmEntityIds));
45+
Assertions.assertThrows(TransformException.class, converter::transform);
46+
}
47+
48+
@ParameterizedTest
49+
@MethodSource("successData")
50+
void success(Path entry) {
51+
AllErrors errors = null;
52+
List<Detail> warnings = null;
53+
54+
Converter converter = new Converter(new PathSource(entry), new Context(apmEntityIds));
55+
56+
try {
57+
converter.transform();
58+
} catch (TransformException failure) {
59+
errors = failure.getDetails();
60+
warnings = failure.getConversionReport().getWarnings();
61+
}
62+
63+
assertThat(errors).isNull();
64+
assertThat(warnings).isNull();
65+
}
66+
67+
@ParameterizedTest
68+
@MethodSource("successWithWarningsData")
69+
void warning(Path entry) {
70+
AllErrors errors = null;
71+
72+
Converter converter = new Converter(new PathSource(entry), new Context(apmEntityIds));
73+
74+
try {
75+
converter.transform();
76+
} catch (TransformException failure) {
77+
errors = failure.getDetails();
78+
}
79+
80+
assertThat(errors).isNull();
81+
assertThat(converter.getReport().getWarnings()).isNotNull();
82+
assertThat(converter.getReport().getWarnings()).isNotEmpty();
83+
}
84+
}

converter/src/test/java/gov/cms/qpp/conversion/validate/CpcClinicalDocumentValidatorTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ void testWarnWhenContainsIa() {
202202
}
203203

204204
@Test
205-
void testWarnWhenContainsPi() {
205+
void testErrorWhenContainsPi() {
206206
Node clinicalDocumentNode = createCpcPlusClinicalDocument();
207207
Node piSection = new Node(TemplateId.PI_SECTION_V2);
208208
clinicalDocumentNode.addChildNode(piSection);
209-
List<Detail> warnings = cpcValidator.validateSingleNode(clinicalDocumentNode).getWarnings();
209+
List<Detail> errors = cpcValidator.validateSingleNode(clinicalDocumentNode).getErrors();
210210

211-
assertThat(warnings)
211+
assertThat(errors)
212212
.comparingElementsUsing(DetailsErrorEquals.INSTANCE)
213-
.contains(ProblemCode.CPC_PCF_PLUS_NO_IA_OR_PI);
213+
.contains(ProblemCode.CPC_PLUS_NO_PI);
214214
}
215215

216216
@Test

0 commit comments

Comments
 (0)