Search in sources :

Example 21 with BenefitComponent

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

the class TransformerTestUtils method assertBenefitBalanceEquals.

/**
 * FIXME add allowed to method name
 *
 * @param expectedFinancialTypeSystem the expected {@link Coding#getSystem()} of the {@link
 *     BenefitComponent#getCode)} to find and verify
 * @param expectedFinancialTypeCode the expected {@link Coding#getCode()} of the {@link
 *     BenefitComponent#getCode)} to find and verify
 * @param expectedAmount the expected {@link BenefitComponent#getBenefitMoney}
 * @param actuals the actual {@link BenefitComponent}s to verify
 */
static void assertBenefitBalanceEquals(String expectedFinancialTypeSystem, String expectedFinancialTypeCode, BigDecimal expectedAmount, List<BenefitComponent> actuals) {
    Optional<BenefitComponent> benefitComponent = actuals.stream().filter(a -> isCodeInConcept(a.getType(), expectedFinancialTypeSystem, expectedFinancialTypeCode)).findFirst();
    assertTrue(benefitComponent.isPresent());
    try {
        assertEquivalent(expectedAmount, benefitComponent.get().getAllowedMoney().getValue());
    } catch (FHIRException e) {
        throw new BadCodeMonkeyException(e);
    }
}
Also used : IBaseHasExtensions(org.hl7.fhir.instance.model.api.IBaseHasExtensions) Arrays(java.util.Arrays) CarrierClaimColumn(gov.cms.bfd.model.rif.CarrierClaimColumn) CcwCodebookInterface(gov.cms.bfd.model.codebook.model.CcwCodebookInterface) Identifier(org.hl7.fhir.dstu3.model.Identifier) Coding(org.hl7.fhir.dstu3.model.Coding) InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept) Extension(org.hl7.fhir.dstu3.model.Extension) IBaseExtension(org.hl7.fhir.instance.model.api.IBaseExtension) ClaimCareteamrole(org.hl7.fhir.dstu3.model.codesystems.ClaimCareteamrole) SNFClaimColumn(gov.cms.bfd.model.rif.SNFClaimColumn) BigDecimal(java.math.BigDecimal) FhirContext(ca.uhn.fhir.context.FhirContext) SNFClaim(gov.cms.bfd.model.rif.SNFClaim) SNFClaimLine(gov.cms.bfd.model.rif.SNFClaimLine) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) HHAClaimColumn(gov.cms.bfd.model.rif.HHAClaimColumn) CarrierClaimLine(gov.cms.bfd.model.rif.CarrierClaimLine) Duration(java.time.Duration) BenefitBalanceComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitBalanceComponent) TemporalPrecisionEnum(ca.uhn.fhir.model.api.TemporalPrecisionEnum) Method(java.lang.reflect.Method) Diagnosis(gov.cms.bfd.server.war.commons.Diagnosis) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) MedicareSegment(gov.cms.bfd.server.war.commons.MedicareSegment) Reference(org.hl7.fhir.dstu3.model.Reference) DiagnosisComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.DiagnosisComponent) ItemComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent) InpatientClaimColumn(gov.cms.bfd.model.rif.InpatientClaimColumn) Instant(java.time.Instant) InvocationTargetException(java.lang.reflect.InvocationTargetException) Quantity(org.hl7.fhir.dstu3.model.Quantity) List(java.util.List) CareTeamComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.CareTeamComponent) TransformerConstants(gov.cms.bfd.server.war.commons.TransformerConstants) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) LocalDate(java.time.LocalDate) Optional(java.util.Optional) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) OutpatientClaimColumn(gov.cms.bfd.model.rif.OutpatientClaimColumn) HospiceClaimLine(gov.cms.bfd.model.rif.HospiceClaimLine) HHAClaimLine(gov.cms.bfd.model.rif.HHAClaimLine) HospiceClaimColumn(gov.cms.bfd.model.rif.HospiceClaimColumn) Money(org.hl7.fhir.dstu3.model.Money) InpatientClaimLine(gov.cms.bfd.model.rif.InpatientClaimLine) ReferralRequest(org.hl7.fhir.dstu3.model.ReferralRequest) OutpatientClaimLine(gov.cms.bfd.model.rif.OutpatientClaimLine) BenefitComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent) IAnyResource(org.hl7.fhir.instance.model.api.IAnyResource) CCWUtils(gov.cms.bfd.server.war.commons.CCWUtils) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) CcwCodebookVariable(gov.cms.bfd.model.codebook.data.CcwCodebookVariable) Period(org.hl7.fhir.dstu3.model.Period) DMEClaim(gov.cms.bfd.model.rif.DMEClaim) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) DMEClaimLine(gov.cms.bfd.model.rif.DMEClaimLine) AdjudicationComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.AdjudicationComponent) BenefitCategory(org.hl7.fhir.dstu3.model.codesystems.BenefitCategory) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) DateTimeType(org.hl7.fhir.dstu3.model.DateTimeType) Resource(org.hl7.fhir.dstu3.model.Resource) HospiceClaim(gov.cms.bfd.model.rif.HospiceClaim) IOException(java.io.IOException) Observation(org.hl7.fhir.dstu3.model.Observation) BaseDateTimeType(org.hl7.fhir.dstu3.model.BaseDateTimeType) SupportingInformationComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.SupportingInformationComponent) DMEClaimColumn(gov.cms.bfd.model.rif.DMEClaimColumn) FHIRException(org.hl7.fhir.exceptions.FHIRException) IdentifierType(gov.cms.bfd.server.war.commons.IdentifierType) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) FHIRException(org.hl7.fhir.exceptions.FHIRException) BenefitComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent)

