use of org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method shouldHaveCareTeamMembers.
/**
* Testing all of these in one test, just because there isn't a distinct identifier really for
* each
*/
@Test
public void shouldHaveCareTeamMembers() {
// First member
CareTeamComponent member1 = TransformerTestUtilsV2.findCareTeamBySequence(1, eob.getCareTeam());
assertEquals("1306849450", member1.getProvider().getIdentifier().getValue());
// Second member
CareTeamComponent member2 = TransformerTestUtilsV2.findCareTeamBySequence(2, eob.getCareTeam());
assertEquals("1244444444", member2.getProvider().getIdentifier().getValue());
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerTest method assertMatches.
/**
* Verifies that the {@link ExplanationOfBenefit} "looks like" it should, if it were produced from
* the specified {@link DMEClaim}.
*
* @param claim the {@link DMEClaim} that the {@link ExplanationOfBenefit} was generated from
* @param eob the {@link ExplanationOfBenefit} that was generated from the specified {@link
* DMEClaim}@param includedTaxNumbers whether or not to include tax numbers are expected to be
* included in the result (see {@link
* ExplanationOfBenefitResourceProvider#HEADER_NAME_INCLUDE_TAX_NUMBERS}, defaults to <code>
* false</code>)
* @throws FHIRException (indicates test failure)
*/
static void assertMatches(DMEClaim claim, ExplanationOfBenefit eob, Optional<Boolean> includedTaxNumbers) throws FHIRException {
// Test to ensure group level fields between all claim types match
TransformerTestUtils.assertEobCommonClaimHeaderData(eob, claim.getClaimId(), claim.getBeneficiaryId(), ClaimType.DME, claim.getClaimGroupId().toPlainString(), MedicareSegment.PART_B, Optional.of(claim.getDateFrom()), Optional.of(claim.getDateThrough()), Optional.of(claim.getPaymentAmount()), claim.getFinalAction());
// Test to ensure common group fields between Carrier and DME match
TransformerTestUtils.assertEobCommonGroupCarrierDMEEquals(eob, claim.getBeneficiaryId(), claim.getCarrierNumber(), claim.getClinicalTrialNumber(), claim.getBeneficiaryPartBDeductAmount(), claim.getPaymentDenialCode(), claim.getReferringPhysicianNpi(), Optional.of(claim.getProviderAssignmentIndicator()), claim.getProviderPaymentAmount(), claim.getBeneficiaryPaymentAmount(), claim.getSubmittedChargeAmount(), claim.getAllowedChargeAmount());
TransformerTestUtils.assertAdjudicationTotalAmountEquals(CcwCodebookVariable.PRPAYAMT, claim.getPrimaryPayerPaidAmount(), eob);
assertEquals(3, eob.getDiagnosis().size());
assertEquals(1, eob.getItem().size());
ItemComponent eobItem0 = eob.getItem().get(0);
DMEClaimLine claimLine1 = claim.getLines().get(0);
assertEquals(claimLine1.getLineNumber(), new BigDecimal(eobItem0.getSequence()));
TransformerTestUtils.assertExtensionIdentifierEquals(CcwCodebookVariable.SUPLRNUM, claimLine1.getProviderBillingNumber(), eobItem0);
TransformerTestUtils.assertCareTeamEquals(claimLine1.getProviderNPI().get(), ClaimCareteamrole.PRIMARY, eob);
CareTeamComponent performingCareTeamEntry = TransformerTestUtils.findCareTeamEntryForProviderNpi(claimLine1.getProviderNPI().get(), eob.getCareTeam());
TransformerTestUtils.assertHasCoding(CcwCodebookVariable.PRVDR_SPCLTY, claimLine1.getProviderSpecialityCode(), performingCareTeamEntry.getQualification());
TransformerTestUtils.assertExtensionCodingEquals(CcwCodebookVariable.PRTCPTNG_IND_CD, claimLine1.getProviderParticipatingIndCode(), performingCareTeamEntry);
TransformerTestUtils.assertExtensionCodingEquals(CcwCodebookVariable.PRVDR_STATE_CD, claimLine1.getProviderStateCode(), eobItem0.getLocation());
CareTeamComponent taxNumberCareTeamEntry = TransformerTestUtils.findCareTeamEntryForProviderTaxNumber(claimLine1.getProviderTaxNumber(), eob.getCareTeam());
if (includedTaxNumbers.orElse(false)) {
assertNotNull(taxNumberCareTeamEntry);
} else {
assertNull(taxNumberCareTeamEntry);
}
TransformerTestUtils.assertHcpcsCodes(eobItem0, claimLine1.getHcpcsCode(), claimLine1.getHcpcsInitialModifierCode(), claimLine1.getHcpcsSecondModifierCode(), claim.getHcpcsYearCode(), 0);
TransformerTestUtils.assertHasCoding(TransformerConstants.CODING_SYSTEM_HCPCS, "" + claim.getHcpcsYearCode().get(), null, claimLine1.getHcpcsCode().get(), eobItem0.getService().getCoding());
TransformerTestUtils.assertAdjudicationAmountEquals(CcwCodebookVariable.LINE_PRMRY_ALOWD_CHRG_AMT, claimLine1.getPrimaryPayerAllowedChargeAmount(), eobItem0.getAdjudication());
TransformerTestUtils.assertAdjudicationAmountEquals(CcwCodebookVariable.LINE_DME_PRCHS_PRICE_AMT, claimLine1.getPurchasePriceAmount(), eobItem0.getAdjudication());
TransformerTestUtils.assertExtensionCodingEquals(CcwCodebookVariable.DMERC_LINE_PRCNG_STATE_CD, claimLine1.getPricingStateCode(), eobItem0.getLocation());
TransformerTestUtils.assertExtensionCodingEquals(CcwCodebookVariable.DMERC_LINE_SUPPLR_TYPE_CD, claimLine1.getSupplierTypeCode(), eobItem0.getLocation());
TransformerTestUtils.assertExtensionQuantityEquals(CcwCodebookVariable.DMERC_LINE_SCRN_SVGS_AMT, claimLine1.getScreenSavingsAmount(), eobItem0);
TransformerTestUtils.assertQuantityUnitInfoEquals(CcwCodebookVariable.DMERC_LINE_MTUS_CNT, CcwCodebookVariable.DMERC_LINE_MTUS_CD, claimLine1.getMtusCode(), eobItem0);
TransformerTestUtils.assertExtensionQuantityEquals(CcwCodebookVariable.DMERC_LINE_MTUS_CNT, claimLine1.getMtusCount(), eobItem0);
TransformerTestUtils.assertExtensionCodingEquals(eobItem0, TransformerConstants.CODING_NDC, TransformerConstants.CODING_NDC, claimLine1.getNationalDrugCode().get());
// verify {@link
// TransformerUtils#mapEobType(CodeableConcept,ClaimType,Optional,Optional)}
// method worked as expected for this claim type
TransformerTestUtils.assertMapEobType(eob.getType(), ClaimType.DME, // be updated to match expected result.
Optional.empty(), Optional.of(claim.getNearLineRecordIdCode()), Optional.of(claim.getClaimTypeCode()));
// Test to ensure common item fields between Carrier and DME match
TransformerTestUtils.assertEobCommonItemCarrierDMEEquals(eobItem0, eob, claimLine1.getServiceCount(), claimLine1.getPlaceOfServiceCode(), claimLine1.getFirstExpenseDate(), claimLine1.getLastExpenseDate(), claimLine1.getBeneficiaryPaymentAmount(), claimLine1.getProviderPaymentAmount(), claimLine1.getBeneficiaryPartBDeductAmount(), claimLine1.getPrimaryPayerCode(), claimLine1.getPrimaryPayerPaidAmount(), claimLine1.getBetosCode(), claimLine1.getPaymentAmount(), claimLine1.getPaymentCode(), claimLine1.getCoinsuranceAmount(), claimLine1.getSubmittedChargeAmount(), claimLine1.getAllowedChargeAmount(), claimLine1.getProcessingIndicatorCode(), claimLine1.getServiceDeductibleCode(), claimLine1.getDiagnosisCode(), claimLine1.getDiagnosisCodeVersion(), claimLine1.getHctHgbTestTypeCode(), claimLine1.getHctHgbTestResult(), claimLine1.getCmsServiceTypeCode(), claimLine1.getNationalDrugCode());
// Test lastUpdated
TransformerTestUtils.assertLastUpdatedEquals(claim.getLastUpdated(), eob);
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveCareTeamMembers.
/**
* Testing all of these in one test, just because there isn't a distinct identifier really for
* each
*/
@Test
public void shouldHaveCareTeamMembers() {
// First member
CareTeamComponent member1 = TransformerTestUtilsV2.findCareTeamBySequence(1, eob.getCareTeam());
CareTeamComponent compare1 = TransformerTestUtilsV2.createNpiCareTeamMember(1, "2222222222", "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", "attending", "Attending");
assertTrue(compare1.equalsDeep(member1));
// Second member
CareTeamComponent member2 = TransformerTestUtilsV2.findCareTeamBySequence(2, eob.getCareTeam());
CareTeamComponent compare2 = TransformerTestUtilsV2.createNpiCareTeamMember(2, "3333333333", "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", "operating", "Operating");
assertTrue(compare2.equalsDeep(member2));
// Third member
CareTeamComponent member3 = TransformerTestUtilsV2.findCareTeamBySequence(3, eob.getCareTeam());
CareTeamComponent compare3 = TransformerTestUtilsV2.createNpiCareTeamMember(3, "4444444444", "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", "otheroperating", "Other Operating");
assertTrue(compare3.equalsDeep(member3));
// Fourth member
CareTeamComponent member4 = TransformerTestUtilsV2.findCareTeamBySequence(4, eob.getCareTeam());
CareTeamComponent compare4 = TransformerTestUtilsV2.createNpiCareTeamMember(4, "345345345", "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", "performing", "Performing provider");
assertTrue(compare4.equalsDeep(member4));
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 method addCareTeamPractitioner.
/**
* Ensures that the specified {@link ExplanationOfBenefit} has the specified {@link
* CareTeamComponent}, and links the specified {@link ItemComponent} to that {@link
* CareTeamComponent} (via {@link ItemComponent#addCareTeamLinkId(int)}).
*
* @param eob the {@link ExplanationOfBenefit} that the {@link CareTeamComponent} should be part
* of
* @param eobItem the {@link ItemComponent} that should be linked to the {@link CareTeamComponent}
* @param practitionerIdSystem the {@link Identifier#getSystem()} of the practitioner to reference
* in {@link CareTeamComponent#getProvider()}
* @param practitionerIdValue the {@link Identifier#getValue()} of the practitioner to reference
* in {@link CareTeamComponent#getProvider()}
* @param careTeamRole the {@link ClaimCareteamrole} to use for the {@link
* CareTeamComponent#getRole()}
* @return the {@link CareTeamComponent} that was created/linked
*/
private static CareTeamComponent addCareTeamPractitioner(ExplanationOfBenefit eob, ItemComponent eobItem, C4BBPractitionerIdentifierType type, String practitionerIdValue, String roleSystem, String roleCode, String roleDisplay) {
// Try to find a matching pre-existing entry.
CareTeamComponent careTeamEntry = eob.getCareTeam().stream().filter(ctc -> ctc.getProvider().hasIdentifier()).filter(ctc -> type.getSystem().equals(ctc.getProvider().getIdentifier().getSystem()) && practitionerIdValue.equals(ctc.getProvider().getIdentifier().getValue())).filter(ctc -> ctc.hasRole()).filter(ctc -> roleCode.equals(ctc.getRole().getCodingFirstRep().getCode()) && roleSystem.equals(ctc.getRole().getCodingFirstRep().getSystem())).findAny().orElse(null);
// <ID Value> => ExplanationOfBenefit.careTeam.provider
if (careTeamEntry == null) {
careTeamEntry = eob.addCareTeam();
// addItem adds and returns, so we want size() not size() + 1 here
careTeamEntry.setSequence(eob.getCareTeam().size());
careTeamEntry.setProvider(createPractitionerIdentifierReference(type, practitionerIdValue));
CodeableConcept careTeamRoleConcept = createCodeableConcept(roleSystem, roleCode);
careTeamRoleConcept.getCodingFirstRep().setDisplay(roleDisplay);
careTeamEntry.setRole(careTeamRoleConcept);
}
// care team entry is at eob level so no need to create item link id
if (eobItem == null) {
return careTeamEntry;
}
// ExplanationOfBenefit.careTeam.sequence => ExplanationOfBenefit.item.careTeamSequence
if (!eobItem.getCareTeamSequence().contains(new PositiveIntType(careTeamEntry.getSequence()))) {
eobItem.addCareTeamSequence(careTeamEntry.getSequence());
}
return careTeamEntry;
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent in project beneficiary-fhir-data by CMSgov.
the class HHAClaimTransformerV2Test method shouldHaveCareTeamMembers.
/**
* Testing all of these in one test, just because there isn't a distinct identifier really for
* each
*/
@Test
public void shouldHaveCareTeamMembers() {
// First member
CareTeamComponent member1 = TransformerTestUtilsV2.findCareTeamBySequence(1, eob.getCareTeam());
CareTeamComponent compare1 = TransformerTestUtilsV2.createNpiCareTeamMember(1, "2222222222", "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", "attending", "Attending");
assertTrue(compare1.equalsDeep(member1));
// Second member
CareTeamComponent member2 = TransformerTestUtilsV2.findCareTeamBySequence(2, eob.getCareTeam());
CareTeamComponent compare2 = TransformerTestUtilsV2.createNpiCareTeamMember(2, "345345345", "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", "performing", "Performing provider");
assertTrue(compare2.equalsDeep(member2));
}
Aggregations