Search in sources :

Example 41 with SupportingInformationComponent

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

the class PartDEventTransformerV2Test method shouldHaveDAWProdSlctnCdCodeSupInfo.

@Test
public void shouldHaveDAWProdSlctnCdCodeSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", eob.getSupportingInfo());
    SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
    sic.getSequence(), // Category
    Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", "Dispense as Written (DAW) Product Selection Code")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", "0", "No Product Selection Indicated (may also have missing values)"));
    assertTrue(compare.equalsDeep(sic));
}
Also used : SupportingInformationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent) Coding(org.hl7.fhir.r4.model.Coding) Test(org.junit.jupiter.api.Test)

Example 42 with SupportingInformationComponent

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

the class PartDEventTransformerV2Test method shouldHaveAdjstmtDltnCdSupInfo.

@Test
public void shouldHaveAdjstmtDltnCdSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", eob.getSupportingInfo());
    SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
    sic.getSequence(), // Category
    Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", "Adjustment Deletion Code")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", "A", "Adjustment"));
    assertTrue(compare.equalsDeep(sic));
}
Also used : SupportingInformationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent) Coding(org.hl7.fhir.r4.model.Coding) Test(org.junit.jupiter.api.Test)

Example 43 with SupportingInformationComponent

use of org.hl7.fhir.r4.model.Claim.SupportingInformationComponent in project synthea by synthetichealth.

the class FhirR4 method encounterClaim.

/**
 * Create an entry for the given Claim, associated to an Encounter.
 *
 * @param person         The patient having the encounter.
 * @param personEntry    Entry for the person
 * @param bundle         The Bundle to add to
 * @param encounterEntry The current Encounter
 * @param claim          the Claim object
 * @return the added Entry
 */
