use of gov.cms.bfd.model.rif.InpatientClaim in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2 method transform.
/**
* @param metricRegistry the {@link MetricRegistry} to use
* @param claim the CCW {@link InpatientClaim} to transform
* @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link
* InpatientClaim}
*/
@Trace
static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim, Optional<Boolean> includeTaxNumbers) {
Timer.Context timer = metricRegistry.timer(MetricRegistry.name(InpatientClaimTransformerV2.class.getSimpleName(), "transform")).time();
if (!(claim instanceof InpatientClaim)) {
throw new BadCodeMonkeyException();
}
ExplanationOfBenefit eob = transformClaim((InpatientClaim) claim);
timer.stop();
return eob;
}
use of gov.cms.bfd.model.rif.InpatientClaim in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method adjustInpatientRecordForSamhsaDiagnosis.
/**
* Adjusts the first inpatient record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustInpatientRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
InpatientClaim inpatientRifRecord = loadedRecords.stream().filter(r -> r instanceof InpatientClaim).map(r -> (InpatientClaim) r).findFirst().get();
entityManager.getTransaction().begin();
inpatientRifRecord = entityManager.find(InpatientClaim.class, inpatientRifRecord.getClaimId());
inpatientRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
inpatientRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(inpatientRifRecord);
entityManager.getTransaction().commit();
}
use of gov.cms.bfd.model.rif.InpatientClaim in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadInpatient.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* Inpatient claims
*/
public static String eobReadInpatient() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
InpatientClaim inpClaim = loadedRecords.stream().filter(r -> r instanceof InpatientClaim).map(r -> (InpatientClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.INPATIENT, inpClaim.getClaimId())).execute();
return sortDiagnosisTypes(jsonInterceptor.getResponse(), "/diagnosis/7/type");
}
use of gov.cms.bfd.model.rif.InpatientClaim in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorIT method eobReadInpatient.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* Inpatient claims
*/
public static String eobReadInpatient() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
InpatientClaim inpClaim = loadedRecords.stream().filter(r -> r instanceof InpatientClaim).map(r -> (InpatientClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtils.buildEobId(ClaimType.INPATIENT, inpClaim.getClaimId())).execute();
return sortDiagnosisTypes(jsonInterceptor.getResponse(), "/diagnosis/7/type");
}
Aggregations