use of gov.cms.bfd.model.rif.samples.StaticRifResource in project beneficiary-fhir-data by CMSgov.
the class HHAClaimTransformerTest method transformSampleARecord.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.HHAClaimTransformer#transform(Object)} works as expected
* when run against the {@link StaticRifResource#SAMPLE_A_HHA} {@link HHAClaim}.
*
* @throws FHIRException (indicates test failure)
*/
@Test
public void transformSampleARecord() throws FHIRException {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
HHAClaim claim = parsedRecords.stream().filter(r -> r instanceof HHAClaim).map(r -> (HHAClaim) r).findFirst().get();
ExplanationOfBenefit eob = HHAClaimTransformer.transform(new MetricRegistry(), claim, Optional.empty());
assertMatches(claim, eob);
}
use of gov.cms.bfd.model.rif.samples.StaticRifResource in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerTest method transformSampleARecord.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.SNFClaimTransformer#transform(Object)} works as expected
* when run against the {@link StaticRifResource#SAMPLE_A_SNF} {@link SNFClaim}.
*
* @throws FHIRException (indicates test failure)
*/
@Test
public void transformSampleARecord() throws FHIRException {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
SNFClaim claim = parsedRecords.stream().filter(r -> r instanceof SNFClaim).map(r -> (SNFClaim) r).findFirst().get();
ExplanationOfBenefit eob = SNFClaimTransformer.transform(new MetricRegistry(), claim, Optional.empty());
assertMatches(claim, eob);
}
use of gov.cms.bfd.model.rif.samples.StaticRifResource in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformerTest method transformSampleARecord.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.CarrierClaimTransformer#transform(Object)} works as
* expected when run against the {@link StaticRifResource#SAMPLE_A_CARRIER} {@link CarrierClaim}.
*
* @throws FHIRException (indicates test failure)
*/
@Test
public void transformSampleARecord() throws FHIRException {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
CarrierClaim claim = parsedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
claim.setLastUpdated(Instant.now());
ExplanationOfBenefit eobWithLastUpdated = CarrierClaimTransformer.transform(new MetricRegistry(), claim, Optional.of(true));
assertMatches(claim, eobWithLastUpdated, Optional.of(true));
claim.setLastUpdated(Optional.empty());
ExplanationOfBenefit eobWithoutLastUpdated = CarrierClaimTransformer.transform(new MetricRegistry(), claim, Optional.of(true));
assertMatches(claim, eobWithoutLastUpdated, Optional.of(true));
}
use of gov.cms.bfd.model.rif.samples.StaticRifResource in project beneficiary-fhir-data by CMSgov.
the class LoadedFilterManagerIT method loadData.
/**
* @param sampleResources the sample RIF resources to load
*/
private static void loadData(DataSource dataSource, List<StaticRifResource> sampleResources) {
LoadAppOptions loadOptions = CcwRifLoadTestUtils.getLoadOptions();
RifFilesEvent rifFilesEvent = new RifFilesEvent(Instant.now(), sampleResources.stream().map(StaticRifResource::toRifFile).collect(Collectors.toList()));
// Create the processors that will handle each stage of the pipeline.
RifFilesProcessor processor = new RifFilesProcessor();
RifLoader loader = new RifLoader(loadOptions, PipelineTestUtils.get().getPipelineApplicationState());
// Link up the pipeline and run it.
for (RifFileEvent rifFileEvent : rifFilesEvent.getFileEvents()) {
RifFileRecords rifFileRecords = processor.produceRecords(rifFileEvent);
loader.process(rifFileRecords, error -> {
}, result -> {
});
}
}
use of gov.cms.bfd.model.rif.samples.StaticRifResource in project beneficiary-fhir-data by CMSgov.
the class OutpatientClaimTransformerTest method transformSyntheticRecord.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.OutpatientClaimTransformer#transform(Object)} works as
* expected when run against the {@link StaticRifResource#SYNTHETIC_OUTPATIENT_1999_1999} {@link
* OutpatientClaim}.
*
* <p>Note: This test is normally disabled like other synthetic data tests
*
* @throws FHIRException (indicates test failure)
*/
@Disabled
@Test
public void transformSyntheticRecord() throws FHIRException {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResource.SYNTHETIC_OUTPATIENT_1999_1999));
OutpatientClaim claim = parsedRecords.stream().filter(r -> r instanceof OutpatientClaim).map(r -> (OutpatientClaim) r).findFirst().get();
ExplanationOfBenefit eob = OutpatientClaimTransformer.transform(new MetricRegistry(), claim, Optional.empty());
assertMatches(claim, eob);
}
Aggregations