use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdEncoderTest method setUp.
@BeforeEach
void setUp() {
qualityMeasureId = new Node(TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2);
qualityMeasureId.putValue("measureId", "40280381-51f0-825b-0152-22b98cff181a");
aggregateCountNode = new Node(TemplateId.ACI_AGGREGATE_COUNT);
aggregateCountNode.putValue("aggregateCount", "600");
Node paymentNode = new Node(TemplateId.PAYER_SUPPLEMENTAL_DATA_ELEMENT_CMS_V2);
paymentNode.putValue("place", "holder");
populationNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
populationNode.putValue(type, SubPopulationLabel.IPOP.name());
populationNode.addChildNode(aggregateCountNode);
denomExclusionNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
denomExclusionNode.putValue(type, SubPopulationLabel.DENEX.name());
denomExclusionNode.addChildNode(aggregateCountNode);
numeratorNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
numeratorNode.putValue(type, SubPopulationLabel.NUMER.name());
numeratorNode.addChildNode(aggregateCountNode);
numeratorNode.addChildNode(paymentNode);
denominatorNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
denominatorNode.putValue(type, SubPopulationLabel.DENOM.name());
denominatorNode.addChildNode(paymentNode);
denominatorNode.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 QualitySectionEncoderTest method internalEncodeNegative.
@Test
void internalEncodeNegative() throws EncodeException {
Node qualitySectionNode = getQualitySectionNode();
qualitySectionNode.addChildNode(new Node());
QualitySectionEncoder encoder = new QualitySectionEncoder(new Context());
JsonWrapper jsonWrapper = new JsonWrapper();
encoder.internalEncode(jsonWrapper, qualitySectionNode);
assertThat(encoder.getDetails()).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.ENCODER_MISSING);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class QualitySectionEncoderTest method internalEncode.
@Test
void internalEncode() throws EncodeException {
Node qualitySectionNode = getQualitySectionNode();
QualitySectionEncoder encoder = new QualitySectionEncoder(new Context());
JsonWrapper jsonWrapper = new JsonWrapper();
encoder.internalEncode(jsonWrapper, qualitySectionNode);
assertThat(jsonWrapper.getString("category")).isEqualTo("quality");
assertThat(jsonWrapper.getString("submissionMethod")).isEqualTo("electronicHealthRecord");
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class ReportingParametersActEncoderTest method missingValuesTest.
@Test
void missingValuesTest() throws Exception {
Node reportingParametersActNode = new Node(TemplateId.REPORTING_PARAMETERS_ACT);
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).isNull();
assertThat(performanceEnd).isNull();
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class DefaultEncoderTest method encodeAllNodes.
@Test
void encodeAllNodes() throws Exception {
InputStream stream = NioHelper.fileToStream(Paths.get("../qrda-files/valid-QRDA-III.xml"));
String xmlFragment = IOUtils.toString(stream, StandardCharsets.UTF_8);
Node node = new QrdaDecoderEngine(new Context()).decode(XmlUtils.stringToDom(xmlFragment));
Node placeHolder = new Node(TemplateId.DEFAULT, node);
node.addChildNode(placeHolder);
JsonWrapper wrapper = new JsonWrapper();
new QppOutputEncoder(new Context()).encode(wrapper, node);
assertThat(wrapper.toString().length() > 10).isTrue();
}
Aggregations