use of org.hl7.fhir.r5.utils.validation.constants in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method readEobForExistingHospiceClaim.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.r4.providers.ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.r4.model.IdType)}
* works as expected for a {@link HospiceClaim}-derived {@link ExplanationOfBenefit} that does
* exist in the DB.
*
* @throws FHIRException (indicates test failure)
*/
@Test
public void readEobForExistingHospiceClaim() throws FHIRException {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = ServerTestUtils.get().createFhirClientV2();
HospiceClaim claim = loadedRecords.stream().filter(r -> r instanceof HospiceClaim).map(r -> (HospiceClaim) r).findFirst().get();
ExplanationOfBenefit eob = fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.HOSPICE, claim.getClaimId())).execute();
assertNotNull(eob);
// Compare result to transformed EOB
compareEob(ClaimTypeV2.HOSPICE, eob, loadedRecords);
}
use of org.hl7.fhir.r5.utils.validation.constants in project beneficiary-fhir-data by CMSgov.
the class R4PatientResourceProviderIT method readExistingPatient.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.r4.providers.R4PatientResourceProvider#read(org.hl7.fhir.r4.model.IdType)}
* works as expected for a {@link Patient} that does exist in the DB.
*/
@Test
public void readExistingPatient() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = ServerTestUtils.get().createFhirClientV2();
Beneficiary beneficiary = loadedRecords.stream().filter(r -> r instanceof Beneficiary).map(r -> (Beneficiary) r).findFirst().get();
Patient patient = fhirClient.read().resource(Patient.class).withId(beneficiary.getBeneficiaryId()).execute();
comparePatient(beneficiary, patient);
}
use of org.hl7.fhir.r5.utils.validation.constants in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorIT method eobReadHha.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* HHA claims
*/
public static String eobReadHha() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
HHAClaim hhaClaim = loadedRecords.stream().filter(r -> r instanceof HHAClaim).map(r -> (HHAClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtils.buildEobId(ClaimType.HHA, hhaClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
use of org.hl7.fhir.r5.utils.validation.constants in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorIT method coverageRead.
/**
* @return the results of the {@link
* CoverageResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation
*/
public static String coverageRead() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
Beneficiary beneficiary = loadedRecords.stream().filter(r -> r instanceof Beneficiary).map(r -> (Beneficiary) r).findFirst().get();
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
fhirClient.read().resource(Coverage.class).withId(TransformerUtils.buildCoverageId(MedicareSegment.PART_A, beneficiary)).execute();
return jsonInterceptor.getResponse();
}
use of org.hl7.fhir.r5.utils.validation.constants in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadDmeWithTaxNumbers.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* DME claims, with the {@link
* ExplanationOfBenefitResourceProvider#HEADER_NAME_INCLUDE_TAX_NUMBERS} set to <code>true
* </code>
*/
public static String eobReadDmeWithTaxNumbers() {
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);
DMEClaim dmeClaim = loadedRecords.stream().filter(r -> r instanceof DMEClaim).map(r -> (DMEClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.DME, dmeClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
Aggregations