use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.
the class QrdaControllerV1Test method uploadQrdaFile.
@Test
void uploadQrdaFile() {
Metadata metadata = new Metadata();
when(qrdaService.convertQrda3ToQpp(any(Source.class))).thenReturn(report);
when(auditService.success(any(ConversionReport.class))).then(invocation -> CompletableFuture.completedFuture(metadata));
ResponseEntity qppResponse = objectUnderTest.uploadQrdaFile(multipartFile, null);
verify(qrdaService, atLeastOnce()).convertQrda3ToQpp(any(Source.class));
assertThat(qppResponse.getBody()).isEqualTo(report.getEncoded().toString());
}
use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.
the class MetadataHelperTest method testExtractsCpcProgramTypeFromChild.
@Test
void testExtractsCpcProgramTypeFromChild() {
Node node = new Node();
Node child = new Node();
child.setType(TemplateId.CLINICAL_DOCUMENT);
child.putValue(ClinicalDocumentDecoder.RAW_PROGRAM_NAME, "CPCPLUS");
node.addChildNode(child);
Metadata metadata = MetadataHelper.generateMetadata(node, MetadataHelper.Outcome.SUCCESS);
assertThat(metadata.getCpc()).startsWith(Constants.CPC_DYNAMO_PARTITION_START);
}
use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.
the class MetadataHelperTest method testChildLacksApm.
@Test
void testChildLacksApm() {
Node node = new Node();
Node child = new Node();
child.setType(TemplateId.CLINICAL_DOCUMENT);
node.addChildNode(child);
Metadata metadata = MetadataHelper.generateMetadata(node, MetadataHelper.Outcome.SUCCESS);
assertThat(metadata.getApm()).isNull();
}
use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.
the class MetadataHelperTest method testChildLacksNpi.
@Test
void testChildLacksNpi() {
Node node = new Node();
Node child = new Node();
child.setType(TemplateId.CLINICAL_DOCUMENT);
node.addChildNode(child);
Metadata metadata = MetadataHelper.generateMetadata(node, MetadataHelper.Outcome.SUCCESS);
assertThat(metadata.getNpi()).isNull();
}
use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.
the class MetadataHelperTest method testExtractsApmFromChild.
@Test
void testExtractsApmFromChild() {
Node node = new Node();
Node child = new Node();
child.setType(TemplateId.CLINICAL_DOCUMENT);
child.putValue(ClinicalDocumentDecoder.ENTITY_ID, MOCK_STRING);
node.addChildNode(child);
Metadata metadata = MetadataHelper.generateMetadata(node, MetadataHelper.Outcome.SUCCESS);
assertThat(metadata.getApm()).isEqualTo(MOCK_STRING);
}
Aggregations