private static BundleEntryComponent encounterClaim(Person person, BundleEntryComponent personEntry, Bundle bundle, BundleEntryComponent encounterEntry, Claim claim) {
    org.hl7.fhir.r4.model.Claim claimResource = new org.hl7.fhir.r4.model.Claim();
    org.hl7.fhir.r4.model.Encounter encounterResource = (org.hl7.fhir.r4.model.Encounter) encounterEntry.getResource();
    claimResource.setStatus(ClaimStatus.ACTIVE);
    CodeableConcept type = new CodeableConcept();
    type.getCodingFirstRep().setSystem("http://terminology.hl7.org/CodeSystem/claim-type").setCode("institutional");
    claimResource.setType(type);
    claimResource.setUse(org.hl7.fhir.r4.model.Claim.Use.CLAIM);
    InsuranceComponent insuranceComponent = new InsuranceComponent();
    insuranceComponent.setSequence(1);
    insuranceComponent.setFocal(true);
    insuranceComponent.setCoverage(new Reference().setDisplay(claim.payer.getName()));
    claimResource.addInsurance(insuranceComponent);
    // duration of encounter
    claimResource.setBillablePeriod(encounterResource.getPeriod());
    claimResource.setCreated(encounterResource.getPeriod().getEnd());
    claimResource.setPatient(new Reference().setReference(personEntry.getFullUrl()).setDisplay((String) person.attributes.get(Person.NAME)));
    claimResource.setProvider(encounterResource.getServiceProvider());
    if (USE_US_CORE_IG) {
        claimResource.setFacility(encounterResource.getLocationFirstRep().getLocation());
    }
    // set the required priority
    CodeableConcept priority = new CodeableConcept();
    priority.getCodingFirstRep().setSystem("http://terminology.hl7.org/CodeSystem/processpriority").setCode("normal");
    claimResource.setPriority(priority);
    // add item for encounter
    claimResource.addItem(new ItemComponent(new PositiveIntType(1), encounterResource.getTypeFirstRep()).addEncounter(new Reference(encounterEntry.getFullUrl())));
    int itemSequence = 2;
    int conditionSequence = 1;
    int procedureSequence = 1;
    int informationSequence = 1;
    for (Claim.ClaimEntry claimEntry : claim.items) {
        HealthRecord.Entry item = claimEntry.entry;
        if (Costs.hasCost(item)) {
            // update claimItems list
            Code primaryCode = item.codes.get(0);
            String system = ExportHelper.getSystemURI(primaryCode.system);
            ItemComponent claimItem = new ItemComponent(new PositiveIntType(itemSequence), mapCodeToCodeableConcept(primaryCode, system));
            // calculate the cost of the procedure
            Money moneyResource = new Money();
            moneyResource.setCurrency("USD");
            moneyResource.setValue(item.getCost());
            claimItem.setNet(moneyResource);
            claimResource.addItem(claimItem);
            if (item instanceof Procedure) {
                Type procedureReference = new Reference(item.fullUrl);
                ProcedureComponent claimProcedure = new ProcedureComponent(new PositiveIntType(procedureSequence), procedureReference);
                claimResource.addProcedure(claimProcedure);
                claimItem.addProcedureSequence(procedureSequence);
                procedureSequence++;
            } else {
                Reference informationReference = new Reference(item.fullUrl);
                SupportingInformationComponent informationComponent = new SupportingInformationComponent();
                informationComponent.setSequence(informationSequence);
                informationComponent.setValue(informationReference);
                CodeableConcept category = new CodeableConcept();
                category.getCodingFirstRep().setSystem("http://terminology.hl7.org/CodeSystem/claiminformationcategory").setCode("info");
                informationComponent.setCategory(category);
                claimResource.addSupportingInfo(informationComponent);
                claimItem.addInformationSequence(informationSequence);
                informationSequence++;
            }
        } else {
            // assume it's a Condition, we don't have a Condition class specifically
            // add diagnosisComponent to claim
            Reference diagnosisReference = new Reference(item.fullUrl);
            DiagnosisComponent diagnosisComponent = new DiagnosisComponent(new PositiveIntType(conditionSequence), diagnosisReference);
            claimResource.addDiagnosis(diagnosisComponent);
            // update claimItems with diagnosis
            ItemComponent diagnosisItem = new ItemComponent(new PositiveIntType(itemSequence), mapCodeToCodeableConcept(item.codes.get(0), SNOMED_URI));
            diagnosisItem.addDiagnosisSequence(conditionSequence);
            claimResource.addItem(diagnosisItem);
            conditionSequence++;
        }
        itemSequence++;
    }
    Money moneyResource = new Money();
    moneyResource.setCurrency("USD");
    moneyResource.setValue(claim.getTotalClaimCost());
    claimResource.setTotal(moneyResource);
    return newEntry(person, bundle, claimResource);
}
Also used : DiagnosisComponent(org.hl7.fhir.r4.model.Claim.DiagnosisComponent) ProcedureComponent(org.hl7.fhir.r4.model.Claim.ProcedureComponent) PositiveIntType(org.hl7.fhir.r4.model.PositiveIntType) Money(org.hl7.fhir.r4.model.Money) SupportingInformationComponent(org.hl7.fhir.r4.model.Claim.SupportingInformationComponent) SupplyDeliverySuppliedItemComponent(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent) ItemComponent(org.hl7.fhir.r4.model.Claim.ItemComponent) Encounter(org.mitre.synthea.world.concepts.HealthRecord.Encounter) Procedure(org.mitre.synthea.world.concepts.HealthRecord.Procedure) Reference(org.hl7.fhir.r4.model.Reference) DocumentReference(org.hl7.fhir.r4.model.DocumentReference) InsuranceComponent(org.hl7.fhir.r4.model.Claim.InsuranceComponent) Code(org.mitre.synthea.world.concepts.HealthRecord.Code) ContactPoint(org.hl7.fhir.r4.model.ContactPoint) HealthRecord(org.mitre.synthea.world.concepts.HealthRecord) IntegerType(org.hl7.fhir.r4.model.IntegerType) BooleanType(org.hl7.fhir.r4.model.BooleanType) BundleType(org.hl7.fhir.r4.model.Bundle.BundleType) EncounterType(org.mitre.synthea.world.concepts.HealthRecord.EncounterType) DeviceNameType(org.hl7.fhir.r4.model.Device.DeviceNameType) DateTimeType(org.hl7.fhir.r4.model.DateTimeType) AllergyIntoleranceType(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType) LocationPhysicalType(org.hl7.fhir.r4.model.codesystems.LocationPhysicalType) DecimalType(org.hl7.fhir.r4.model.DecimalType) CodeType(org.hl7.fhir.r4.model.CodeType) NodeType(org.hl7.fhir.utilities.xhtml.NodeType) StringType(org.hl7.fhir.r4.model.StringType) DateType(org.hl7.fhir.r4.model.DateType) PositiveIntType(org.hl7.fhir.r4.model.PositiveIntType) Type(org.hl7.fhir.r4.model.Type) DoseRateType(org.hl7.fhir.r4.model.codesystems.DoseRateType) Claim(org.mitre.synthea.world.concepts.Claim) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 44 with SupportingInformationComponent

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

