use of gov.cms.bfd.model.rif.PartDEvent in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadPde.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* PDE claims
*/
public static String eobReadPde() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
PartDEvent pdeClaim = loadedRecords.stream().filter(r -> r instanceof PartDEvent).map(r -> (PartDEvent) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.PDE, pdeClaim.getEventId())).execute();
return jsonInterceptor.getResponse();
}
use of gov.cms.bfd.model.rif.PartDEvent in project beneficiary-fhir-data by CMSgov.
the class PartDEventTransformerTest method getPartDEventClaim.
private PartDEvent getPartDEventClaim() {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
PartDEvent claim = parsedRecords.stream().filter(r -> r instanceof PartDEvent).map(r -> (PartDEvent) r).findFirst().get();
return claim;
}
use of gov.cms.bfd.model.rif.PartDEvent in project beneficiary-fhir-data by CMSgov.
the class PartDEventTransformerTest method transformSampleARecord.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.PartDEventTransformer#transform(Object)} works as
* expected when run against the {@link StaticRifResource#SAMPLE_A_PDE} {@link PartDEvent}.
*
* @throws FHIRException (indicates test failure)
*/
@Test
public void transformSampleARecord() throws FHIRException {
PartDEvent claim = getPartDEventClaim();
ExplanationOfBenefit eob = PartDEventTransformer.transform(new MetricRegistry(), claim, Optional.empty());
assertMatches(claim, eob);
}
use of gov.cms.bfd.model.rif.PartDEvent in project beneficiary-fhir-data by CMSgov.
the class PartDEventTransformerTest method checkOrgAndFacility.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.PartDEventTransformer#transform(com.codahale.metrics.MetricRegistry,
* Object)} works as expected when run against the {@link String serviceProviderIdQualiferCode}
* and {@link String serviceProviderCode}.
*/
private void checkOrgAndFacility(String serviceProviderIdQualiferCode, String serviceProviderCode) {
PartDEvent claim = getPartDEventClaim();
claim.setServiceProviderIdQualiferCode(serviceProviderIdQualiferCode);
ExplanationOfBenefit eob = PartDEventTransformer.transform(new MetricRegistry(), claim, Optional.empty());
TransformerTestUtils.assertReferenceEquals(serviceProviderCode, claim.getServiceProviderId(), eob.getOrganization());
TransformerTestUtils.assertReferenceEquals(serviceProviderCode, claim.getServiceProviderId(), eob.getFacility());
}
use of gov.cms.bfd.model.rif.PartDEvent in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorIT method eobReadPde.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* PDE claims
*/
public static String eobReadPde() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
PartDEvent pdeClaim = loadedRecords.stream().filter(r -> r instanceof PartDEvent).map(r -> (PartDEvent) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtils.buildEobId(ClaimType.PDE, pdeClaim.getEventId())).execute();
return jsonInterceptor.getResponse();
}
Aggregations