use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class MeasureConfigHelperTest method testGetMeasureConfigSuccess.
@Test
void testGetMeasureConfigSuccess() {
Node measureNode = new Node(TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2);
measureNode.putValue(MeasureConfigHelper.MEASURE_ID, "40280381-51f0-825b-0152-229bdcab1702");
MeasureConfig config = MeasureConfigHelper.getMeasureConfig(measureNode);
assertThat(config).isNotNull();
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdEncoder method internalEncode.
/**
* Encodes an Quality Measure Id into the QPP format
*
* @param wrapper JsonWrapper that will represent the Quality Measure Identifier
* @param node Node that represents the Quality Measure Identifier
* @throws EncodeException If an error occurs during encoding
*/
@Override
public void internalEncode(JsonWrapper wrapper, Node node) {
MeasureConfig measureConfig = MeasureConfigHelper.getMeasureConfig(node);
String measureId = measureConfig.getMeasureId();
wrapper.putString(MEASURE_ID, measureId);
if (isASinglePerformanceRate(measureConfig)) {
encodeChildren(wrapper, node, measureConfig);
} else {
encodeMultiPerformanceRate(wrapper, node, measureConfig);
}
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class CpcMeasureDataValidator method validateAllSupplementalNodesOfSpecifiedType.
/**
* Validates all of the nodes under one specified Supplemental Type
*
* @param node Parent node of the nodes to be validated
* @param currSupplementalDataTemplateId Template Id of the nodes to be validated
* @param supplementalDataType current data type to be validated
*/
private void validateAllSupplementalNodesOfSpecifiedType(Node node, TemplateId currSupplementalDataTemplateId, SupplementalType supplementalDataType) {
Set<Node> supplementalDataNodes = node.getChildNodes(currSupplementalDataTemplateId).collect(Collectors.toSet());
EnumSet<SupplementalData> codes = EnumSet.copyOf(SupplementalData.getSupplementalDataSetByType(supplementalDataType));
MeasureConfig measureConfig = MeasureConfigHelper.getMeasureConfig(node.getParent());
if (measureConfig != null) {
String electronicMeasureId = measureConfig.getElectronicMeasureId();
for (SupplementalData supplementalData : codes) {
Node validatedSupplementalNode = filterCorrectNode(supplementalDataNodes, supplementalData);
if (validatedSupplementalNode == null) {
addSupplementalValidationError(node, supplementalData, electronicMeasureId);
} else {
LocalizedError error = makeIncorrectCountSizeLocalizedError(node, supplementalData.getCode(), electronicMeasureId);
check(validatedSupplementalNode).childExact(error, 1, TemplateId.ACI_AGGREGATE_COUNT);
}
}
}
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidator method validateMeasureConfigs.
/**
* Validate measure configurations
*
* @param node to validate
*/
private void validateMeasureConfigs(Node node) {
MeasureConfig measureConfig = MeasureConfigHelper.getMeasureConfig(node);
if (measureConfig != null) {
validateAllSubPopulations(node, measureConfig);
} else {
String value = node.getValue(MeasureConfigHelper.MEASURE_ID);
if (value != null) {
// This check has already been made and a detail will exist if value is null.
DEV_LOG.error("MEASURE_GUID_MISSING " + value);
List<String> suggestions = MeasureConfigs.getMeasureSuggestions(value);
addValidationError(Detail.forErrorAndNode(ErrorCode.MEASURE_GUID_MISSING.format(value, suggestions), node));
}
}
}
Aggregations