Skip to content

Commit

Permalink
Merge pull request #758 from CMSgov/revert-755-story-863
Browse files Browse the repository at this point in the history
Revert QPPCT-863
  • Loading branch information
saquino0827 committed Sep 14, 2018
2 parents 8b54c62 + 685bec7 commit 57bd0f2
Show file tree
Hide file tree
Showing 27 changed files with 86 additions and 328 deletions.
5 changes: 0 additions & 5 deletions ERROR_MESSAGES.md
Expand Up @@ -66,8 +66,3 @@ Any text in the following format `(Example)` are considered variables to be fill
* 70 : CT - The measure section measure reference and results has an incorrect number of measure GUID supplied. Please ensure that only one measure GUID is provided per measure.
* 71 : CT - Two or more different measure section measure reference and results have the same measure GUID. Please ensure that each measure section measure reference and results do not have the same measure GUID.
* 72 : CT - The Performance Rate is missing
* 73 : CT - A Reporting Parameter Act has been found in both the IA section and in IA section measures. The IA Section must have one Reporting Parameters Act or all IA Measures must have one Reporting Parameter Act each. Please ensure the Reporting Parameters Act complies with the Implementation Guide (IG). Here is a link to the IG Reporting Parameter Act section: https://ecqi.healthit.gov/system/files/eCQM_QRDA_EC-508_0.pdf#page=80
* 74 : CT - All IA Measures must have one Reporting Parameter Act each. Please ensure the Reporting Parameters Act complies with the Implementation Guide (IG). Here is a link to the IG Reporting Parameter Act section: https://ecqi.healthit.gov/system/files/eCQM_QRDA_EC-508_0.pdf#page=80
* 75 : CT - A Quality Measure Section V2 must contain at least one Quality Measure Reference and Results CMS V2. Please ensure the Quality Measure Section complies with the Implementation Guide (IG) Here is a link to the IG Quality Measure Section: https://ecqi.healthit.gov/system/files/eCQM_QRDA_EC-508_0.pdf#page=33
* 76 : CT - The Quality Measure Reference and Results must contain one Reporting Parameter. Please ensure the Quality Measure Reference and results complies with the Implementation Guide (IG). Here is a link to the IG Quality Measure Reference and Results: https://ecqi.healthit.gov/system/files/eCQM_QRDA_EC-508_0.pdf#page=65
* 77 : CT - A Reporting Parameter Act has been found in both the Quality Measure Section and Quality Measure Reference and Results. The Quality Measure Reference and Results must contain one Reporting Parameter. Please ensure the Quality Measure Reference and results complies with the Implementation Guide (IG). Here is a link to the IG Quality Measure Reference and Results: https://ecqi.healthit.gov/system/files/eCQM_QRDA_EC-508_0.pdf#page=65
Expand Up @@ -8,9 +8,7 @@ public enum DocumentationReference {
CLINICAL_DOCUMENT(19),
PRACTICE_SITE_ADDRESS(25),
REPORTING_PARAMETERS_ACT(80),
MEASURE_IDS(88),
QUALITY_MEASURE_SECTION(33),
QUALITY_MEASURE_RNR(65);
MEASURE_IDS(88);

private static final String BASE_PATH = "https://ecqi.healthit.gov/system/files/eCQM_QRDA_EC-508_0.pdf#page=";
private final String path;
Expand Down
Expand Up @@ -76,8 +76,8 @@ public enum ErrorCode implements LocalizedError {
+ DocumentationReference.PERFORMANCE_PERIOD),
QUALITY_MEASURE_SECTION_REQUIRED_REPORTING_PARAM_REQUIREMENT(32, "The Quality Measure Section must have "
+ "exactly one Reporting Parameter Act. "
+ ImplementationGuide.ENSURE_REPORTING_PARAM_IG
+ ImplementationGuide.REPORTING_PARAM_IG_LINK),
+ "Please ensure the Reporting Parameters Act complies with the Implementation Guide (IG). "
+ "Here is a link to the IG Reporting Parameter Act section: " + DocumentationReference.REPORTING_PARAMETERS_ACT),
PERFORMANCE_RATE_INVALID_VALUE(33, "The Performance Rate `(supplied value)` is invalid. "
+ "It must be a decimal between 0 and 1.", true),
CPC_CLINICAL_DOCUMENT_MISSING_PRACTICE_SITE_ADDRESS(34, "CPC+ submissions must contain a practice site address."
Expand All @@ -96,9 +96,9 @@ public enum ErrorCode implements LocalizedError {
NUMERATOR_DENOMINATOR_INVALID_VALUE(42,
"This PI `(Numerator or Denominator)` element Aggregate Value has an invalid value of '`(value)`'", true),
IA_SECTION_MISSING_IA_MEASURE(43, "The IA Section must have at least one Improvement Activity"),
IA_SECTION_ONLY_ONE_REPORTING_PARAM(44, "The IA Section must have one Reporting Parameter Act. "
+ ImplementationGuide.ENSURE_REPORTING_PARAM_IG
+ ImplementationGuide.REPORTING_PARAM_IG_LINK),
IA_SECTION_MISSING_REPORTING_PARAM(44, "The IA Section must have one Reporting Parameter Act. "
+ "Please ensure the Reporting Parameters Act complies with the Implementation Guide (IG). "
+ "Here is a link to the IG Reporting Parameter Act section: " + DocumentationReference.REPORTING_PARAMETERS_ACT),
IA_SECTION_WRONG_CHILD(45, "The IA Section must contain only Improvement Activities and a Reporting Parameter Act"),
NPI_TIN_COMBINATION_MISSING_CLINICAL_DOCUMENT(46, "Clinical Document Node is required"),
CPC_QUALITY_MEASURE_ID_MISSING_STRATA(48, "Missing strata `(Reporting Stratum UUID)` for "
Expand Down Expand Up @@ -155,27 +155,7 @@ public enum ErrorCode implements LocalizedError {
MEASURES_RNR_WITH_DUPLICATED_MEASURE_GUID(71, "Two or more different measure section measure reference and results have "
+ "the same measure GUID. Please ensure that each measure section measure reference and results do not have "
+ "the same measure GUID."),
PERFORMANCE_RATE_MISSING(72, "The Performance Rate is missing"),
IA_SECTION_IA_MEASURE_DUPLICATE_REPORTING_PARAM(73, "A Reporting Parameter Act has been found in both the "
+ "IA section and in IA section measures. The IA Section must have one Reporting Parameters Act "
+ "or all IA Measures must have one Reporting Parameter Act each. "
+ ImplementationGuide.ENSURE_REPORTING_PARAM_IG
+ ImplementationGuide.REPORTING_PARAM_IG_LINK),
IA_MEASURE_MISSING_REPORTING_PARAM(74, "All IA Measures must have one Reporting Parameter Act each. "
+ ImplementationGuide.ENSURE_REPORTING_PARAM_IG
+ ImplementationGuide.REPORTING_PARAM_IG_LINK),
QUALITY_MEASURE_SECTION_MISSING_MEASURE_RNR(75, "A Quality Measure Section V2 must contain at least one Quality Measure "
+ "Reference and Results CMS V2. Please ensure the Quality Measure Section complies with the Implementation Guide (IG) "
+ "Here is a link to the IG Quality Measure Section: " + DocumentationReference.QUALITY_MEASURE_SECTION),
QUALITY_MEASURE_SECTION_RNR_REQUIRED_REPORTING_PARAM_REQUIREMENT(76, "The Quality Measure Reference and Results must contain "
+ "one Reporting Parameter. Please ensure the Quality Measure Reference and results complies with the Implementation "
+ "Guide (IG). Here is a link to the IG Quality Measure Reference and Results: "
+ DocumentationReference.QUALITY_MEASURE_RNR),
QUALITY_MEASURE_SECTION_AND_RNR_DUPLICATE_REPORTING_PARAM_REQUIREMENT(77, "A Reporting Parameter Act has been found in both "
+ "the Quality Measure Section and Quality Measure Reference and Results. The Quality Measure Reference and Results "
+ "must contain one Reporting Parameter. Please ensure the Quality Measure Reference and results "
+ "complies with the Implementation Guide (IG). Here is a link to the IG Quality Measure Reference and Results: "
+ DocumentationReference.QUALITY_MEASURE_RNR);
PERFORMANCE_RATE_MISSING(72, "The Performance Rate is missing");

private static final Map<Integer, ErrorCode> CODE_TO_VALUE = Arrays.stream(values())
.collect(Collectors.toMap(ErrorCode::getCode, Function.identity()));
Expand Down Expand Up @@ -259,11 +239,4 @@ private static final class ServiceCenter {
static final String MESSAGE = "Please contact the Service Center for assistance via phone at "
+ "1-866-288-8292 or TTY: 1-877-715-6222, or by emailing QPP@cms.hhs.gov";
}

private static final class ImplementationGuide {
static final String ENSURE_REPORTING_PARAM_IG =
"Please ensure the Reporting Parameters Act complies with the Implementation Guide (IG). ";
static final String REPORTING_PARAM_IG_LINK =
"Here is a link to the IG Reporting Parameter Act section: " + DocumentationReference.REPORTING_PARAMETERS_ACT;
}
}
Expand Up @@ -39,6 +39,5 @@ protected void internalEncode(JsonWrapper wrapper, Node node) {
wrapper.putObject(VALUE, value.getBoolean(VALUE));
}
}
encodeReportingParameter(wrapper, node);
}
}
Expand Up @@ -47,9 +47,7 @@ public void internalEncode(JsonWrapper wrapper, Node node) {
wrapper.putObject("measurements", measurementsWrapper);

Optional.ofNullable(node.getParent()).ifPresent(parent -> pilferParent(wrapper, parent));
if (node.getType() == TemplateId.PI_SECTION) {
encodeAciReportingParameter(wrapper, node);
}
encodeReportingParameter(wrapper, node);
}