the class SNFClaimTransformer method transformClaim.

/**
 * @param claimGroup the CCW {@link SNFClaim} to transform
 * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link
 *     SNFClaim}
 */
private static ExplanationOfBenefit transformClaim(SNFClaim claimGroup) {
    ExplanationOfBenefit eob = new ExplanationOfBenefit();
    // Common group level fields between all claim types
    TransformerUtils.mapEobCommonClaimHeaderData(eob, claimGroup.getClaimId(), claimGroup.getBeneficiaryId(), ClaimType.SNF, claimGroup.getClaimGroupId().toPlainString(), MedicareSegment.PART_A, Optional.of(claimGroup.getDateFrom()), Optional.of(claimGroup.getDateThrough()), Optional.of(claimGroup.getPaymentAmount()), claimGroup.getFinalAction());
    TransformerUtils.mapEobWeeklyProcessDate(eob, claimGroup.getWeeklyProcessDate());
    // map eob type codes into FHIR
    TransformerUtils.mapEobType(eob, ClaimType.SNF, Optional.of(claimGroup.getNearLineRecordIdCode()), Optional.of(claimGroup.getClaimTypeCode()));
    // set the provider number which is common among several claim types
    TransformerUtils.setProviderNumber(eob, claimGroup.getProviderNumber());
    // add EOB information to fields that are common between the Inpatient and SNF claim types
    TransformerUtils.addCommonEobInformationInpatientSNF(eob, claimGroup.getAdmissionTypeCd(), claimGroup.getSourceAdmissionCd(), claimGroup.getNoncoveredStayFromDate(), claimGroup.getNoncoveredStayThroughDate(), claimGroup.getCoveredCareThroughDate(), claimGroup.getMedicareBenefitsExhaustedDate(), claimGroup.getDiagnosisRelatedGroupCd());
    if (claimGroup.getPatientStatusCd().isPresent()) {
        TransformerUtils.addInformationWithCode(eob, CcwCodebookVariable.NCH_PTNT_STUS_IND_CD, CcwCodebookVariable.NCH_PTNT_STUS_IND_CD, claimGroup.getPatientStatusCd().get());
    }
    // Common group level fields between Inpatient, HHA, Hospice and SNF
    TransformerUtils.mapEobCommonGroupInpHHAHospiceSNF(eob, claimGroup.getClaimAdmissionDate(), claimGroup.getBeneficiaryDischargeDate(), Optional.of(claimGroup.getUtilizationDayCount()));
    /*
     * add field values to the benefit balances that are common between the
     * Inpatient and SNF claim types
     */
    TransformerUtils.addCommonGroupInpatientSNF(eob, claimGroup.getCoinsuranceDayCount(), claimGroup.getNonUtilizationDayCount(), claimGroup.getDeductibleAmount(), claimGroup.getPartACoinsuranceLiabilityAmount(), claimGroup.getBloodPintsFurnishedQty(), claimGroup.getNoncoveredCharge(), claimGroup.getTotalDeductionAmount(), claimGroup.getClaimPPSCapitalDisproportionateShareAmt(), claimGroup.getClaimPPSCapitalExceptionAmount(), claimGroup.getClaimPPSCapitalFSPAmount(), claimGroup.getClaimPPSCapitalIMEAmount(), claimGroup.getClaimPPSCapitalOutlierAmount(), claimGroup.getClaimPPSOldCapitalHoldHarmlessAmount());
    if (claimGroup.getQualifiedStayFromDate().isPresent() || claimGroup.getQualifiedStayThroughDate().isPresent()) {
        TransformerUtils.validatePeriodDates(claimGroup.getQualifiedStayFromDate(), claimGroup.getQualifiedStayThroughDate());
        SupportingInformationComponent nchQlfydStayInfo = TransformerUtils.addInformation(eob, CcwCodebookVariable.NCH_QLFYD_STAY_FROM_DT);
        Period nchQlfydStayPeriod = new Period();
        if (claimGroup.getQualifiedStayFromDate().isPresent())
            nchQlfydStayPeriod.setStart(TransformerUtils.convertToDate((claimGroup.getQualifiedStayFromDate().get())), TemporalPrecisionEnum.DAY);
        if (claimGroup.getQualifiedStayThroughDate().isPresent())
            nchQlfydStayPeriod.setEnd(TransformerUtils.convertToDate((claimGroup.getQualifiedStayThroughDate().get())), TemporalPrecisionEnum.DAY);
        nchQlfydStayInfo.setTiming(nchQlfydStayPeriod);
    }
    // Common group level fields between Inpatient, Outpatient and SNF
    TransformerUtils.mapEobCommonGroupInpOutSNF(eob, claimGroup.getBloodDeductibleLiabilityAmount(), claimGroup.getOperatingPhysicianNpi(), claimGroup.getOtherPhysicianNpi(), claimGroup.getClaimQueryCode(), claimGroup.getMcoPaidSw());
    // Common group level fields between Inpatient, Outpatient Hospice, HHA and SNF
    TransformerUtils.mapEobCommonGroupInpOutHHAHospiceSNF(eob, claimGroup.getOrganizationNpi(), claimGroup.getClaimFacilityTypeCode(), claimGroup.getClaimFrequencyCode(), claimGroup.getClaimNonPaymentReasonCode(), claimGroup.getPatientDischargeStatusCode(), claimGroup.getClaimServiceClassificationTypeCode(), claimGroup.getClaimPrimaryPayerCode(), claimGroup.getAttendingPhysicianNpi(), claimGroup.getTotalChargeAmount(), claimGroup.getPrimaryPayerPaidAmount(), claimGroup.getFiscalIntermediaryNumber(), claimGroup.getFiDocumentClaimControlNumber(), claimGroup.getFiOriginalClaimControlNumber());
    for (Diagnosis diagnosis : TransformerUtils.extractDiagnoses1Thru12(claimGroup.getDiagnosisAdmittingCode(), claimGroup.getDiagnosisAdmittingCodeVersion(), claimGroup.getDiagnosisPrincipalCode(), claimGroup.getDiagnosisPrincipalCodeVersion(), claimGroup.getDiagnosis1Code(), claimGroup.getDiagnosis1CodeVersion(), claimGroup.getDiagnosis2Code(), claimGroup.getDiagnosis2CodeVersion(), claimGroup.getDiagnosis3Code(), claimGroup.getDiagnosis3CodeVersion(), claimGroup.getDiagnosis4Code(), claimGroup.getDiagnosis4CodeVersion(), claimGroup.getDiagnosis5Code(), claimGroup.getDiagnosis5CodeVersion(), claimGroup.getDiagnosis6Code(), claimGroup.getDiagnosis6CodeVersion(), claimGroup.getDiagnosis7Code(), claimGroup.getDiagnosis7CodeVersion(), claimGroup.getDiagnosis8Code(), claimGroup.getDiagnosis8CodeVersion(), claimGroup.getDiagnosis9Code(), claimGroup.getDiagnosis9CodeVersion(), claimGroup.getDiagnosis10Code(), claimGroup.getDiagnosis10CodeVersion(), claimGroup.getDiagnosis11Code(), claimGroup.getDiagnosis11CodeVersion(), claimGroup.getDiagnosis12Code(), claimGroup.getDiagnosis12CodeVersion())) TransformerUtils.addDiagnosisCode(eob, diagnosis);
    for (Diagnosis diagnosis : TransformerUtils.extractDiagnoses13Thru25(claimGroup.getDiagnosis13Code(), claimGroup.getDiagnosis13CodeVersion(), claimGroup.getDiagnosis14Code(), claimGroup.getDiagnosis14CodeVersion(), claimGroup.getDiagnosis15Code(), claimGroup.getDiagnosis15CodeVersion(), claimGroup.getDiagnosis16Code(), claimGroup.getDiagnosis16CodeVersion(), claimGroup.getDiagnosis17Code(), claimGroup.getDiagnosis17CodeVersion(), claimGroup.getDiagnosis18Code(), claimGroup.getDiagnosis18CodeVersion(), claimGroup.getDiagnosis19Code(), claimGroup.getDiagnosis19CodeVersion(), claimGroup.getDiagnosis20Code(), claimGroup.getDiagnosis20CodeVersion(), claimGroup.getDiagnosis21Code(), claimGroup.getDiagnosis21CodeVersion(), claimGroup.getDiagnosis22Code(), claimGroup.getDiagnosis22CodeVersion(), claimGroup.getDiagnosis23Code(), claimGroup.getDiagnosis23CodeVersion(), claimGroup.getDiagnosis24Code(), claimGroup.getDiagnosis24CodeVersion(), claimGroup.getDiagnosis25Code(), claimGroup.getDiagnosis25CodeVersion())) TransformerUtils.addDiagnosisCode(eob, diagnosis);
    for (Diagnosis diagnosis : TransformerUtils.extractExternalDiagnoses1Thru12(claimGroup.getDiagnosisExternalFirstCode(), claimGroup.getDiagnosisExternalFirstCodeVersion(), claimGroup.getDiagnosisExternal1Code(), claimGroup.getDiagnosisExternal1CodeVersion(), claimGroup.getDiagnosisExternal2Code(), claimGroup.getDiagnosisExternal2CodeVersion(), claimGroup.getDiagnosisExternal3Code(), claimGroup.getDiagnosisExternal3CodeVersion(), claimGroup.getDiagnosisExternal4Code(), claimGroup.getDiagnosisExternal4CodeVersion(), claimGroup.getDiagnosisExternal5Code(), claimGroup.getDiagnosisExternal5CodeVersion(), claimGroup.getDiagnosisExternal6Code(), claimGroup.getDiagnosisExternal6CodeVersion(), claimGroup.getDiagnosisExternal7Code(), claimGroup.getDiagnosisExternal7CodeVersion(), claimGroup.getDiagnosisExternal8Code(), claimGroup.getDiagnosisExternal8CodeVersion(), claimGroup.getDiagnosisExternal9Code(), claimGroup.getDiagnosisExternal9CodeVersion(), claimGroup.getDiagnosisExternal10Code(), claimGroup.getDiagnosisExternal10CodeVersion(), claimGroup.getDiagnosisExternal11Code(), claimGroup.getDiagnosisExternal11CodeVersion(), claimGroup.getDiagnosisExternal12Code(), claimGroup.getDiagnosisExternal12CodeVersion())) TransformerUtils.addDiagnosisCode(eob, diagnosis);
    for (CCWProcedure procedure : TransformerUtils.extractCCWProcedures(claimGroup.getProcedure1Code(), claimGroup.getProcedure1CodeVersion(), claimGroup.getProcedure1Date(), claimGroup.getProcedure2Code(), claimGroup.getProcedure2CodeVersion(), claimGroup.getProcedure2Date(), claimGroup.getProcedure3Code(), claimGroup.getProcedure3CodeVersion(), claimGroup.getProcedure3Date(), claimGroup.getProcedure4Code(), claimGroup.getProcedure4CodeVersion(), claimGroup.getProcedure4Date(), claimGroup.getProcedure5Code(), claimGroup.getProcedure5CodeVersion(), claimGroup.getProcedure5Date(), claimGroup.getProcedure6Code(), claimGroup.getProcedure6CodeVersion(), claimGroup.getProcedure6Date(), claimGroup.getProcedure7Code(), claimGroup.getProcedure7CodeVersion(), claimGroup.getProcedure7Date(), claimGroup.getProcedure8Code(), claimGroup.getProcedure8CodeVersion(), claimGroup.getProcedure8Date(), claimGroup.getProcedure9Code(), claimGroup.getProcedure9CodeVersion(), claimGroup.getProcedure9Date(), claimGroup.getProcedure10Code(), claimGroup.getProcedure10CodeVersion(), claimGroup.getProcedure10Date(), claimGroup.getProcedure11Code(), claimGroup.getProcedure11CodeVersion(), claimGroup.getProcedure11Date(), claimGroup.getProcedure12Code(), claimGroup.getProcedure12CodeVersion(), claimGroup.getProcedure12Date(), claimGroup.getProcedure13Code(), claimGroup.getProcedure13CodeVersion(), claimGroup.getProcedure13Date(), claimGroup.getProcedure14Code(), claimGroup.getProcedure14CodeVersion(), claimGroup.getProcedure14Date(), claimGroup.getProcedure15Code(), claimGroup.getProcedure15CodeVersion(), claimGroup.getProcedure15Date(), claimGroup.getProcedure16Code(), claimGroup.getProcedure16CodeVersion(), claimGroup.getProcedure16Date(), claimGroup.getProcedure17Code(), claimGroup.getProcedure17CodeVersion(), claimGroup.getProcedure17Date(), claimGroup.getProcedure18Code(), claimGroup.getProcedure18CodeVersion(), claimGroup.getProcedure18Date(), claimGroup.getProcedure19Code(), claimGroup.getProcedure19CodeVersion(), claimGroup.getProcedure19Date(), claimGroup.getProcedure20Code(), claimGroup.getProcedure20CodeVersion(), claimGroup.getProcedure20Date(), claimGroup.getProcedure21Code(), claimGroup.getProcedure21CodeVersion(), claimGroup.getProcedure21Date(), claimGroup.getProcedure22Code(), claimGroup.getProcedure22CodeVersion(), claimGroup.getProcedure22Date(), claimGroup.getProcedure23Code(), claimGroup.getProcedure23CodeVersion(), claimGroup.getProcedure23Date(), claimGroup.getProcedure24Code(), claimGroup.getProcedure24CodeVersion(), claimGroup.getProcedure24Date(), claimGroup.getProcedure25Code(), claimGroup.getProcedure25CodeVersion(), claimGroup.getProcedure25Date())) TransformerUtils.addProcedureCode(eob, procedure);
    for (SNFClaimLine claimLine : claimGroup.getLines()) {
        ItemComponent item = eob.addItem();
        item.setSequence(claimLine.getLineNumber().intValue());
        item.setLocation(new Address().setState((claimGroup.getProviderStateCode())));
        TransformerUtils.mapHcpcs(eob, item, Optional.empty(), claimLine.getHcpcsCode(), Collections.emptyList());
        // Common item level fields between Inpatient, Outpatient, HHA, Hospice and SNF
        TransformerUtils.mapEobCommonItemRevenue(item, eob, claimLine.getRevenueCenter(), claimLine.getRateAmount(), claimLine.getTotalChargeAmount(), claimLine.getNonCoveredChargeAmount(), BigDecimal.valueOf(claimLine.getUnitCount()), claimLine.getNationalDrugCodeQuantity(), claimLine.getNationalDrugCodeQualifierCode(), claimLine.getRevenueCenterRenderingPhysicianNPI());
        // Common group level field coinsurance between Inpatient, HHA, Hospice and SNF
        TransformerUtils.mapEobCommonGroupInpHHAHospiceSNFCoinsurance(eob, item, claimLine.getDeductibleCoinsuranceCd());
    }
    TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated());
    return eob;
}
Also used : SupportingInformationComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.SupportingInformationComponent) SNFClaimLine(gov.cms.bfd.model.rif.SNFClaimLine) Address(org.hl7.fhir.dstu3.model.Address) CCWProcedure(gov.cms.bfd.server.war.commons.CCWProcedure) ItemComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent) Period(org.hl7.fhir.dstu3.model.Period) Diagnosis(gov.cms.bfd.server.war.commons.Diagnosis) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit)

