Search in sources :

Example 16 with HHAClaim

use of gov.cms.bfd.model.rif.HHAClaim in project beneficiary-fhir-data by CMSgov.

the class HHAClaimTransformer method transform.

/**
 * @param metricRegistry the {@link MetricRegistry} to use
 * @param claim the CCW {@link HHAClaim} to transform
 * @param includeTaxNumbers whether or not to include tax numbers in the result (see {@link
 *     ExplanationOfBenefitResourceProvider#HEADER_NAME_INCLUDE_TAX_NUMBERS}, defaults to <code>
 *     false</code>)
 * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link
 *     HHAClaim}
 */
@Trace
static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim, Optional<Boolean> includeTaxNumbers) {
    Timer.Context timer = metricRegistry.timer(MetricRegistry.name(HHAClaimTransformer.class.getSimpleName(), "transform")).time();
    if (!(claim instanceof HHAClaim))
        throw new BadCodeMonkeyException();
    ExplanationOfBenefit eob = transformClaim((HHAClaim) claim);
    timer.stop();
    return eob;
}
Also used : Timer(com.codahale.metrics.Timer) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Trace(com.newrelic.api.agent.Trace)

Example 17 with HHAClaim

use of gov.cms.bfd.model.rif.HHAClaim in project beneficiary-fhir-data by CMSgov.

the class HHAClaimTransformerV2 method transform.

/**
 * @param metricRegistry the {@link MetricRegistry} to use
 * @param claim the CCW {@link HHAClaim} to transform
 * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link
 *     HHAClaim}
 */
@Trace
static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim, Optional<Boolean> includeTaxNumbers) {
    Timer.Context timer = metricRegistry.timer(MetricRegistry.name(HHAClaimTransformerV2.class.getSimpleName(), "transform")).time();
    if (!(claim instanceof HHAClaim)) {
        throw new BadCodeMonkeyException();
    }
    ExplanationOfBenefit eob = transformClaim((HHAClaim) claim);
    timer.stop();
    return eob;
}
Also used : Timer(com.codahale.metrics.Timer) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) Trace(com.newrelic.api.agent.Trace)

Example 18 with HHAClaim

use of gov.cms.bfd.model.rif.HHAClaim in project beneficiary-fhir-data by CMSgov.

the class EndpointJsonResponseComparatorV2IT 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(TransformerUtilsV2.buildEobId(ClaimTypeV2.HHA, hhaClaim.getClaimId())).execute();
    return jsonInterceptor.getResponse();
}
Also used : Arrays(java.util.Arrays) R4PatientResourceProvider(gov.cms.bfd.server.war.r4.providers.R4PatientResourceProvider) InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) Disabled(org.junit.jupiter.api.Disabled) PartDEvent(gov.cms.bfd.model.rif.PartDEvent) SNFClaim(gov.cms.bfd.model.rif.SNFClaim) TransformerUtilsV2(gov.cms.bfd.server.war.r4.providers.TransformerUtilsV2) Matcher(java.util.regex.Matcher) CapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement) BeforeAll(org.junit.jupiter.api.BeforeAll) JsonNode(com.fasterxml.jackson.databind.JsonNode) IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) Path(java.nio.file.Path) Coverage(org.hl7.fhir.r4.model.Coverage) Patient(org.hl7.fhir.r4.model.Patient) MethodSource(org.junit.jupiter.params.provider.MethodSource) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) ImmutableSet(com.google.common.collect.ImmutableSet) MedicareSegment(gov.cms.bfd.server.war.commons.MedicareSegment) Set(java.util.Set) Arguments(org.junit.jupiter.params.provider.Arguments) Collectors(java.util.stream.Collectors) ExplanationOfBenefitResourceProvider(gov.cms.bfd.server.war.stu3.providers.ExplanationOfBenefitResourceProvider) StandardCharsets(java.nio.charset.StandardCharsets) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) UncheckedIOException(java.io.UncheckedIOException) JsonArray(com.google.gson.JsonArray) Beneficiary(gov.cms.bfd.model.rif.Beneficiary) List(java.util.List) TransformerConstants(gov.cms.bfd.server.war.commons.TransformerConstants) Stream(java.util.stream.Stream) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) ClaimTypeV2(gov.cms.bfd.server.war.r4.providers.ClaimTypeV2) ExtraParamsInterceptor(gov.cms.bfd.server.war.stu3.providers.ExtraParamsInterceptor) CoverageResourceProvider(gov.cms.bfd.server.war.stu3.providers.CoverageResourceProvider) RequestHeaders(gov.cms.bfd.server.war.commons.RequestHeaders) Supplier(java.util.function.Supplier) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayList(java.util.ArrayList) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) PipelineTestUtils(gov.cms.bfd.pipeline.sharedutils.PipelineTestUtils) Lists(com.google.common.collect.Lists) OutputStreamWriter(java.io.OutputStreamWriter) DMEClaim(gov.cms.bfd.model.rif.DMEClaim) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) StaticRifResourceGroup(gov.cms.bfd.model.rif.samples.StaticRifResourceGroup) ServerTestUtils(gov.cms.bfd.server.war.ServerTestUtils) Arguments.arguments(org.junit.jupiter.params.provider.Arguments.arguments) CommonHeaders(gov.cms.bfd.server.war.commons.CommonHeaders) Iterator(java.util.Iterator) Files(java.nio.file.Files) HospiceClaim(gov.cms.bfd.model.rif.HospiceClaim) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) FileOutputStream(java.io.FileOutputStream) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) EncodingEnum(ca.uhn.fhir.rest.api.EncodingEnum) File(java.io.File) Consumer(java.util.function.Consumer) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Paths(java.nio.file.Paths) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) Bundle(org.hl7.fhir.r4.model.Bundle) Comparator(java.util.Comparator) Collections(java.util.Collections) IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) HHAClaim(gov.cms.bfd.model.rif.HHAClaim)

Aggregations

HHAClaim (gov.cms.bfd.model.rif.HHAClaim)18 Test (org.junit.jupiter.api.Test)13 CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)12 DMEClaim (gov.cms.bfd.model.rif.DMEClaim)12 HospiceClaim (gov.cms.bfd.model.rif.HospiceClaim)12 InpatientClaim (gov.cms.bfd.model.rif.InpatientClaim)12 OutpatientClaim (gov.cms.bfd.model.rif.OutpatientClaim)12 PartDEvent (gov.cms.bfd.model.rif.PartDEvent)12 SNFClaim (gov.cms.bfd.model.rif.SNFClaim)12 StaticRifResourceGroup (gov.cms.bfd.model.rif.samples.StaticRifResourceGroup)12 ServerTestUtils (gov.cms.bfd.server.war.ServerTestUtils)12 Arrays (java.util.Arrays)12 List (java.util.List)12 Optional (java.util.Optional)12 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)12 TransformerConstants (gov.cms.bfd.server.war.commons.TransformerConstants)11 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)10 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)10 PipelineTestUtils (gov.cms.bfd.pipeline.sharedutils.PipelineTestUtils)10 CommonHeaders (gov.cms.bfd.server.war.commons.CommonHeaders)10