private void encodeTopLevelValues(JsonWrapper wrapper, Node node) {
Expand Down Expand Up @@ -108,12 +106,12 @@ private void encodeEntityId(JsonWrapper wrapper, Node parent) {
}

/**
* Encodes the reporting parameter section for the ACI section
* Encodes the reporting parameter section
*
* @param wrapper wrapper that holds the section
* @param node PI Section Node
*/
private void encodeAciReportingParameter(JsonWrapper wrapper, Node node) {
private void encodeReportingParameter(JsonWrapper wrapper, Node node) {
JsonOutputEncoder reportingParamEncoder = encoders.get(TemplateId.REPORTING_PARAMETERS_ACT);
Node reportingChild = node.findFirstNode(TemplateId.REPORTING_PARAMETERS_ACT);
if (reportingChild == null) {
Expand Down
@@ -1,12 +1,9 @@
package gov.cms.qpp.conversion.encode;

import gov.cms.qpp.conversion.Context;
import gov.cms.qpp.conversion.decode.ReportingParametersActDecoder;
import gov.cms.qpp.conversion.model.Encoder;
import gov.cms.qpp.conversion.model.Node;
import gov.cms.qpp.conversion.model.Registry;
import gov.cms.qpp.conversion.model.TemplateId;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -50,23 +47,6 @@ protected void internalEncode(JsonWrapper wrapper, Node node) {
}
}

/**
* Provides a means for Reporting Parameter encoding within measure data encoding
*
* @param wrapper object to encode into
* @param node object to encode
*/
protected void encodeReportingParameter(JsonWrapper wrapper, Node node) {
JsonOutputEncoder reportingParamEncoder = encoders.get(TemplateId.REPORTING_PARAMETERS_ACT);
Node reportingChild = node.findFirstNode(TemplateId.REPORTING_PARAMETERS_ACT);
if (reportingChild == null) {
reportingChild = node.getParent().findFirstNode(TemplateId.REPORTING_PARAMETERS_ACT);
}
reportingParamEncoder.encode(wrapper, reportingChild, false);
maintainContinuity(wrapper, reportingChild, ReportingParametersActDecoder.PERFORMANCE_END);
maintainContinuity(wrapper, reportingChild, ReportingParametersActDecoder.PERFORMANCE_START);
}

/**
* Provide a means to associate json path to xpath expression when data is harvested from nodes by means
* other than extraction via the node's specified {@link Encoder}.
Expand Down
Expand Up @@ -54,7 +54,6 @@ public void internalEncode(JsonWrapper wrapper, Node node) {
} else {
encodeMultiPerformanceRate(wrapper, node, measureConfig);
}
encodeReportingParameter(wrapper, node);
}

/**
Expand Down
Expand Up @@ -30,8 +30,7 @@ public enum QrdaScope {
MEASURE_DATA_CMS_V2(TemplateId.MEASURE_DATA_CMS_V2, TemplateId.REPORTING_STRATUM_CMS, DEFAULTS, PI_AGGREGATE_COUNT),
MEASURE_REFERENCE_RESULTS_CMS_V2(
TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2,
TemplateId.PERFORMANCE_RATE_PROPORTION_MEASURE, MEASURE_DATA_CMS_V2,
TemplateId.REPORTING_PARAMETERS_ACT),
TemplateId.PERFORMANCE_RATE_PROPORTION_MEASURE, MEASURE_DATA_CMS_V2),
MEASURE_SECTION_V2(TemplateId.MEASURE_SECTION_V2, MEASURE_REFERENCE_RESULTS_CMS_V2,
TemplateId.REPORTING_PARAMETERS_ACT),

Expand Down
Expand Up @@ -429,25 +429,6 @@ <T> Checker oneChildPolicy(LocalizedError code, TemplateId type, Function<Node,
return this;
}

/**
* Allows for template id duplication checks between a parent and the parent's children
*
* @param code identified error code
* @param suspectedType template id type that can be contain within both parent and child
* @param childTypeToCheck child template id that needs to be checked the suspectedType
* @return The checker, for chaining method calls
*/
Checker noParentChildDuplications(LocalizedError code, TemplateId suspectedType, TemplateId childTypeToCheck) {
if (node.getChildNodes(suspectedType).count() > 0) {
node.getChildNodes(childTypeToCheck).forEach(child -> {
if (child.findFirstNode(suspectedType) != null) {
details.add(detail(code));
}
});
}
return this;
}

/**
* Marks the checked node as being incompletely validated.
*
Expand Down
Expand Up @@ -20,17 +20,7 @@ public class IaSectionValidator extends NodeValidator {
protected void internalValidateSingleNode(Node node) {
check(node)
.childMinimum(ErrorCode.IA_SECTION_MISSING_IA_MEASURE, 1, TemplateId.IA_MEASURE)
.onlyHasChildren(ErrorCode.IA_SECTION_WRONG_CHILD, TemplateId.IA_MEASURE, TemplateId.REPORTING_PARAMETERS_ACT)
.noParentChildDuplications(ErrorCode.IA_SECTION_IA_MEASURE_DUPLICATE_REPORTING_PARAM,
TemplateId.REPORTING_PARAMETERS_ACT, TemplateId.IA_MEASURE);

if (node.getChildNodes(TemplateId.REPORTING_PARAMETERS_ACT).findAny().isPresent()) {
check(node).childExact(
ErrorCode.IA_SECTION_ONLY_ONE_REPORTING_PARAM, 1, TemplateId.REPORTING_PARAMETERS_ACT);
} else {
node.getChildNodes(TemplateId.IA_MEASURE).forEach(iaMeasureNode ->
check(iaMeasureNode).incompleteValidation().childExact(
ErrorCode.IA_MEASURE_MISSING_REPORTING_PARAM, 1, TemplateId.REPORTING_PARAMETERS_ACT));
}
.childExact(ErrorCode.IA_SECTION_MISSING_REPORTING_PARAM, 1, TemplateId.REPORTING_PARAMETERS_ACT)
.onlyHasChildren(ErrorCode.IA_SECTION_WRONG_CHILD, TemplateId.IA_MEASURE, TemplateId.REPORTING_PARAMETERS_ACT);
}
}
Expand Up @@ -20,22 +20,9 @@ public class QualityMeasureSectionValidator extends NodeValidator {
@Override
protected void internalValidateSingleNode(Node node) {
check(node)
.childMinimum(ErrorCode.QUALITY_MEASURE_SECTION_MISSING_MEASURE_RNR,
1, TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2)
.childExact(ErrorCode.QUALITY_MEASURE_SECTION_REQUIRED_REPORTING_PARAM_REQUIREMENT, 1,
TemplateId.REPORTING_PARAMETERS_ACT)
.oneChildPolicy(ErrorCode.MEASURES_RNR_WITH_DUPLICATED_MEASURE_GUID, TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2,
childNode -> childNode.getValue(QualityMeasureIdDecoder.MEASURE_ID))
.noParentChildDuplications(ErrorCode.QUALITY_MEASURE_SECTION_AND_RNR_DUPLICATE_REPORTING_PARAM_REQUIREMENT,
TemplateId.REPORTING_PARAMETERS_ACT, TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2);

if (node.getChildNodes(TemplateId.REPORTING_PARAMETERS_ACT).findAny().isPresent()) {
check(node).childExact(
ErrorCode.QUALITY_MEASURE_SECTION_REQUIRED_REPORTING_PARAM_REQUIREMENT,
1, TemplateId.REPORTING_PARAMETERS_ACT);
} else {
node.getChildNodes(TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2).forEach(qualityMeasureNode ->
check(qualityMeasureNode).incompleteValidation().childExact(
ErrorCode.QUALITY_MEASURE_SECTION_RNR_REQUIRED_REPORTING_PARAM_REQUIREMENT,
1, TemplateId.REPORTING_PARAMETERS_ACT));
}
childNode -> childNode.getValue(QualityMeasureIdDecoder.MEASURE_ID));
}
}
Expand Up @@ -70,6 +70,6 @@ void testIaSectionValidatorMissingReportingParameters() {
Integer error = errors.getErrors().get(0).getDetails().get(0).getErrorCode();

assertThat(ErrorCode.getByCode(error))
.isEqualTo(ErrorCode.IA_MEASURE_MISSING_REPORTING_PARAM);
.isEqualTo(ErrorCode.IA_SECTION_MISSING_REPORTING_PARAM);
}
}
Expand Up @@ -31,15 +31,15 @@ public static void setUp() {
@Test
void testQualityMeasuresContainsPerformanceStart() {
String performanceStart = JsonHelper.readJsonAtJsonPath(json,
"$.measurementSets[0].measurements[0].performanceStart", new TypeRef<String>() { });
"$.measurementSets[0].performanceStart", new TypeRef<String>() { });

assertThat(performanceStart).isEqualTo("2017-01-01");
}

@Test
void testQualityMeasuresContainsPerformanceEnd() {
String performanceStart = JsonHelper.readJsonAtJsonPath(json,
"$.measurementSets[0].measurements[0].performanceEnd", new TypeRef<String>() { });
"$.measurementSets[0].performanceEnd", new TypeRef<String>() { });

assertThat(performanceStart).isEqualTo("2017-12-31");
}
Expand All @@ -63,15 +63,15 @@ void testAciSectionContainsPerformanceEnd() {
@Test
void testIaContainsPerformanceStart() {
String performanceStart = JsonHelper.readJsonAtJsonPath(json,
"$.measurementSets[2].measurements[0].performanceStart", new TypeRef<String>() { });
"$.measurementSets[2].performanceStart", new TypeRef<String>() { });

assertThat(performanceStart).isEqualTo("2017-01-01");
}

@Test
void testIaContainsPerformanceEnd() {
String performanceStart = JsonHelper.readJsonAtJsonPath(json,
"$.measurementSets[2].measurements[0].performanceEnd", new TypeRef<String>() { });
"$.measurementSets[2].performanceEnd", new TypeRef<String>() { });

assertThat(performanceStart).isEqualTo("2017-04-30");
}
Expand Down
Expand Up @@ -16,7 +16,6 @@
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.junit.Ignore;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -49,7 +48,6 @@ void setupTest() {
}

@Test
@Ignore
void testSubmissionApiPostSuccess() throws IOException {
HttpResponse httpResponse = servicePost(qpp);
Assumptions.assumeTrue(endpointIsUp(httpResponse), "Validation api is down");
Expand Down
Expand Up @@ -93,13 +93,13 @@ void compareAciMeasurePerformedMeasureIdAciPea1Denominator() throws XmlException
//IA
@Test
void compareIaMeasurePerformanceEnd() throws XmlException {
String jsonPath = "measurementSets[2].measurements[0].performanceEnd";
String jsonPath = "measurementSets[2].performanceEnd";
helper.executeAttributeTest(jsonPath, "value", "20170430");
}

@Test
void compareIaMeasurePerformanceStart() throws XmlException {
String jsonPath = "measurementSets[2].measurements[0].performanceStart";
String jsonPath = "measurementSets[2].performanceStart";
helper.executeAttributeTest(jsonPath, "value", "20170101");
}

Expand All @@ -118,13 +118,13 @@ void compareIaMeasurePerformedMeasureIdIaEpa1() throws XmlException {
//Quality measure
@Test
void compareQualityMeasurePerformanceEnd() throws XmlException {
String jsonPath = "measurementSets[0].measurements[0].performanceEnd";
String jsonPath = "measurementSets[0].performanceEnd";
helper.executeAttributeTest(jsonPath, "value", "20171231");
}

@Test
void compareQualityMeasurePerformanceStart() throws XmlException {
String jsonPath = "measurementSets[0].measurements[0].performanceStart";
String jsonPath = "measurementSets[0].performanceStart";
helper.executeAttributeTest(jsonPath, "value", "20170101");
}

Expand Down
Expand Up @@ -212,9 +212,9 @@ void testNegativeFullScopeConversion() throws JsonProcessingException {
List<Map<String, String>> content = getErrors(errantScopedConversion(testSection));

//then
// assertWithMessage("Error count should be 7")
// .that(content.size())
// .isEqualTo(7);
assertWithMessage("Error count should be 7")
.that(content.size())
.isEqualTo(7);

assertWithMessage("Errant %s fails as expected", TemplateId.CLINICAL_DOCUMENT)
.that(getErrorMessages(content))
Expand All @@ -224,7 +224,7 @@ void testNegativeFullScopeConversion() throws JsonProcessingException {
.format(AciNumeratorValidator.NUMERATOR_NAME).getMessage(),
ErrorCode.NUMERATOR_DENOMINATOR_MUST_BE_INTEGER.format(AciNumeratorValidator.NUMERATOR_NAME, "Bob").getMessage(),
ErrorCode.NUMERATOR_DENOMINATOR_INVALID_VALUE.format(AciDenominatorValidator.DENOMINATOR_NAME, "empty").getMessage(),
ErrorCode.IA_MEASURE_MISSING_REPORTING_PARAM.getMessage(),
ErrorCode.IA_SECTION_MISSING_REPORTING_PARAM.getMessage(),
ErrorCode.IA_MEASURE_INVALID_TYPE.getMessage());
}

Expand Down Expand Up @@ -271,7 +271,7 @@ void testNegativeIaSectionConversion() throws JsonProcessingException {
assertWithMessage("Errant %s fails as expected", TemplateId.IA_SECTION)
.that(getErrorMessages(content))
.containsExactly(
ErrorCode.IA_MEASURE_MISSING_REPORTING_PARAM.getMessage(),
ErrorCode.IA_SECTION_MISSING_REPORTING_PARAM.getMessage(),
ErrorCode.IA_MEASURE_INVALID_TYPE.getMessage());
}

Expand Down

0 comments on commit 57bd0f2

Please sign in to comment.