Search in sources :

Example 6 with MeasureConfig

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();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) MeasureConfig(gov.cms.qpp.conversion.model.validation.MeasureConfig) Test(org.junit.jupiter.api.Test)

Example 7 with MeasureConfig

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);
    }
}
Also used : MeasureConfig(gov.cms.qpp.conversion.model.validation.MeasureConfig)

Example 8 with 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);
            }
        }
    }
}
Also used : SupplementalData(gov.cms.qpp.conversion.model.validation.SupplementalData) Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) MeasureConfig(gov.cms.qpp.conversion.model.validation.MeasureConfig)

Example 9 with MeasureConfig

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));
        }
    }
}
Also used : MeasureConfig(gov.cms.qpp.conversion.model.validation.MeasureConfig)

Aggregations

MeasureConfig (gov.cms.qpp.conversion.model.validation.MeasureConfig)9 Node (gov.cms.qpp.conversion.model.Node)3 Test (org.junit.jupiter.api.Test)3 SubPopulation (gov.cms.qpp.conversion.model.validation.SubPopulation)2 List (java.util.List)2 Context (gov.cms.qpp.conversion.Context)1 MeasureDataDecoder (gov.cms.qpp.conversion.decode.MeasureDataDecoder)1 Encoder (gov.cms.qpp.conversion.model.Encoder)1 TemplateId (gov.cms.qpp.conversion.model.TemplateId)1 LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)1 Strata (gov.cms.qpp.conversion.model.validation.Strata)1 SubPopulationLabel (gov.cms.qpp.conversion.model.validation.SubPopulationLabel)1 SupplementalData (gov.cms.qpp.conversion.model.validation.SupplementalData)1 MeasureConfigHelper (gov.cms.qpp.conversion.util.MeasureConfigHelper)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 Locale (java.util.Locale)1 Map (java.util.Map)1 Optional (java.util.Optional)1