use of gov.cms.bfd.model.rif.DMEClaim in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method adjustDmeRecordForSamhsaDiagnosis.
/**
* Adjusts the first DME record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustDmeRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
DMEClaim dmeRifRecord = loadedRecords.stream().filter(r -> r instanceof DMEClaim).map(r -> (DMEClaim) r).findFirst().get();
entityManager.getTransaction().begin();
dmeRifRecord = entityManager.find(DMEClaim.class, dmeRifRecord.getClaimId());
dmeRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
dmeRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(dmeRifRecord);
entityManager.getTransaction().commit();
}
use of gov.cms.bfd.model.rif.DMEClaim in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorIT method eobReadDme.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* DME claims
*/
public static String eobReadDme() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
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(TransformerUtils.buildEobId(ClaimType.DME, dmeClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
Aggregations