Example 22 with BenefitComponent

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

the class SNFClaimTransformerV2Test method shouldHavePrpayamtFinancial.

@Test
public void shouldHavePrpayamtFinancial() {
    BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/prpayamt", eob.getBenefitBalanceFirstRep().getFinancial());
    BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/prpayamt", "NCH Primary Payer (if not Medicare) Claim Paid Amount")))).setUsed(new Money().setValueElement(new DecimalType("11.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(benefit));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) DecimalType(org.hl7.fhir.r4.model.DecimalType) BenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Example 23 with BenefitComponent

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

the class SNFClaimTransformerV2Test method shouldHaveClmPpsCptlFspAmtFinancial.

@Test
public void shouldHaveClmPpsCptlFspAmtFinancial() {
    BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_fsp_amt", eob.getBenefitBalanceFirstRep().getFinancial());
    BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_fsp_amt", "Claim PPS Capital Federal Specific Portion (FSP) Amount")))).setUsed(new Money().setValueElement(new DecimalType("9.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(benefit));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) DecimalType(org.hl7.fhir.r4.model.DecimalType) BenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Example 24 with BenefitComponent

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

the class SNFClaimTransformerV2Test method shouldHaveBeneTotCoinsrncDaysCntFinancial.

@Test
public void shouldHaveBeneTotCoinsrncDaysCntFinancial() {
    BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/bene_tot_coinsrnc_days_cnt", eob.getBenefitBalanceFirstRep().getFinancial());
    BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/bene_tot_coinsrnc_days_cnt", "Beneficiary Total Coinsurance Days Count")))).setUsed(new UnsignedIntType().setValue(17));
    assertTrue(compare.equalsDeep(benefit));
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) UnsignedIntType(org.hl7.fhir.r4.model.UnsignedIntType) BenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Example 25 with BenefitComponent

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

the class SNFClaimTransformerV2Test method shouldHaveNchIpTotDdctnAmtFinancial.

@Test
public void shouldHaveNchIpTotDdctnAmtFinancial() {
    BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/nch_ip_tot_ddctn_amt", eob.getBenefitBalanceFirstRep().getFinancial());
    BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/nch_ip_tot_ddctn_amt", "NCH Inpatient (or other Part A) Total Deductible/Coinsurance Amount")))).setUsed(new Money().setValueElement(new DecimalType("14.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(benefit));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) DecimalType(org.hl7.fhir.r4.model.DecimalType) BenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Aggregations

BenefitComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent)59 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)58 Coding (org.hl7.fhir.r4.model.Coding)57 Test (org.junit.jupiter.api.Test)56 Money (org.hl7.fhir.r4.model.Money)49 DecimalType (org.hl7.fhir.r4.model.DecimalType)31 BenefitComponent (org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent)11 UnsignedIntType (org.hl7.fhir.r4.model.UnsignedIntType)10 TemporalPrecisionEnum (ca.uhn.fhir.model.api.TemporalPrecisionEnum)7 CcwCodebookVariable (gov.cms.bfd.model.codebook.data.CcwCodebookVariable)7 CcwCodebookInterface (gov.cms.bfd.model.codebook.model.CcwCodebookInterface)7 CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)7 HHAClaimLine (gov.cms.bfd.model.rif.HHAClaimLine)7 CCWUtils (gov.cms.bfd.server.war.commons.CCWUtils)7 Diagnosis (gov.cms.bfd.server.war.commons.Diagnosis)7 MedicareSegment (gov.cms.bfd.server.war.commons.MedicareSegment)7 CarrierClaimColumn (gov.cms.bfd.model.rif.CarrierClaimColumn)6 CarrierClaimLine (gov.cms.bfd.model.rif.CarrierClaimLine)6 DMEClaim (gov.cms.bfd.model.rif.DMEClaim)6 DMEClaimColumn (gov.cms.bfd.model.rif.DMEClaimColumn)6