Search in sources :

Example 26 with Extension

use of org.hl7.fhir.dstu2016may.model.Extension in project beneficiary-fhir-data by CMSgov.

the class BeneficiaryTransformerV2Test method verifyDualResourceExtension.

/**
 * helper function to verify that {@link
 * gov.cms.bfd.server.war.r4.providers.BeneficiaryTransformerV2} correctly handles patient Part D
 * attributee.
 */
private void verifyDualResourceExtension(String dualId) {
    String uri = "https://bluebutton.cms.gov/resources/variables/" + dualId;
    Extension ex = TransformerTestUtilsV2.findExtensionByUrl(uri, patient.getExtension());
    assertNotNull(ex);
    Extension compare = new Extension(uri, new Coding(uri, "**", "Enrolled in Medicare A and/or B, but no Part D enrollment data for the beneficiary. (This status was indicated as 'XX' for 2006-2009)"));
    assertTrue(compare.equalsDeep(ex));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Coding(org.hl7.fhir.r4.model.Coding)

Example 27 with Extension

use of org.hl7.fhir.dstu2016may.model.Extension in project beneficiary-fhir-data by CMSgov.

the class CarrierClaimTransformerV2Test method shouldHaveExtensionsWithClaimClinicalTrailNumber.

@Test
public void shouldHaveExtensionsWithClaimClinicalTrailNumber() {
    Extension ex = TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num", eob.getExtension());
    Identifier identifier = new Identifier().setSystem("https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num").setValue("0");
    Extension compare = new Extension("https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num", identifier);
    assertTrue(compare.equalsDeep(ex));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Identifier(org.hl7.fhir.r4.model.Identifier) Test(org.junit.jupiter.api.Test)

Example 28 with Extension

use of org.hl7.fhir.dstu2016may.model.Extension in project beneficiary-fhir-data by CMSgov.

the class CarrierClaimTransformerV2Test method shouldHaveExtensionsWithClaimEntryCodeNumber.

@Test
public void shouldHaveExtensionsWithClaimEntryCodeNumber() {
    Extension ex = TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/carr_clm_entry_cd", eob.getExtension());
    Coding coding = new Coding().setSystem("https://bluebutton.cms.gov/resources/variables/carr_clm_entry_cd").setDisplay("Original debit; void of original debit (If CLM_DISP_CD = 3, code 1 means voided original debit)").setCode("1");
    Extension compare = new Extension("https://bluebutton.cms.gov/resources/variables/carr_clm_entry_cd", coding);
    assertTrue(compare.equalsDeep(ex));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Coding(org.hl7.fhir.r4.model.Coding) Test(org.junit.jupiter.api.Test)

Example 29 with Extension

use of org.hl7.fhir.dstu2016may.model.Extension in project beneficiary-fhir-data by CMSgov.

the class DMEClaimTransformerV2 method handleClaimLines.

private static void handleClaimLines(DMEClaim claimGroup, ExplanationOfBenefit eob, Optional<Boolean> includeTaxNumbers) {
    for (DMEClaimLine line : claimGroup.getLines()) {
        ItemComponent item = TransformerUtilsV2.addItem(eob);
        // Override the default sequence
        // CLM_LINE_NUM => item.sequence
        item.setSequence(line.getLineNumber().intValue());
        // add an extension for the provider billing number as there is not a good place
        // to map this in the existing FHIR specification
        // PRVDR_NUM => ExplanationOfBenefit.provider.value
        line.getProviderBillingNumber().ifPresent(c -> item.addExtension(TransformerUtilsV2.createExtensionIdentifier(CcwCodebookVariable.SUPLRNUM, line.getProviderBillingNumber())));
        // PRVDR_NPI => ExplanationOfBenefit.careTeam.provider
        Optional<CareTeamComponent> performing = TransformerUtilsV2.addCareTeamMember(eob, item, C4BBPractitionerIdentifierType.NPI, C4BBClaimProfessionalAndNonClinicianCareTeamRole.PERFORMING, line.getProviderNPI());
        // Update the responsible flag
        performing.ifPresent(p -> {
            p.setResponsible(true);
            // PRVDR_SPCLTY => ExplanationOfBenefit.careTeam.qualification
            p.setQualification(TransformerUtilsV2.createCodeableConcept(eob, CcwCodebookVariable.PRVDR_SPCLTY, line.getProviderSpecialityCode()));
            // PRTCPTNG_IND_CD => ExplanationOfBenefit.careTeam.extension
            p.addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.PRTCPTNG_IND_CD, line.getProviderParticipatingIndCode()));
        });
        // PRVDR_STATE_CD => ExplanationOfBenefit.item.location.extension
        if (item.getLocation() != null) {
            item.getLocation().addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.PRVDR_STATE_CD, line.getProviderStateCode()));
        }
        // HCPCS_CD            => ExplanationOfBenefit.item.productOrService
        // HCPCS_1ST_MDFR_CD   => ExplanationOfBenefit.item.modifier
        // HCPCS_2ND_MDFR_CD   => ExplanationOfBenefit.item.modifier
        // HCPCS_3RD_MDFR_CD   => ExplanationOfBenefit.item.modifier
        // HCPCS_4Th_MDFR_CD   => ExplanationOfBenefit.item.modifier
        TransformerUtilsV2.mapHcpcs(eob, item, line.getHcpcsCode(), claimGroup.getHcpcsYearCode(), Arrays.asList(line.getHcpcsInitialModifierCode(), line.getHcpcsSecondModifierCode(), line.getHcpcsThirdModifierCode(), line.getHcpcsFourthModifierCode()));
        if (includeTaxNumbers.orElse(false)) {
            item.addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.TAX_NUM, line.getProviderTaxNumber()));
        }
        // REV_CNTR_PRVDR_PMT_AMT => ExplanationOfBenefit.item.adjudication
        TransformerUtilsV2.addAdjudication(item, TransformerUtilsV2.createAdjudicationAmtSlice(CcwCodebookVariable.REV_CNTR_PRVDR_PMT_AMT, C4BBAdjudication.PAID_TO_PROVIDER, line.getProviderPaymentAmount()));
        // TODO - check w/jack if this is right ELIGIBLE
        // LINE_PRMRY_ALOWD_CHRG_AMT => ExplanationOfBenefit.item.adjudication.value
        TransformerUtilsV2.addAdjudication(item, TransformerUtilsV2.createAdjudicationAmtSlice(CcwCodebookVariable.LINE_PRMRY_ALOWD_CHRG_AMT, C4BBAdjudication.ELIGIBLE, line.getPrimaryPayerAllowedChargeAmount()));
        // LINE_DME_PRCHS_PRICE_AMT => ExplanationOfBenefit.item.adjudication.value
        TransformerUtilsV2.addAdjudication(item, TransformerUtilsV2.createAdjudicationAmtSlice(CcwCodebookVariable.LINE_DME_PRCHS_PRICE_AMT, C4BBAdjudication.SUBMITTED, line.getPurchasePriceAmount()));
        // DMERC_LINE_SCRN_SVGS_AMT => ExplanationOfBenefit.item.extension
        line.getScreenSavingsAmount().ifPresent(c -> item.addExtension(// TODO should this be an adjudication?
        TransformerUtilsV2.createExtensionQuantity(CcwCodebookVariable.DMERC_LINE_SCRN_SVGS_AMT, line.getScreenSavingsAmount())));
        // DMERC_LINE_MTUS_CNT => ExplanationOfBenefit.item.extension
        Extension mtusQuantityExtension = TransformerUtilsV2.createExtensionQuantity(CcwCodebookVariable.DMERC_LINE_MTUS_CNT, line.getMtusCount());
        item.addExtension(mtusQuantityExtension);
        // DMERC_LINE_MTUS_CD => ExplanationOfBenefit.item.extension
        if (line.getMtusCode().isPresent()) {
            Quantity mtusQuantity = (Quantity) mtusQuantityExtension.getValue();
            TransformerUtilsV2.setQuantityUnitInfo(CcwCodebookVariable.DMERC_LINE_MTUS_CD, line.getMtusCode(), eob, mtusQuantity);
        }
        // DMERC_LINE_PRCNG_STATE_CD => ExplanationOfBenefit.item.extension
        line.getPricingStateCode().ifPresent(c -> item.addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.DMERC_LINE_PRCNG_STATE_CD, line.getPricingStateCode())));
        // DMERC_LINE_SUPPLR_TYPE_CD => ExplanationOfBenefit.item.extension
        line.getSupplierTypeCode().ifPresent(c -> item.addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.DMERC_LINE_SUPPLR_TYPE_CD, line.getSupplierTypeCode())));
        // Common item level fields between Carrier and DME
        // LINE_NUM                 => ExplanationOfBenefit.item.sequence
        // LINE_SRVC_CNT            => ExplanationOfBenefit.item.quantity
        // LINE_CMS_TYPE_SRVC_CD    => ExplanationOfBenefit.item.category
        // LINE_PLACE_OF_SRVC_CD    => ExplanationOfBenefit.item.location
        // LINE_1ST_EXPNS_DT        => ExplanationOfBenefit.item.servicedPeriod
        // LINE_LAST_EXPNS_DT       => ExplanationOfBenefit.item.servicedPeriod
        // LINE_NCH_PMT_AMT         => ExplanationOfBenefit.item.adjudication
        // LINE_PMT_80_100_CD       => ExplanationOfBenefit.item.adjudication.extension
        // PAID_TO_PATIENT          => ExplanationOfBenefit.item.adjudication
        // LINE_PRVDR_PMT_AMT       => ExplanationOfBenefit.item.adjudication
        // LINE_BENE_PTB_DDCTBL_AMT => ExplanationOfBenefit.item.adjudication
        // LINE_BENE_PRMRY_PYR_CD   => ExplanationOfBenefit.item.extension
        // LINE_BENE_PRMRY_PYR_PD_AMT => ExplanationOfBenefit.item.adjudication
        // BETOS_CD                 => ExplanationOfBenefit.item.extension
        // LINE_COINSRNC_AMT        => ExplanationOfBenefit.item.adjudication
        // LINE_SBMTD_CHRG_AMT      => ExplanationOfBenefit.item.adjudication
        // LINE_ALOWD_CHRG_AMT      => ExplanationOfBenefit.item.adjudication
        // LINE_BENE_PRMRY_PYR_CD   => ExplanationOfBenefit.item.extension
        // LINE_SERVICE_DEDUCTIBLE  => ExplanationOfBenefit.item.extension
        // LINE_HCT_HGB_TYPE_CD     => Observation.code
        // LINE_HCT_HGB_RSLT_NUM    => Observation.value
        // LINE_NDC_CD              => ExplanationOfBenefit.item.productOrService
        // LINE_BENE_PMT_AMT        => ExplanationOfBenefit.item.adjudication.value
        // LINE_PRCSG_IND_CD        => ExplanationOfBenefit.item.extension
        // LINE_DME_PRCHS_PRICE_AMT => ExplanationOfBenefit.item.adjudication.value
        TransformerUtilsV2.mapEobCommonItemCarrierDME(item, eob, claimGroup.getClaimId(), item.getSequence(), line.getServiceCount(), line.getPlaceOfServiceCode(), line.getFirstExpenseDate(), line.getLastExpenseDate(), line.getBeneficiaryPaymentAmount(), line.getProviderPaymentAmount(), line.getBeneficiaryPartBDeductAmount(), line.getPrimaryPayerCode(), line.getPrimaryPayerPaidAmount(), line.getBetosCode(), line.getPaymentAmount(), line.getPaymentCode(), line.getCoinsuranceAmount(), line.getSubmittedChargeAmount(), line.getAllowedChargeAmount(), line.getProcessingIndicatorCode(), line.getServiceDeductibleCode(), line.getHctHgbTestTypeCode(), line.getHctHgbTestResult(), line.getCmsServiceTypeCode(), line.getNationalDrugCode());
        // LINE_ICD_DGNS_CD      => ExplanationOfBenefit.item.diagnosisSequence
        // LINE_ICD_DGNS_VRSN_CD => ExplanationOfBenefit.item.diagnosisSequence
        DiagnosisUtilV2.addDiagnosisLink(eob, item, Diagnosis.from(line.getDiagnosisCode(), line.getDiagnosisCodeVersion(), DiagnosisLabel.OTHER), ClaimTypeV2.CARRIER);
        // PRVDR_STATE_CD => ExplanationOfBenefit.item.location.extension
        if (line.getProviderStateCode() != null) {
            item.getLocation().addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.PRVDR_STATE_CD, line.getProviderStateCode()));
        }
        // LINE_BENE_PRMRY_PYR_CD
        // claimLine.getPrimaryPayerCode()) => ExplanationOfBenefit.item.extension
        line.getPrimaryPayerCode().ifPresent(c -> item.addExtension(TransformerUtilsV2.createExtensionCoding(eob, CcwCodebookVariable.LINE_BENE_PRMRY_PYR_CD, line.getPrimaryPayerCode())));
        // LINE_BENE_PMT_AMT
        // claimLine.getBeneficiaryPaymentAmount() => ExplanationOfBenefit.item.adjudication.value
        TransformerUtilsV2.addAdjudication(item, TransformerUtilsV2.createAdjudicationAmtSlice(CcwCodebookVariable.LINE_BENE_PMT_AMT, C4BBAdjudication.PAID_TO_PROVIDER, line.getPurchasePriceAmount()));
        // LINE_DME_PRCHS_PRICE_AMT
        // claimLine.getPurchasePriceAmount() => ExplanationOfBenefit.item.adjudication.value
        TransformerUtilsV2.addAdjudication(item, TransformerUtilsV2.createAdjudicationAmtSlice(CcwCodebookVariable.LINE_DME_PRCHS_PRICE_AMT, C4BBAdjudication.SUBMITTED, line.getPurchasePriceAmount()));
    }
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) ItemComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent) Quantity(org.hl7.fhir.r4.model.Quantity) CareTeamComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent) DMEClaimLine(gov.cms.bfd.model.rif.DMEClaimLine)

