Search in sources :

Example 1 with ReferralRequestRequesterComponent

use of org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestRequesterComponent in project beneficiary-fhir-data by CMSgov.

the class TransformerUtils method mapEobCommonGroupCarrierDME.

/**
 * Transforms the common group level data elements between the {@link CarrierClaim} and {@link
 * DMEClaim} claim types to FHIR. The method parameter fields from {@link CarrierClaim} and {@link
 * DMEClaim} are listed below and their corresponding RIF CCW fields (denoted in all CAPS below
 * from {@link CarrierClaimColumn} and {@link DMEClaimColumn}).
 *
 * @param eob the {@link ExplanationOfBenefit} to modify
 * @param benficiaryId BEME_ID, *
 * @param carrierNumber CARR_NUM,
 * @param clinicalTrialNumber CLM_CLNCL_TRIL_NUM,
 * @param beneficiaryPartBDeductAmount CARR_CLM_CASH_DDCTBL_APLD_AMT,
 * @param paymentDenialCode CARR_CLM_PMT_DNL_CD,
 * @param referringPhysicianNpi RFR_PHYSN_NPI
 * @param providerAssignmentIndicator CARR_CLM_PRVDR_ASGNMT_IND_SW,
 * @param providerPaymentAmount NCH_CLM_PRVDR_PMT_AMT,
 * @param beneficiaryPaymentAmount NCH_CLM_BENE_PMT_AMT,
 * @param submittedChargeAmount NCH_CARR_CLM_SBMTD_CHRG_AMT,
 * @param allowedChargeAmount NCH_CARR_CLM_ALOWD_AMT,
 */
static void mapEobCommonGroupCarrierDME(ExplanationOfBenefit eob, String beneficiaryId, String carrierNumber, Optional<String> clinicalTrialNumber, BigDecimal beneficiaryPartBDeductAmount, String paymentDenialCode, Optional<String> referringPhysicianNpi, Optional<Character> providerAssignmentIndicator, BigDecimal providerPaymentAmount, BigDecimal beneficiaryPaymentAmount, BigDecimal submittedChargeAmount, BigDecimal allowedChargeAmount, String claimDispositionCode, Optional<String> claimCarrierControlNumber) {
    eob.addExtension(createExtensionIdentifier(CcwCodebookVariable.CARR_NUM, carrierNumber));
    // Carrier Claim Control Number
    if (claimCarrierControlNumber.isPresent()) {
        eob.addExtension(createExtensionIdentifier(CcwCodebookMissingVariable.CARR_CLM_CNTL_NUM, claimCarrierControlNumber.get()));
    }
    eob.addExtension(createExtensionCoding(eob, CcwCodebookVariable.CARR_CLM_PMT_DNL_CD, paymentDenialCode));
    // Claim Disposition Code
    eob.setDisposition(claimDispositionCode);
    /*
     * Referrals are represented as contained resources, since they share the lifecycle and identity
     * of their containing EOB.
     */
    if (referringPhysicianNpi.isPresent()) {
        ReferralRequest referral = new ReferralRequest();
        referral.setStatus(ReferralRequestStatus.COMPLETED);
        referral.setSubject(referencePatient(beneficiaryId));
        referral.setRequester(new ReferralRequestRequesterComponent(referencePractitioner(referringPhysicianNpi.get())));
        referral.addRecipient(referencePractitioner(referringPhysicianNpi.get()));
        // Set the ReferralRequest as a contained resource in the EOB:
        eob.setReferral(new Reference(referral));
    }
    if (providerAssignmentIndicator.isPresent()) {
        eob.addExtension(createExtensionCoding(eob, CcwCodebookVariable.ASGMNTCD, providerAssignmentIndicator));
    }
    if (clinicalTrialNumber.isPresent()) {
        eob.addExtension(createExtensionIdentifier(CcwCodebookVariable.CLM_CLNCL_TRIL_NUM, clinicalTrialNumber));
    }
    addAdjudicationTotal(eob, CcwCodebookVariable.CARR_CLM_CASH_DDCTBL_APLD_AMT, beneficiaryPartBDeductAmount);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CLM_PRVDR_PMT_AMT, providerPaymentAmount);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CLM_BENE_PMT_AMT, beneficiaryPaymentAmount);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CARR_CLM_SBMTD_CHRG_AMT, submittedChargeAmount);
    addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CARR_CLM_ALOWD_AMT, allowedChargeAmount);
}
Also used : ReferralRequest(org.hl7.fhir.dstu3.model.ReferralRequest) ReferralRequestRequesterComponent(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestRequesterComponent) Reference(org.hl7.fhir.dstu3.model.Reference)

Aggregations

Reference (org.hl7.fhir.dstu3.model.Reference)1 ReferralRequest (org.hl7.fhir.dstu3.model.ReferralRequest)1 ReferralRequestRequesterComponent (org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestRequesterComponent)1