Skip to content

Commit 482aa19

Browse files
author
Chetan Munegowda
committed
QPPA-10635: add unit tests
1 parent 7152075 commit 482aa19

3 files changed

Lines changed: 108 additions & 0 deletions

File tree

ERROR_MESSAGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ Any text in the following format `(Example)` are considered variables to be fill
9191
* 106 : CT - Promoting Interoperability data should not be reported in a PCF QRDA III file.
9292
* 107 : CT - There's missing NPI/TIN combination. The NPI/TIN `(npi)`-`(tin)` was active on the PCF practitioner roster for `(apm)` during the performance year but was not found in the file. Ensure your submission contains all NPI/TIN combinations that were active on your roster at any point during the performance year. Your QRDA III file and/or roster may require updates. The QPP website doesn't have access to roster updates made after December 13, 2025. It's critical to ensure your roster is up to date and your QRDA III file contains all NPI/TIN values that were active on your roster during the performance year. Contact your health IT vendor if your QRDA III file requires updates. You can find instructions on updating rosters in the PCF Practice Management Guide: (https://cmmi.my.salesforce.com/sfc/p/#i0000000iryR/a/t00000028RsP/dMF_romOmf5VLe7p5lUj8vch11mPmELP6ZuyI16vS.Y).
9393
* 108 : CT - Found an unexpected NPI/TIN combination. The NPI/TIN `(npi)`-`(tin)` was reported in the file but does not exist at the practice or was not active on the PCF practitioner roster for `(apm)` during the performance year. Ensure your submission only contains NPI/TIN combinations that were active on your roster at any point during the performance year. Your QRDA III file and/or roster may require updates. Note: The QPP website does not have access to roster updates made after December 13, 2025. It's critical that you ensure your roster is up to date and your QRDA III file contains all NPI/TIN values that were active on your roster during the performance year. Please contact your health IT vendor if your QRDA III file requires updates. You can find instructions on how updating rosters in the PCF Practice Management Guide (https://cmmi.my.salesforce.com/sfc/p/#i0000000iryR/a/t00000028RsP/dMF_romOmf5VLe7p5lUj8vch11mPmELP6ZuyI16vS.Y).
94+
* 109 : CT - Review the Clinical Document for program `(program name)`. Only the Promoting Interoperability (PI) measure category is permitted; found `(provided category)`.

converter/src/test/java/gov/cms/qpp/conversion/model/ProgramTest.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,41 @@ void testIsAppPlusAppEntityIsTrue() {
136136
assertThat(Program.isAppPlus(node)).isTrue();
137137
}
138138

139+
@Test
140+
void testIsSspIndividualIsTrue() {
141+
Node node = new Node();
142+
node.putValue(RAW_PROGRAM_NAME, "SSP_PI_INDIV");
143+
assertThat(Program.isSsp(node)).isTrue();
144+
}
145+
146+
@Test
147+
void testIsSspGroupIsTrue() {
148+
Node node = new Node();
149+
node.putValue(RAW_PROGRAM_NAME, "SSP_PI_GROUP");
150+
assertThat(Program.isSsp(node)).isTrue();
151+
}
152+
153+
@Test
154+
void testIsSspAppEntityIsTrue() {
155+
Node node = new Node();
156+
node.putValue(RAW_PROGRAM_NAME, "SSP_PI_APMENTITY");
157+
assertThat(Program.isSsp(node)).isTrue();
158+
}
159+
160+
@Test
161+
void testIsSspReturnsFalseForMips() {
162+
Node node = new Node();
163+
node.putValue(RAW_PROGRAM_NAME, "MIPS_INDIV");
164+
assertThat(Program.isSsp(node)).isFalse();
165+
}
166+
167+
@Test
168+
void testIsSspReturnsFalseForNullValue() {
169+
Node node = new Node();
170+
node.putValue(RAW_PROGRAM_NAME, null);
171+
assertThat(Program.isSsp(node)).isFalse();
172+
}
173+
139174
@Override
140175
public Class<? extends Enum<?>> getEnumType() {
141176
return Program.class;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package gov.cms.qpp.conversion.validate;
2+
3+
import static com.google.common.truth.Truth.assertWithMessage;
4+
5+
import java.util.List;
6+
7+
import org.junit.jupiter.api.BeforeEach;
8+
import org.junit.jupiter.api.Test;
9+
10+
import gov.cms.qpp.conversion.model.Node;
11+
import gov.cms.qpp.conversion.model.TemplateId;
12+
import gov.cms.qpp.conversion.model.error.Detail;
13+
import gov.cms.qpp.conversion.model.error.ProblemCode;
14+
import gov.cms.qpp.conversion.model.error.correspondence.DetailsErrorEquals;
15+
16+
class SspClinicalDocumentValidatorTest {
17+
18+
private Node clinicalDocumentNode;
19+
private Node measureSectionNode;
20+
21+
@BeforeEach
22+
void setUp() {
23+
clinicalDocumentNode = new Node(TemplateId.CLINICAL_DOCUMENT);
24+
clinicalDocumentNode.putValue("programName", "SSP");
25+
26+
measureSectionNode = new Node(TemplateId.MEASURE_SECTION_V5);
27+
}
28+
29+
@Test
30+
void testValidCategory_NoErrors() {
31+
measureSectionNode.putValue("category", "pi");
32+
clinicalDocumentNode.addChildNode(measureSectionNode);
33+
34+
SspClinicalDocumentValidator validator = new SspClinicalDocumentValidator();
35+
List<Detail> errors = validator.validateSingleNode(clinicalDocumentNode).getErrors();
36+
37+
assertWithMessage("There should be no errors for category 'pi'")
38+
.that(errors).isEmpty();
39+
}
40+
41+
@Test
42+
void testNullCategory_ShouldError() {
43+
// category is not set
44+
clinicalDocumentNode.addChildNode(measureSectionNode);
45+
46+
SspClinicalDocumentValidator validator = new SspClinicalDocumentValidator();
47+
List<Detail> errors = validator.validateSingleNode(clinicalDocumentNode).getErrors();
48+
49+
assertWithMessage("Must report SSP_PI_ONLY_MEASURE_CATEGORY when category is null")
50+
.that(errors)
51+
.comparingElementsUsing(DetailsErrorEquals.INSTANCE)
52+
.containsExactly(
53+
ProblemCode.SSP_PI_ONLY_MEASURE_CATEGORY.format("SSP", "none")
54+
);
55+
}
56+
57+
@Test
58+
void testInvalidCategory_ShouldError() {
59+
measureSectionNode.putValue("category", "invalid");
60+
clinicalDocumentNode.addChildNode(measureSectionNode);
61+
62+
SspClinicalDocumentValidator validator = new SspClinicalDocumentValidator();
63+
List<Detail> errors = validator.validateSingleNode(clinicalDocumentNode).getErrors();
64+
65+
assertWithMessage("Must report SSP_PI_ONLY_MEASURE_CATEGORY when category is invalid")
66+
.that(errors)
67+
.comparingElementsUsing(DetailsErrorEquals.INSTANCE)
68+
.containsExactly(
69+
ProblemCode.SSP_PI_ONLY_MEASURE_CATEGORY.format("SSP", "invalid")
70+
);
71+
}
72+
}

0 commit comments

Comments
 (0)