Example 45 with SupportingInformationComponent

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

the class TransformerUtils method addCommonGroupInpatientSNF.

/**
 * Adds field values to the benefit balance component that are common between the Inpatient and
 * SNF claim types.
 *
 * @param eob the {@link ExplanationOfBenefit} to map the fields into
 * @param coinsuranceDayCount BENE_TOT_COINSRNC_DAYS_CNT: a {@link BigDecimal} shared field
 *     representing the coinsurance day count for the claim
 * @param nonUtilizationDayCount CLM_NON_UTLZTN_DAYS_CNT: a {@link BigDecimal} shared field
 *     representing the non-utilization day count for the claim
 * @param deductibleAmount NCH_BENE_IP_DDCTBL_AMT: a {@link BigDecimal} shared field representing
 *     the deductible amount for the claim
 * @param partACoinsuranceLiabilityAmount NCH_BENE_PTA_COINSRNC_LBLTY_AM: a {@link BigDecimal}
 *     shared field representing the part A coinsurance amount for the claim
 * @param bloodPintsFurnishedQty NCH_BLOOD_PNTS_FRNSHD_QTY: a {@link BigDecimal} shared field
 *     representing the blood pints furnished quantity for the claim
 * @param noncoveredCharge NCH_IP_NCVRD_CHRG_AMT: a {@link BigDecimal} shared field representing
 *     the non-covered charge for the claim
 * @param totalDeductionAmount NCH_IP_TOT_DDCTN_AMT: a {@link BigDecimal} shared field
 *     representing the total deduction amount for the claim
 * @param claimPPSCapitalDisproportionateShareAmt CLM_PPS_CPTL_DSPRPRTNT_SHR_AMT: an {@link
 *     Optional}<{@link BigDecimal}> shared field representing the claim PPS capital
 *     disproportionate share amount for the claim
 * @param claimPPSCapitalExceptionAmount CLM_PPS_CPTL_EXCPTN_AMT: an {@link Optional}<{@link
 *     BigDecimal}> shared field representing the claim PPS capital exception amount for the
 *     claim
 * @param claimPPSCapitalFSPAmount CLM_PPS_CPTL_FSP_AMT: an {@link Optional}<{@link
 *     BigDecimal}> shared field representing the claim PPS capital FSP amount for the claim
 * @param claimPPSCapitalIMEAmount CLM_PPS_CPTL_IME_AMT: an {@link Optional}<{@link
 *     BigDecimal}> shared field representing the claim PPS capital IME amount for the claim
 * @param claimPPSCapitalOutlierAmount CLM_PPS_CPTL_OUTLIER_AMT: an {@link Optional}<{@link
 *     BigDecimal}> shared field representing the claim PPS capital outlier amount for the
 *     claim
 * @param claimPPSOldCapitalHoldHarmlessAmount CLM_PPS_OLD_CPTL_HLD_HRMLS_AMT: an {@link
 *     Optional}<{@link BigDecimal}> shared field representing the claim PPS old capital
 *     hold harmless amount for the claim
 */
