use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentDecoderTest method decodeClinicalDocumentInternalDecodeMIPSIndividual.
@Test
void decodeClinicalDocumentInternalDecodeMIPSIndividual() {
Element clinicalDocument = makeClinicalDocument("MIPS_INDIV");
Node testParentNode = new Node();
ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context());
objectUnderTest.setNamespace(clinicalDocument.getNamespace());
objectUnderTest.decode(clinicalDocument, testParentNode);
assertWithMessage("Clinical Document doesn't contain program name").that(testParentNode.getValue(ClinicalDocumentDecoder.PROGRAM_NAME)).isEqualTo(ClinicalDocumentDecoder.MIPS_PROGRAM_NAME);
assertWithMessage("Clinical Document doesn't contain entity type").that(testParentNode.getValue(ClinicalDocumentDecoder.ENTITY_TYPE)).isEqualTo(ClinicalDocumentDecoder.ENTITY_INDIVIDUAL);
assertWithMessage("Clinical Document doesn't contain national provider").that(testParentNode.getValue(ClinicalDocumentDecoder.NATIONAL_PROVIDER_IDENTIFIER)).isEqualTo("2567891421");
assertWithMessage("Clinical Document doesn't contain taxpayer id number").that(testParentNode.getValue(ClinicalDocumentDecoder.TAX_PAYER_IDENTIFICATION_NUMBER)).isEqualTo("123456789");
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class IaMeasureDecoderTest method internalDecode.
@Test
void internalDecode() throws Exception {
IaMeasureDecoder decoder = new IaMeasureDecoder(new Context());
QrdaDecoderEngine engine = new QrdaDecoderEngine(new Context());
Node root = engine.decode(XmlUtils.stringToDom(xmlFragment));
Node iaMeasure = root.findFirstNode(TemplateId.IA_MEASURE);
Node measurePerformed = root.findFirstNode(TemplateId.MEASURE_PERFORMED);
String value = measurePerformed.getValue("measurePerformed");
assertThat(iaMeasure.getValue("measureId")).isEqualTo("IA_EPA_1");
assertThat(measurePerformed.getType()).isEqualTo(TemplateId.MEASURE_PERFORMED);
assertThat(value).isEqualTo("Y");
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class QualitySectionDecoderTest method testInternalDecodeValidXml.
/**
* This tests the QualitySectionDecoder
* This decoders exists as a child of Clinical Document Decoder which is not tested here.
*
* @throws XmlException when parsing invalid xml fragment
*/
@Test
void testInternalDecodeValidXml() throws XmlException {
String validXML = getValidXML();
Element element = XmlUtils.stringToDom(validXML);
Node node = new Node();
QualitySectionDecoder sectionDecoder = new QualitySectionDecoder(new Context());
sectionDecoder.decode(element, node);
assertThat(node.getValue("category")).isEqualTo("quality");
// Performance start and Performance end are parsed by ReportParameters decoder and are not children of this decoder
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class SupplementalDataEthnicityDecoderTest method decodeNodeFromFile.
private void decodeNodeFromFile(String filename) throws XmlException {
context = new Context();
SupplementalDataEthnicityDecoder decoder = new SupplementalDataEthnicityDecoder(context);
QrdaDecoderEngine engine = new QrdaDecoderEngine(context);
root = engine.decode(XmlUtils.stringToDom(filename));
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class SupplementalDataSexDecoderTest method decodeNodeFromFile.
private void decodeNodeFromFile(String filename) throws XmlException {
context = new Context();
SupplementalDataSexDecoder decoder = new SupplementalDataSexDecoder(context);
QrdaDecoderEngine engine = new QrdaDecoderEngine(context);
root = engine.decode(XmlUtils.stringToDom(filename));
}
Aggregations