Search in sources :

Example 1 with Money

use of org.hl7.fhir.r4b.model.Money in project beneficiary-fhir-data by CMSgov.

the class TransformerUtils method createMoney.

/**
 * @param amountValue the value to use for {@link Money#getValue()}
 * @return a new {@link Money} instance, with the specified {@link Money#getValue()}
 */
static Money createMoney(Optional<? extends Number> amountValue) {
    if (!amountValue.isPresent())
        throw new IllegalArgumentException();
    Money money = new Money();
    money.setSystem(TransformerConstants.CODING_MONEY);
    money.setCode(TransformerConstants.CODED_MONEY_USD);
    if (amountValue.get() instanceof BigDecimal)
        money.setValue((BigDecimal) amountValue.get());
    else
        throw new BadCodeMonkeyException();
    return money;
}
Also used : Money(org.hl7.fhir.dstu3.model.Money) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) BigDecimal(java.math.BigDecimal)

Example 2 with Money

use of org.hl7.fhir.r4b.model.Money in project beneficiary-fhir-data by CMSgov.

the class FissClaimTransformerV2 method getTotal.

private static Money getTotal(PreAdjFissClaim claimGroup) {
    Money total;
    if (claimGroup.getTotalChargeAmount() != null) {
        total = new Money();
        total.setValue(claimGroup.getTotalChargeAmount());
        total.setCurrency("USD");
    } else {
        total = null;
    }
    return total;
}
Also used : Money(org.hl7.fhir.r4.model.Money)

Example 3 with Money

use of org.hl7.fhir.r4b.model.Money in project beneficiary-fhir-data by CMSgov.

the class McsClaimTransformerV2 method getTotal.

private static Money getTotal(PreAdjMcsClaim claimGroup) {
    Money total;
    if (claimGroup.getIdrTotBilledAmt() != null) {
        total = new Money();
        total.setValue(claimGroup.getIdrTotBilledAmt());
        total.setCurrency("USD");
    } else {
        total = null;
    }
    return total;
}
Also used : Money(org.hl7.fhir.r4.model.Money)

Example 4 with Money

use of org.hl7.fhir.r4b.model.Money in project beneficiary-fhir-data by CMSgov.

the class OutpatientClaimTransformerV2Test method shouldHaveLineItemAdjudicationRevCntrPrvdrPmtAmt.

@Test
public void shouldHaveLineItemAdjudicationRevCntrPrvdrPmtAmt() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("https://bluebutton.cms.gov/resources/variables/rev_cntr_prvdr_pmt_amt", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", "paidtoprovider", "Paid to provider"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/rev_cntr_prvdr_pmt_amt", "Revenue Center (Medicare) Provider Payment Amount")))).setAmount(new Money().setValue(200).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(adjudication));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) AdjudicationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Example 5 with Money

use of org.hl7.fhir.r4b.model.Money in project beneficiary-fhir-data by CMSgov.

the class OutpatientClaimTransformerV2Test method shouldHaveLineItemAdjudicationRevCntrCoinsrncWgeAdjstdC.

@Test
public void shouldHaveLineItemAdjudicationRevCntrCoinsrncWgeAdjstdC() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("https://bluebutton.cms.gov/resources/variables/rev_cntr_coinsrnc_wge_adjstd_c", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", "coinsurance", "Co-insurance"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/rev_cntr_coinsrnc_wge_adjstd_c", "Revenue Center Coinsurance/Wage Adjusted Coinsurance Amount")))).setAmount(new Money().setValue(15.23).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(adjudication));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) AdjudicationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Aggregations

Money (org.hl7.fhir.r4.model.Money)129 Test (org.junit.jupiter.api.Test)122 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)117 Coding (org.hl7.fhir.r4.model.Coding)115 AdjudicationComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent)61 BenefitComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent)48 DecimalType (org.hl7.fhir.r4.model.DecimalType)42 BigDecimal (java.math.BigDecimal)18 TotalComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent)9 Money (org.hl7.fhir.dstu3.model.Money)6 Extension (org.hl7.fhir.r4.model.Extension)6 Claim (org.mitre.synthea.world.concepts.Claim)6 Encounter (org.mitre.synthea.world.concepts.HealthRecord.Encounter)6 NotImplementedException (org.apache.commons.lang3.NotImplementedException)5 PaymentComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent)5 EncounterType (org.mitre.synthea.world.concepts.HealthRecord.EncounterType)4 ItemComponent (org.hl7.fhir.dstu3.model.Claim.ItemComponent)3 Extension (org.hl7.fhir.dstu3.model.Extension)3 Reference (org.hl7.fhir.dstu3.model.Reference)3 SupplyDeliverySuppliedItemComponent (org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent)3