static void addCommonGroupInpatientSNF(ExplanationOfBenefit eob, BigDecimal coinsuranceDayCount, BigDecimal nonUtilizationDayCount, BigDecimal deductibleAmount, BigDecimal partACoinsuranceLiabilityAmount, BigDecimal bloodPintsFurnishedQty, BigDecimal noncoveredCharge, BigDecimal totalDeductionAmount, Optional<BigDecimal> claimPPSCapitalDisproportionateShareAmt, Optional<BigDecimal> claimPPSCapitalExceptionAmount, Optional<BigDecimal> claimPPSCapitalFSPAmount, Optional<BigDecimal> claimPPSCapitalIMEAmount, Optional<BigDecimal> claimPPSCapitalOutlierAmount, Optional<BigDecimal> claimPPSOldCapitalHoldHarmlessAmount) {
    BenefitComponent beneTotCoinsrncDaysCntFinancial = addBenefitBalanceFinancial(eob, BenefitCategory.MEDICAL, CcwCodebookVariable.BENE_TOT_COINSRNC_DAYS_CNT);
    beneTotCoinsrncDaysCntFinancial.setUsed(new UnsignedIntType(coinsuranceDayCount.intValueExact()));
    BenefitComponent clmNonUtlztnDaysCntFinancial = addBenefitBalanceFinancial(eob, BenefitCategory.MEDICAL, CcwCodebookVariable.CLM_NON_UTLZTN_DAYS_CNT);
    clmNonUtlztnDaysCntFinancial.setUsed(new UnsignedIntType(nonUtilizationDayCount.intValueExact()));
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_BENE_IP_DDCTBL_AMT, deductibleAmount);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_BENE_PTA_COINSRNC_LBLTY_AMT, partACoinsuranceLiabilityAmount);
    SupportingInformationComponent nchBloodPntsFrnshdQtyInfo = addInformation(eob, CcwCodebookVariable.NCH_BLOOD_PNTS_FRNSHD_QTY);
    Quantity bloodPintsQuantity = new Quantity();
    bloodPintsQuantity.setValue(bloodPintsFurnishedQty);
    bloodPintsQuantity.setSystem(TransformerConstants.CODING_SYSTEM_UCUM).setCode(TransformerConstants.CODING_SYSTEM_UCUM_PINT_CODE).setUnit(TransformerConstants.CODING_SYSTEM_UCUM_PINT_DISPLAY);
    nchBloodPntsFrnshdQtyInfo.setValue(bloodPintsQuantity);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_IP_NCVRD_CHRG_AMT, noncoveredCharge);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_IP_TOT_DDCTN_AMT, totalDeductionAmount);
    if (claimPPSCapitalDisproportionateShareAmt.isPresent()) {
        addAdjudicationTotal(eob, CcwCodebookVariable.CLM_PPS_CPTL_DSPRPRTNT_SHR_AMT, claimPPSCapitalDisproportionateShareAmt);
    }
    if (claimPPSCapitalExceptionAmount.isPresent()) {
        addAdjudicationTotal(eob, CcwCodebookVariable.CLM_PPS_CPTL_EXCPTN_AMT, claimPPSCapitalExceptionAmount);
    }
    if (claimPPSCapitalFSPAmount.isPresent()) {
        addAdjudicationTotal(eob, CcwCodebookVariable.CLM_PPS_CPTL_FSP_AMT, claimPPSCapitalFSPAmount);
    }
    if (claimPPSCapitalIMEAmount.isPresent()) {
        addAdjudicationTotal(eob, CcwCodebookVariable.CLM_PPS_CPTL_IME_AMT, claimPPSCapitalIMEAmount);
    }
    if (claimPPSCapitalOutlierAmount.isPresent()) {
        addAdjudicationTotal(eob, CcwCodebookVariable.CLM_PPS_CPTL_OUTLIER_AMT, claimPPSCapitalOutlierAmount);
    }
    if (claimPPSOldCapitalHoldHarmlessAmount.isPresent()) {
        addAdjudicationTotal(eob, CcwCodebookVariable.CLM_PPS_OLD_CPTL_HLD_HRMLS_AMT, claimPPSOldCapitalHoldHarmlessAmount);
    }
}
Also used : SupportingInformationComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.SupportingInformationComponent) SimpleQuantity(org.hl7.fhir.dstu3.model.SimpleQuantity) Quantity(org.hl7.fhir.dstu3.model.Quantity) UnsignedIntType(org.hl7.fhir.dstu3.model.UnsignedIntType) BenefitComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent)

