use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class IaSectionEncoderTest method testEncoderWithoutMeasureValue2.
@Test
void testEncoderWithoutMeasureValue2() {
iaMeasurePerformedNode.putValue("measurePerformed", null);
QppOutputEncoder encoder = new QppOutputEncoder(new Context());
encoder.setNodes(nodes);
StringWriter sw = new StringWriter();
try {
encoder.encode(new BufferedWriter(sw));
} catch (EncodeException e) {
Assertions.fail("Failure to encode: " + e.getMessage());
}
assertThat(sw.toString()).isEqualTo(EXPECTED_NO_MEASURE_VALUE_1);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class MeasureDataEncoderTest method encode.
private JsonWrapper encode(Node measureDataNode) {
JsonWrapper jsonWrapper = new JsonWrapper();
QppOutputEncoder qppOutputEncoder = new QppOutputEncoder(new Context());
qppOutputEncoder.internalEncode(jsonWrapper, measureDataNode);
return jsonWrapper;
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class MeasurePerformedEncoderTest method testMeasurePerformedEncodesIntoWrapper.
@Test
void testMeasurePerformedEncodesIntoWrapper() throws EncodeException {
Node measurePerformedNode = new Node(TemplateId.MEASURE_PERFORMED);
measurePerformedNode.putValue("measurePerformed", "Y");
JsonWrapper jsonWrapper = new JsonWrapper();
QppOutputEncoder qppOutputEncoder = new QppOutputEncoder(new Context());
qppOutputEncoder.internalEncode(jsonWrapper, measurePerformedNode);
assertThat(jsonWrapper.getBoolean("value")).isTrue();
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdMultiEncoderTest method setUp.
@BeforeEach
void setUp() {
qualityMeasureId = new Node(TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2);
qualityMeasureId.putValue(MEASURE_ID, "test1");
Node aggregateCountNode = new Node(TemplateId.ACI_AGGREGATE_COUNT);
aggregateCountNode.putValue("aggregateCount", "600");
eligiblePopulationNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
eligiblePopulationNode.putValue(TYPE, SubPopulationLabel.IPOP.name());
eligiblePopulationNode.putValue(POPULATION_ID, "ipop1");
eligiblePopulationNode.addChildNode(aggregateCountNode);
eligiblePopulationNodeTwo = new Node(TemplateId.MEASURE_DATA_CMS_V2);
eligiblePopulationNodeTwo.putValue(TYPE, SubPopulationLabel.IPOP.name());
eligiblePopulationNodeTwo.putValue(POPULATION_ID, "ipop2");
eligiblePopulationNodeTwo.addChildNode(aggregateCountNode);
eligiblePopulationExclusionNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
eligiblePopulationExclusionNode.putValue(TYPE, SubPopulationLabel.DENEX.name());
eligiblePopulationExclusionNode.putValue(POPULATION_ID, "denex1");
eligiblePopulationExclusionNode.addChildNode(aggregateCountNode);
eligiblePopulationExclusionNodeTwo = new Node(TemplateId.MEASURE_DATA_CMS_V2);
eligiblePopulationExclusionNodeTwo.putValue(TYPE, SubPopulationLabel.DENEX.name());
eligiblePopulationExclusionNodeTwo.putValue(POPULATION_ID, "denex2");
eligiblePopulationExclusionNodeTwo.addChildNode(aggregateCountNode);
eligiblePopulationExceptionNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
eligiblePopulationExceptionNode.putValue(TYPE, SubPopulationLabel.DENEXCEP.name());
eligiblePopulationExceptionNode.putValue(POPULATION_ID, "denexcep1");
eligiblePopulationExceptionNode.addChildNode(aggregateCountNode);
eligiblePopulationExceptionNodeTwo = new Node(TemplateId.MEASURE_DATA_CMS_V2);
eligiblePopulationExceptionNodeTwo.putValue(TYPE, SubPopulationLabel.DENEXCEP.name());
eligiblePopulationExceptionNodeTwo.putValue(POPULATION_ID, "denexcep2");
eligiblePopulationExceptionNodeTwo.addChildNode(aggregateCountNode);
numeratorNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
numeratorNode.putValue(TYPE, SubPopulationLabel.NUMER.name());
numeratorNode.putValue(POPULATION_ID, "numer1");
numeratorNode.addChildNode(aggregateCountNode);
numeratorNodeTwo = new Node(TemplateId.MEASURE_DATA_CMS_V2);
numeratorNodeTwo.putValue(TYPE, SubPopulationLabel.NUMER.name());
numeratorNodeTwo.putValue(POPULATION_ID, "numer2");
numeratorNodeTwo.addChildNode(aggregateCountNode);
denominatorNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
denominatorNode.putValue(TYPE, SubPopulationLabel.DENOM.name());
denominatorNode.putValue(POPULATION_ID, "denom1");
denominatorNode.addChildNode(aggregateCountNode);
denominatorNodeTwo = new Node(TemplateId.MEASURE_DATA_CMS_V2);
denominatorNodeTwo.putValue(TYPE, SubPopulationLabel.DENOM.name());
denominatorNodeTwo.putValue(POPULATION_ID, "denom2");
denominatorNodeTwo.addChildNode(aggregateCountNode);
encoder = new QualityMeasureIdEncoder(new Context());
wrapper = new JsonWrapper();
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class ReportingParametersActEncoderTest method internalEncode.
@Test
void internalEncode() throws Exception {
Node reportingParametersActNode = new Node(TemplateId.REPORTING_PARAMETERS_ACT);
reportingParametersActNode.putValue(ReportingParametersActEncoder.PERFORMANCE_START, "20170101");
reportingParametersActNode.putValue(ReportingParametersActEncoder.PERFORMANCE_END, "20171231");
JsonWrapper outputWrapper = new JsonWrapper();
ReportingParametersActEncoder encoder = new ReportingParametersActEncoder(new Context());
encoder.internalEncode(outputWrapper, reportingParametersActNode);
String performanceStart = outputWrapper.getString(ReportingParametersActEncoder.PERFORMANCE_START);
String performanceEnd = outputWrapper.getString(ReportingParametersActEncoder.PERFORMANCE_END);
assertThat(performanceStart).isEqualTo("2017-01-01");
assertThat(performanceEnd).isEqualTo("2017-12-31");
}
Aggregations