Search in sources :

Example 16 with ExplanationOfBenefit

use of org.hl7.fhir.r4.model.ExplanationOfBenefit in project beneficiary-fhir-data by CMSgov.

the class DMEClaimTransformer method transform.

/**
 * @param metricRegistry the {@link MetricRegistry} to use
 * @param claim the CCW {@link DMEClaim} 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
 *     DMEClaim}
 */
@Trace
static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim, Optional<Boolean> includeTaxNumbers) {
    Timer.Context timer = metricRegistry.timer(MetricRegistry.name(DMEClaimTransformer.class.getSimpleName(), "transform")).time();
    if (!(claim instanceof DMEClaim))
        throw new BadCodeMonkeyException();
    ExplanationOfBenefit eob = transformClaim((DMEClaim) claim, includeTaxNumbers);
    timer.stop();
    return eob;
}
Also used : DMEClaim(gov.cms.bfd.model.rif.DMEClaim) Timer(com.codahale.metrics.Timer) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Trace(com.newrelic.api.agent.Trace)

Example 17 with ExplanationOfBenefit

use of org.hl7.fhir.r4.model.ExplanationOfBenefit in project beneficiary-fhir-data by CMSgov.

the class CarrierClaimTransformer method transform.

/**
 * @param metricRegistry the {@link MetricRegistry} to use
 * @param claim the CCW {@link CarrierClaim} 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
 *     CarrierClaim}
 */
@Trace
static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim, Optional<Boolean> includeTaxNumbers) {
    Timer.Context timer = metricRegistry.timer(MetricRegistry.name(CarrierClaimTransformer.class.getSimpleName(), "transform")).time();
    if (!(claim instanceof CarrierClaim))
        throw new BadCodeMonkeyException();
    ExplanationOfBenefit eob = transformClaim((CarrierClaim) claim, includeTaxNumbers);
    timer.stop();
    return eob;
}
Also used : Timer(com.codahale.metrics.Timer) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Trace(com.newrelic.api.agent.Trace)

Example 18 with ExplanationOfBenefit

use of org.hl7.fhir.r4.model.ExplanationOfBenefit in project beneficiary-fhir-data by CMSgov.

the class DMEClaimTransformerV2Test method before.

@BeforeEach
public void before() {
    claim = generateClaim();
    ExplanationOfBenefit genEob = DMEClaimTransformerV2.transform(new MetricRegistry(), claim, Optional.empty());
    IParser parser = fhirContext.newJsonParser();
    String json = parser.encodeResourceToString(genEob);
    eob = parser.parseResource(ExplanationOfBenefit.class, json);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) IParser(ca.uhn.fhir.parser.IParser) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 19 with ExplanationOfBenefit

use of org.hl7.fhir.r4.model.ExplanationOfBenefit in project beneficiary-fhir-data by CMSgov.

the class DMEClaimTransformerV2Test method serializeSampleARecord.

/**
 * Serializes the EOB and prints to the command line
 *
 * @throws FHIRException
 */
@Disabled
@Test
public void serializeSampleARecord() throws FHIRException {
    ExplanationOfBenefit eob = DMEClaimTransformerV2.transform(new MetricRegistry(), generateClaim(), Optional.of(false));
    System.out.println(fhirContext.newJsonParser().encodeResourceToString(eob));
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 20 with ExplanationOfBenefit

use of org.hl7.fhir.r4.model.ExplanationOfBenefit in project beneficiary-fhir-data by CMSgov.

the class CarrierClaimTransformerV2Test method serializeSampleARecord.

/**
 * Serializes the EOB and prints to the command line
 *
 * @throws FHIRException
 */
@Disabled
@Test
public void serializeSampleARecord() throws FHIRException {
    ExplanationOfBenefit eob = CarrierClaimTransformerV2.transform(new MetricRegistry(), generateClaim(), Optional.of(false));
    System.out.println(fhirContext.newJsonParser().encodeResourceToString(eob));
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

ExplanationOfBenefit (org.hl7.fhir.dstu3.model.ExplanationOfBenefit)69 ExplanationOfBenefit (org.hl7.fhir.r4.model.ExplanationOfBenefit)63 Test (org.junit.jupiter.api.Test)53 Optional (java.util.Optional)48 Arrays (java.util.Arrays)45 List (java.util.List)44 ArrayList (java.util.ArrayList)41 CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)39 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)38 MetricRegistry (com.codahale.metrics.MetricRegistry)37 TransformerConstants (gov.cms.bfd.server.war.commons.TransformerConstants)37 BadCodeMonkeyException (gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException)36 Instant (java.time.Instant)36 Date (java.util.Date)35 Collectors (java.util.stream.Collectors)35 OutpatientClaim (gov.cms.bfd.model.rif.OutpatientClaim)34 ItemComponent (org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent)34 InpatientClaim (gov.cms.bfd.model.rif.InpatientClaim)32 IdDt (ca.uhn.fhir.model.primitive.IdDt)31 Constants (ca.uhn.fhir.rest.api.Constants)31