Search in sources :

Example 1 with Metadata

use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.

the class CpcFileControllerV1Test method createMockedUnprocessedDataList.

List<UnprocessedCpcFileData> createMockedUnprocessedDataList() {
    Metadata metadata = new Metadata();
    metadata.setSubmissionLocator("Test");
    metadata.setFileName("TestFile.xml");
    metadata.setApm("TestApmEntity");
    metadata.setCreatedDate(Instant.now());
    metadata.setOverallStatus(true);
    UnprocessedCpcFileData unprocessedCpcFileData = new UnprocessedCpcFileData(metadata);
    List<UnprocessedCpcFileData> unprocessedCpcFileDataList = new ArrayList<>();
    unprocessedCpcFileDataList.add(unprocessedCpcFileData);
    return unprocessedCpcFileDataList;
}
Also used : UnprocessedCpcFileData(gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData) Metadata(gov.cms.qpp.conversion.api.model.Metadata) ArrayList(java.util.ArrayList)

Example 2 with Metadata

use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.

the class QrdaControllerV1Test method testHeadersContainsLocation.

@Test
void testHeadersContainsLocation() {
    Metadata metadata = new Metadata();
    metadata.setUuid(UUID.randomUUID().toString());
    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);
    assertThat(qppResponse.getHeaders().get("Location")).containsExactly(metadata.getUuid());
}
Also used : ResponseEntity(org.springframework.http.ResponseEntity) Metadata(gov.cms.qpp.conversion.api.model.Metadata) ConversionReport(gov.cms.qpp.conversion.ConversionReport) Source(gov.cms.qpp.conversion.Source) Test(org.junit.jupiter.api.Test)

Example 3 with Metadata

use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.

the class MetadataHelperTest method testSuccessOutcome.

@Test
void testSuccessOutcome() {
    Metadata metadata = MetadataHelper.generateMetadata(new Node(), MetadataHelper.Outcome.SUCCESS);
    assertThat(metadata.getOverallStatus()).isTrue();
    assertThat(metadata.getConversionStatus()).isTrue();
    assertThat(metadata.getValidationStatus()).isTrue();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Metadata(gov.cms.qpp.conversion.api.model.Metadata) Test(org.junit.jupiter.api.Test)

Example 4 with Metadata

use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.

the class MetadataHelperTest method testExtractsNpi.

@Test
void testExtractsNpi() {
    Node node = new Node();
    node.putValue(ClinicalDocumentDecoder.NATIONAL_PROVIDER_IDENTIFIER, MOCK_STRING);
    Metadata metadata = MetadataHelper.generateMetadata(node, MetadataHelper.Outcome.SUCCESS);
    assertThat(metadata.getNpi()).isEqualTo(MOCK_STRING);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Metadata(gov.cms.qpp.conversion.api.model.Metadata) Test(org.junit.jupiter.api.Test)

Example 5 with Metadata

use of gov.cms.qpp.conversion.api.model.Metadata in project qpp-conversion-tool by CMSgov.

the class MetadataHelperTest method testExtractsTinFromChild.

@Test
void testExtractsTinFromChild() {
    Node node = new Node();
    Node child = new Node();
    child.setType(TemplateId.CLINICAL_DOCUMENT);
    child.putValue(ClinicalDocumentDecoder.TAX_PAYER_IDENTIFICATION_NUMBER, MOCK_STRING);
    node.addChildNode(child);
    Metadata metadata = MetadataHelper.generateMetadata(node, MetadataHelper.Outcome.SUCCESS);
    assertThat(metadata.getTin()).isEqualTo(MOCK_STRING);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Metadata(gov.cms.qpp.conversion.api.model.Metadata) Test(org.junit.jupiter.api.Test)

Aggregations

Metadata (gov.cms.qpp.conversion.api.model.Metadata)40 Test (org.junit.jupiter.api.Test)24 Node (gov.cms.qpp.conversion.model.Node)16 Source (gov.cms.qpp.conversion.Source)5 ConversionReport (gov.cms.qpp.conversion.ConversionReport)4 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 ResponseEntity (org.springframework.http.ResponseEntity)3 InvalidFileTypeException (gov.cms.qpp.conversion.api.exceptions.InvalidFileTypeException)2 NoFileInDatabaseException (gov.cms.qpp.conversion.api.exceptions.NoFileInDatabaseException)2 Outcome (gov.cms.qpp.conversion.api.helper.MetadataHelper.Outcome)2 AcceptanceTest (gov.cms.qpp.test.annotations.AcceptanceTest)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 InputStreamSupplierSource (gov.cms.qpp.conversion.InputStreamSupplierSource)1 AuditException (gov.cms.qpp.conversion.api.exceptions.AuditException)1 InvalidPurposeException (gov.cms.qpp.conversion.api.exceptions.InvalidPurposeException)1 UncheckedInterruptedException (gov.cms.qpp.conversion.api.exceptions.UncheckedInterruptedException)1 MetadataHelper (gov.cms.qpp.conversion.api.helper.MetadataHelper)1 Constants (gov.cms.qpp.conversion.api.model.Constants)1 UnprocessedCpcFileData (gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData)1 InputStream (java.io.InputStream)1