use of gov.cms.bfd.model.rif.CarrierClaim in project beneficiary-fhir-data by CMSgov.
the class ExplanationOfBenefitResourceProviderIT method adjustCarrierClaimForSamhsaDiagnosis.
/**
* Adjusts the carrier claim to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustCarrierClaimForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
CarrierClaim carrierRifRecord = loadedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
entityManager.getTransaction().begin();
carrierRifRecord = entityManager.find(CarrierClaim.class, carrierRifRecord.getClaimId());
carrierRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
carrierRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(carrierRifRecord);
entityManager.getTransaction().commit();
}
use of gov.cms.bfd.model.rif.CarrierClaim in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadCarrier.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* Carrier claims
*/
public static String eobReadCarrier() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
CarrierClaim carrClaim = loadedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.CARRIER, carrClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
use of gov.cms.bfd.model.rif.CarrierClaim in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadCarrierWithTaxNumbers.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* Carrier claims, with the {@link
* ExplanationOfBenefitResourceProvider#HEADER_NAME_INCLUDE_TAX_NUMBERS} set to <code>true
* </code>
*/
public static String eobReadCarrierWithTaxNumbers() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
RequestHeaders requestHeader = RequestHeaders.getHeaderWrapper(CommonHeaders.HEADER_NAME_INCLUDE_TAX_NUMBERS, "true");
ExtraParamsInterceptor extraParamsInterceptor = new ExtraParamsInterceptor();
extraParamsInterceptor.setHeaders(requestHeader);
fhirClient.registerInterceptor(extraParamsInterceptor);
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
CarrierClaim carrClaim = loadedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.CARRIER, carrClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
use of gov.cms.bfd.model.rif.CarrierClaim 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.CarrierClaim in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformerV2Test method transformSampleARecord.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.r4.providers.CarrierClaimTransformerV2#transform(MetricRegistry, Object,
* Optional<Boolean>)} works as expected when run against the {@link
* StaticRifResource#SAMPLE_A_INPATIENT} {@link InpatientClaim}.
*
* @throws FHIRException (indicates test failure)
*/
@Test
public void transformSampleARecord() throws FHIRException {
CarrierClaim claim = generateClaim();
assertMatches(claim, CarrierClaimTransformerV2.transform(new MetricRegistry(), claim, Optional.of(false)));
}
Aggregations