Aggregations

SupportingInformationComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent)68 Coding (org.hl7.fhir.r4.model.Coding)59 Test (org.junit.jupiter.api.Test)59 SupportingInformationComponent (org.hl7.fhir.dstu3.model.ExplanationOfBenefit.SupportingInformationComponent)11 DateType (org.hl7.fhir.r4.model.DateType)11 Period (org.hl7.fhir.r4.model.Period)6 SNFClaimLine (gov.cms.bfd.model.rif.SNFClaimLine)4 Quantity (org.hl7.fhir.r4.model.Quantity)4 Diagnosis (gov.cms.bfd.server.war.commons.Diagnosis)3 BigDecimal (java.math.BigDecimal)3 SimpleDateFormat (java.text.SimpleDateFormat)3 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)3 SimpleQuantity (org.hl7.fhir.r4.model.SimpleQuantity)3 FhirContext (ca.uhn.fhir.context.FhirContext)2 TemporalPrecisionEnum (ca.uhn.fhir.model.api.TemporalPrecisionEnum)2 CcwCodebookVariable (gov.cms.bfd.model.codebook.data.CcwCodebookVariable)2 CcwCodebookInterface (gov.cms.bfd.model.codebook.model.CcwCodebookInterface)2 CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)2 CarrierClaimColumn (gov.cms.bfd.model.rif.CarrierClaimColumn)2 CarrierClaimLine (gov.cms.bfd.model.rif.CarrierClaimLine)2