Example 30 with Extension

use of org.hl7.fhir.dstu2016may.model.Extension in project beneficiary-fhir-data by CMSgov.

the class BeneficiaryTransformerV2 method transform.

/**
 * @param beneficiary the CCW {@link Beneficiary} to transform
 * @param requestHeader {@link RequestHeaders} the holder that contains all supported resource
 *     request headers
 * @return a FHIR {@link Patient} resource that represents the specified {@link Beneficiary}
 */
private static Patient transform(Beneficiary beneficiary, RequestHeaders requestHeader) {
    Objects.requireNonNull(beneficiary);
    Patient patient = new Patient();
    /*
     * Notify end users when they receive Patient records impacted by
     * https://jira.cms.gov/browse/BFD-1566. See the documentation on
     * LoadAppOptions.isFilteringNonNullAndNon2022Benes() for details.
     */
    if (!beneficiary.getSkippedRifRecords().isEmpty()) {
        patient.getMeta().addTag(TransformerConstants.CODING_SYSTEM_BFD_TAGS, TransformerConstants.CODING_BFD_TAGS_DELAYED_BACKDATED_ENROLLMENT, TransformerConstants.CODING_BFD_TAGS_DELAYED_BACKDATED_ENROLLMENT_DISPLAY);
    }
    // Required values not directly mapped
    patient.getMeta().addProfile(ProfileConstants.C4BB_PATIENT_URL);
    patient.setId(beneficiary.getBeneficiaryId());
    // BENE_ID => patient.identifier
    TransformerUtilsV2.addIdentifierSlice(patient, TransformerUtilsV2.createCodeableConcept(TransformerConstants.CODING_SYSTEM_HL7_IDENTIFIER_TYPE, null, TransformerConstants.PATIENT_MB_ID_DISPLAY, "MB"), Optional.of(beneficiary.getBeneficiaryId()), Optional.of(TransformerConstants.CODING_BBAPI_BENE_ID));
    // Unhashed MBI
    if (beneficiary.getMedicareBeneficiaryId().isPresent()) {
        Period mbiPeriod = new Period();
        if (beneficiary.getMbiEffectiveDate().isPresent()) {
            TransformerUtilsV2.setPeriodStart(mbiPeriod, beneficiary.getMbiEffectiveDate().get());
        }
        if (beneficiary.getMbiObsoleteDate().isPresent()) {
            TransformerUtilsV2.setPeriodEnd(mbiPeriod, beneficiary.getMbiObsoleteDate().get());
        }
        addUnhashedIdentifier(patient, beneficiary.getMedicareBeneficiaryId().get(), TransformerConstants.CODING_BBAPI_MEDICARE_BENEFICIARY_ID_UNHASHED, TransformerUtilsV2.createIdentifierCurrencyExtension(CurrencyIdentifier.CURRENT), mbiPeriod);
    }
    // Add lastUpdated
    TransformerUtilsV2.setLastUpdated(patient, beneficiary.getLastUpdated());
    /**
     * The following logic attempts to distill {@link MedicareBeneficiaryIdHistory} data into only
     * those records which have an endDate present. This is due to the fact that it includes the
     * CURRENT MBI record which was handle previously. Also, the {@link
     * MedicareBeneficiaryIdHistory} table appears to contain spurious records with the only
     * difference is the generated surrogate key identifier.
     */
    if (requestHeader.isMBIinIncludeIdentifiers()) {
        HashMap<LocalDate, MedicareBeneficiaryIdHistory> mbiHistMap = new HashMap<LocalDate, MedicareBeneficiaryIdHistory>();
        for (MedicareBeneficiaryIdHistory mbiHistory : beneficiary.getMedicareBeneficiaryIdHistories()) {
            // and will have been previously provided as the CURRENT rcd.
            if (mbiHistory.getMbiEndDate().isPresent()) {
                mbiHistMap.put(mbiHistory.getMbiEndDate().get(), mbiHistory);
            }
            // would come in ascending order, so any rcd would have a later
            // update date than prev rcd.
            TransformerUtilsV2.updateMaxLastUpdated(patient, mbiHistory.getLastUpdated());
        }
        if (mbiHistMap.size() > 0) {
            Extension historicalIdentifier = TransformerUtilsV2.createIdentifierCurrencyExtension(CurrencyIdentifier.HISTORIC);
            for (MedicareBeneficiaryIdHistory mbi : mbiHistMap.values()) {
                addUnhashedIdentifier(patient, mbi.getMedicareBeneficiaryId().get(), TransformerConstants.CODING_BBAPI_MEDICARE_BENEFICIARY_ID_UNHASHED, historicalIdentifier, null);
            }
        }
    }
    // support header includeAddressFields from downstream components e.g. BB2
    // per requirement of BFD-379, BB2 always send header includeAddressFields = False
    Boolean addrHdrVal = requestHeader.getValue(R4PatientResourceProvider.HEADER_NAME_INCLUDE_ADDRESS_FIELDS);
    if (addrHdrVal != null && addrHdrVal) {
        patient.addAddress().setState(beneficiary.getStateCode()).setPostalCode(beneficiary.getPostalCode()).setCity(beneficiary.getDerivedCityName().orElse(null)).addLine(beneficiary.getDerivedMailingAddress1().orElse(null)).addLine(beneficiary.getDerivedMailingAddress2().orElse(null)).addLine(beneficiary.getDerivedMailingAddress3().orElse(null)).addLine(beneficiary.getDerivedMailingAddress4().orElse(null)).addLine(beneficiary.getDerivedMailingAddress5().orElse(null)).addLine(beneficiary.getDerivedMailingAddress6().orElse(null));
    } else {
        patient.addAddress().setState(beneficiary.getStateCode()).setPostalCode(beneficiary.getPostalCode());
    }
    if (beneficiary.getBirthDate() != null) {
        patient.setBirthDate(TransformerUtilsV2.convertToDate(beneficiary.getBirthDate()));
    }
    // "Patient.deceased[x]": ["boolean", "dateTime"],
    if (beneficiary.getBeneficiaryDateOfDeath().isPresent()) {
        patient.setDeceased(new DateTimeType(TransformerUtilsV2.convertToDate(beneficiary.getBeneficiaryDateOfDeath().get()), TemporalPrecisionEnum.DAY));
    } else {
        patient.setDeceased(new BooleanType(false));
    }
    char sex = beneficiary.getSex();
    if (sex == Sex.MALE.getCode())
        patient.setGender((AdministrativeGender.MALE));
    else if (sex == Sex.FEMALE.getCode())
        patient.setGender((AdministrativeGender.FEMALE));
    else
        patient.setGender((AdministrativeGender.UNKNOWN));
    if (beneficiary.getRace().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.RACE, beneficiary.getRace().get()));
        // for race category, v2 will just treat all race codes as Unknown (UNK);
        // thus we'll simply pass in the Unknown race code .
        RaceCategory raceCategory = TransformerUtilsV2.getRaceCategory('0');
        Extension raceChildOMBExt1 = new Extension().setValue(new Coding().setCode(raceCategory.toCode()).setSystem(raceCategory.getSystem()).setDisplay(raceCategory.getDisplay())).setUrl("ombCategory");
        Extension raceChildOMBExt2 = new Extension().setValue(new StringType().setValue(raceCategory.getDisplay())).setUrl("text");
        Extension parentOMBRace = new Extension().setUrl(TransformerConstants.CODING_RACE_US);
        parentOMBRace.addExtension(raceChildOMBExt1);
        parentOMBRace.addExtension(raceChildOMBExt2);
        patient.addExtension(parentOMBRace);
    }
    HumanName name = patient.addName().addGiven(beneficiary.getNameGiven()).setFamily(beneficiary.getNameSurname()).setUse(HumanName.NameUse.USUAL);
    if (beneficiary.getNameMiddleInitial().isPresent()) {
        name.addGiven(String.valueOf(beneficiary.getNameMiddleInitial().get()));
    }
    // The reference year of the enrollment data
    if (beneficiary.getBeneEnrollmentReferenceYear().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionDate(CcwCodebookVariable.RFRNC_YR, beneficiary.getBeneEnrollmentReferenceYear()));
    }
    // Monthly Medicare-Medicaid dual eligibility codes
    if (beneficiary.getMedicaidDualEligibilityJanCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_01, beneficiary.getMedicaidDualEligibilityJanCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityFebCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_02, beneficiary.getMedicaidDualEligibilityFebCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityMarCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_03, beneficiary.getMedicaidDualEligibilityMarCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityAprCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_04, beneficiary.getMedicaidDualEligibilityAprCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityMayCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_05, beneficiary.getMedicaidDualEligibilityMayCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityJunCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_06, beneficiary.getMedicaidDualEligibilityJunCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityJulCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_07, beneficiary.getMedicaidDualEligibilityJulCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityAugCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_08, beneficiary.getMedicaidDualEligibilityAugCode()));
    }
    if (beneficiary.getMedicaidDualEligibilitySeptCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_09, beneficiary.getMedicaidDualEligibilitySeptCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityOctCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_10, beneficiary.getMedicaidDualEligibilityOctCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityNovCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_11, beneficiary.getMedicaidDualEligibilityNovCode()));
    }
    if (beneficiary.getMedicaidDualEligibilityDecCode().isPresent()) {
        patient.addExtension(TransformerUtilsV2.createExtensionCoding(patient, CcwCodebookVariable.DUAL_12, beneficiary.getMedicaidDualEligibilityDecCode()));
    }
    // Last Updated => Patient.meta.lastUpdated
    TransformerUtilsV2.setLastUpdated(patient, beneficiary.getLastUpdated());
    return patient;
}
Also used : HashMap(java.util.HashMap) StringType(org.hl7.fhir.r4.model.StringType) BooleanType(org.hl7.fhir.r4.model.BooleanType) Patient(org.hl7.fhir.r4.model.Patient) Period(org.hl7.fhir.r4.model.Period) MedicareBeneficiaryIdHistory(gov.cms.bfd.model.rif.MedicareBeneficiaryIdHistory) LocalDate(java.time.LocalDate) Extension(org.hl7.fhir.r4.model.Extension) HumanName(org.hl7.fhir.r4.model.HumanName) DateTimeType(org.hl7.fhir.r4.model.DateTimeType) Coding(org.hl7.fhir.r4.model.Coding) RaceCategory(gov.cms.bfd.server.war.commons.RaceCategory)

Aggregations

Extension (org.hl7.fhir.r4.model.Extension)154 ArrayList (java.util.ArrayList)104 Coding (org.hl7.fhir.r4.model.Coding)69 Test (org.junit.jupiter.api.Test)69 Extension (org.hl7.fhir.dstu3.model.Extension)67 FHIRException (org.hl7.fhir.exceptions.FHIRException)55 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)46 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)42 Extension (org.hl7.fhir.r5.model.Extension)41 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)39 Test (org.junit.Test)36 Cell (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)35 List (java.util.List)34 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)34 Date (java.util.Date)30 Coding (org.hl7.fhir.dstu3.model.Coding)29 Piece (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece)27 Row (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row)27 Reference (org.hl7.fhir.dstu3.model.Reference)26 Patient (org.hl7.fhir.r4.model.Patient)26