use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class MeasureDataTest method inspectMeasureData.
@Test
void inspectMeasureData() {
glossaryMap.forEach((key, value) -> {
MeasureConfig config = configMap.get(key);
assertWithMessage("Missing measure configuration for: %s", key).that(config).isNotNull();
assertWithMessage("Should have the same amount of sub populations").that(config.getStrata()).hasSize(value.getStrata().size());
List<SubPopulation> pops = config.getStrata().stream().map(Strata::getElectronicMeasureUuids).collect(Collectors.toList());
value.getStrata().forEach(stratum -> {
assertWithMessage("Required sub population was not present within: %s", config.getElectronicMeasureId()).that(pops).contains(stratum.getElectronicMeasureUuids());
});
});
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class MipsQualityMeasureIdValidator method internalValidateSingleNode.
/**
* Validates node of all criteria specified for MIPS
* <ul>
* <li>Checks that existing performance rates are valid</li>
* </ul>
* @param node The node to validate.
*/
@Override
protected void internalValidateSingleNode(Node node) {
super.internalValidateSingleNode(node);
MeasureConfig measureConfig = MeasureConfigHelper.getMeasureConfig(node);
if (measureConfig != null) {
validateExistingPerformanceRates(node, measureConfig);
}
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class CpcQualityMeasureIdValidator method internalValidateSingleNode.
/**
* Validates node of all criteria specified for CPC Plus
* <ul>
* <li>checks that the node contains the correct number of performance rates</li>
* </ul>
* @param node The node to validate.
*/
@Override
protected void internalValidateSingleNode(Node node) {
super.internalValidateSingleNode(node);
MeasureConfig measureConfig = MeasureConfigHelper.getMeasureConfig(node);
if (measureConfig != null) {
int requiredPerformanceRateCount = measureConfig.getStrata().size();
thoroughlyCheck(node).childExact(ErrorCode.CPC_QUALITY_MEASURE_ID_INVALID_PERFORMANCE_RATE_COUNT.format(requiredPerformanceRateCount), requiredPerformanceRateCount, TemplateId.PERFORMANCE_RATE_PROPORTION_MEASURE);
}
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdEncoder method createSubPopulationGrouping.
/**
* Creates a grouping of sub populations extracted from the measure configurations
*
* @param node object that holds the nodes to be grouped
* @param measureConfig object that holds the groupings
* @return List of decoded Nodes
*/
private List<Node> createSubPopulationGrouping(Node node, MeasureConfig measureConfig) {
int subPopCount = measureConfig.getSubPopulation().size();
List<Node> subPopNodes = initializeMeasureDataList(subPopCount);
Map<String, Integer> mapPopulationIdToSubPopIndex = createSubPopulationIndexMap(measureConfig);
node.getChildNodes().stream().filter(childNode -> TemplateId.MEASURE_DATA_CMS_V2 == childNode.getType()).forEach(childNode -> {
String populationId = childNode.getValue(MeasureDataDecoder.MEASURE_POPULATION);
Integer subPopIndex = mapPopulationIdToSubPopIndex.get(populationId.toUpperCase(Locale.ENGLISH));
if (subPopIndex != null) {
Node newParentNode = subPopNodes.get(subPopIndex);
newParentNode.addChildNode(childNode);
}
});
return subPopNodes;
}
use of gov.cms.qpp.conversion.model.validation.MeasureConfig in project qpp-conversion-tool by CMSgov.
the class JsonHelperTest method readJsonAtJsonPath.
@Test
void readJsonAtJsonPath() throws Exception {
String measureDataFileName = "measures-data.json";
List<MeasureConfig> configurations;
InputStream measuresInput = ClasspathHelper.contextClassLoader().getResourceAsStream(measureDataFileName);
configurations = JsonHelper.readJsonAtJsonPath(measuresInput, "$", List.class);
assertWithMessage("Expect to get a List of measureConfigs").that(configurations).isNotEmpty();
}
Aggregations