use of org.hl7.fhir.r4.model.Claim.SupportingInformationComponent in project beneficiary-fhir-data by CMSgov.
the class TransformerTestUtils method assertInformationPeriodEquals.
/**
* @param expectedSystem the expected {@link Coding#getSystem()} of the {@link
* SupportingInformationComponent#getCategory()} to find and verify
* @param expectedCode the expected {@link Coding#getCoding()} of the {@link
* SupportingInformationComponent#getCategory()} to find and verify
* @param expectedFromDate the expected {@link
* SupportingInformationComponent#getTimingPeriod().getStartElement()}
* @param expectedThruDate the expected {@link
* SupportingInformationComponent#getTimingPeriod().getEndElement()}
* @param actuals the actual {@link SupportingInformationComponent}s to verify
*/
static void assertInformationPeriodEquals(String expectedSystem, String expectedCode, LocalDate expectedFromDate, LocalDate expectedThruDate, List<SupportingInformationComponent> actuals) {
Optional<SupportingInformationComponent> supportingInformationComponent = actuals.stream().filter(a -> isCodeInConcept(a.getCategory(), expectedSystem, expectedCode)).findAny();
assertTrue(supportingInformationComponent.isPresent());
try {
assertDateEquals(expectedFromDate, supportingInformationComponent.get().getTimingPeriod().getStartElement());
assertDateEquals(expectedThruDate, supportingInformationComponent.get().getTimingPeriod().getEndElement());
} catch (FHIRException e) {
throw new BadCodeMonkeyException(e);
}
}
use of org.hl7.fhir.r4.model.Claim.SupportingInformationComponent in project beneficiary-fhir-data by CMSgov.
the class TransformerTestUtils method assertInfoWithCodeEquals.
/**
* @param categoryVariable the {@link CcwCodebookVariable} matching the {@link
* SupportingInformationComponent#getCategory()} to find
* @param codeSystemVariable the {@link CcwCodebookVariable} that should have been mapped to
* {@link SupportingInformationComponent#getCode()}'s {@link Coding#getSystem()}
* @param codeValue the value that should have been mapped to {@link
* SupportingInformationComponent#getCode()}'s {@link Coding#getCode()}
* @param eob the actual {@link ExplanationOfBenefit} to search
*/
static void assertInfoWithCodeEquals(CcwCodebookVariable categoryVariable, CcwCodebookVariable codeSystemVariable, Optional<?> codeValue, ExplanationOfBenefit eob) {
SupportingInformationComponent info = assertHasInfo(categoryVariable, eob);
assertHasCoding(codeSystemVariable, codeValue, info.getCode());
}
use of org.hl7.fhir.r4.model.Claim.SupportingInformationComponent in project beneficiary-fhir-data by CMSgov.
the class TransformerTestUtils method assertCommonEobInformationInpatientSNF.
/**
* Tests EOB information fields that are common between the Inpatient and SNF claim types.
*
* @param eob the {@link ExplanationOfBenefit} that will be tested by this method
* @param noncoveredStayFromDate NCH_VRFD_NCVRD_STAY_FROM_DT: an {@link Optional}<{@link
* LocalDate}> shared field representing the non-covered stay from date for the claim
* @param noncoveredStayThroughDate NCH_VRFD_NCVRD_STAY_THRU_DT: an {@link Optional}<{@link
* LocalDate}> shared field representing the non-covered stay through date for the claim
* @param coveredCareThroughDate NCH_ACTV_OR_CVRD_LVL_CARE_THRU: an {@link Optional}<{@link
* LocalDate}> shared field representing the covered stay through date for the claim
* @param medicareBenefitsExhaustedDate NCH_BENE_MDCR_BNFTS_EXHTD_DT_I: an {@link
* Optional}<{@link LocalDate}> shared field representing the medicare benefits
* exhausted date for the claim
* @param diagnosisRelatedGroupCd CLM_DRG_CD: an {@link Optional}<{@link String}> shared
* field representing the non-covered stay from date for the claim
*/
static void assertCommonEobInformationInpatientSNF(ExplanationOfBenefit eob, Optional<LocalDate> noncoveredStayFromDate, Optional<LocalDate> noncoveredStayThroughDate, Optional<LocalDate> coveredCareThroughDate, Optional<LocalDate> medicareBenefitsExhaustedDate, Optional<String> diagnosisRelatedGroupCd) {
// noncoveredStayFromDate & noncoveredStayThroughDate
if (noncoveredStayFromDate.isPresent() || noncoveredStayThroughDate.isPresent()) {
SupportingInformationComponent nchVrfdNcvrdStayInfo = TransformerTestUtils.assertHasInfo(CcwCodebookVariable.NCH_VRFD_NCVRD_STAY_FROM_DT, eob);
TransformerTestUtils.assertPeriodEquals(noncoveredStayFromDate, noncoveredStayThroughDate, (Period) nchVrfdNcvrdStayInfo.getTiming());
}
// coveredCareThroughDate
if (coveredCareThroughDate.isPresent()) {
SupportingInformationComponent nchActvOrCvrdLvlCareThruInfo = TransformerTestUtils.assertHasInfo(CcwCodebookVariable.NCH_ACTV_OR_CVRD_LVL_CARE_THRU, eob);
TransformerTestUtils.assertDateEquals(coveredCareThroughDate.get(), (DateTimeType) nchActvOrCvrdLvlCareThruInfo.getTiming());
}
// medicareBenefitsExhaustedDate
if (medicareBenefitsExhaustedDate.isPresent()) {
SupportingInformationComponent nchBeneMdcrBnftsExhtdDtIInfo = TransformerTestUtils.assertHasInfo(CcwCodebookVariable.NCH_BENE_MDCR_BNFTS_EXHTD_DT_I, eob);
TransformerTestUtils.assertDateEquals(medicareBenefitsExhaustedDate.get(), (BaseDateTimeType) nchBeneMdcrBnftsExhtdDtIInfo.getTiming());
}
// diagnosisRelatedGroupCd
assertHasCoding(CcwCodebookVariable.CLM_DRG_CD, diagnosisRelatedGroupCd, eob.getDiagnosisFirstRep().getPackageCode());
}
use of org.hl7.fhir.r4.model.Claim.SupportingInformationComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveNchBeneMdcrBnftsExhtdDtISupInfo.
@Test
public void shouldHaveNchBeneMdcrBnftsExhtdDtISupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/nch_bene_mdcr_bnfts_exhtd_dt_i", 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/nch_bene_mdcr_bnfts_exhtd_dt_i", "NCH Beneficiary Medicare Benefits Exhausted Date"))).setTiming(new DateType("2002-01-31"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r4.model.Claim.SupportingInformationComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveAdmissionPeriodSupInfo.
@Test
public void shouldHaveAdmissionPeriodSupInfo() throws Exception {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("admissionperiod", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", "admissionperiod", "Admission Period")));
// timingPeriod
Period period = new Period();
period.setStart(new SimpleDateFormat("yyy-MM-dd").parse("2013-11-05"), TemporalPrecisionEnum.DAY);
period.setEnd(new SimpleDateFormat("yyy-MM-dd").parse("2013-12-18"), TemporalPrecisionEnum.DAY);
compare.setTiming(period);
assertTrue(compare.equalsDeep(sic));
}
Aggregations