use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class MeasureDataDecoderTest method before.
@BeforeEach
void before() throws XmlException {
Context context = new Context();
QrdaDecoderEngine engine = new QrdaDecoderEngine(context);
placeholder = engine.decode(XmlUtils.stringToDom(happy));
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class NullReturnDecoderTest method decodeReturnNullNode.
@Test
void decodeReturnNullNode() throws Exception {
String xmlFragment = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<root xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:hl7-org:v3\">\n" + " <null resultName=\"result\" resultValue=\"mytestvalue\">\n" + " <templateId root=\"null.return\"/>\n" + " </null>" + "</root>";
// Get the root wrapper node
Node root = new QrdaDecoderEngine(new Context()).decode(XmlUtils.stringToDom(xmlFragment));
// We get a placeholder when the decoder returns null Node
assertWithMessage("root node should have one child node").that(root.getType()).isEquivalentAccordingToCompareTo(TemplateId.PLACEHOLDER);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class PerformanceRateProportionMeasureDecoderTest method decodeNodeFromFile.
private void decodeNodeFromFile(String filename) throws XmlException {
context = new Context();
PerformanceRateProportionMeasureDecoder decoder = new PerformanceRateProportionMeasureDecoder(context);
QrdaDecoderEngine engine = new QrdaDecoderEngine(context);
placeholder = engine.decode(XmlUtils.stringToDom(filename));
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class QrdaDecoderEngineTest method mockDecoders.
@BeforeAll
static void mockDecoders() {
context = new Context();
TestHelper.mockDecoder(context, TestChildContinue.class, new ComponentKey(TemplateId.ACI_SECTION, Program.ALL));
TestHelper.mockDecoder(context, TestChildFinish.class, new ComponentKey(TemplateId.IA_SECTION, Program.ALL));
TestHelper.mockDecoder(context, TestChildEscape.class, new ComponentKey(TemplateId.MEASURE_SECTION_V2, Program.ALL));
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class PlaceholderEncoderTest method encodePlaceholderNodeNegative.
@Test
void encodePlaceholderNodeNegative() throws EncodeException {
// setup
Node placeHolder = new Node(TemplateId.PLACEHOLDER);
placeHolder.addChildNode(new Node());
JsonWrapper wrapper = new JsonWrapper();
PlaceholderEncoder encoder = new PlaceholderEncoder(new Context());
// when
encoder.internalEncode(wrapper, placeHolder);
// then
assertThat(encoder.getDetails()).hasSize(1);
}
Aggregations