Search in sources :

Example 96 with Claim

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

the class OutpatientClaimTransformerTest method transformAllSyntheticRecords.

/**
 * Verifies that {@link
 * gov.cms.bfd.server.war.stu3.providers.OutpatientClaimTransformer#transform(Object)} works as
 * expected when run against all synthetic data outpatient claims
 *
 * <p>Note: This test is normally disabled like other synthetic data tests. It will take 20
 * minutes or more to run.
 *
 * @throws FHIRException (indicates test failure)
 */
@Disabled
@Test
public void transformAllSyntheticRecords() throws FHIRException {
    List<StaticRifResource> outpatientSyntheticFiles = Arrays.asList(StaticRifResourceGroup.SYNTHETIC_DATA.getResources()).stream().filter(r -> r.getRifFileType().equals(RifFileType.OUTPATIENT)).collect(Collectors.toList());
    List<Object> parsedRecords = ServerTestUtils.parseData(outpatientSyntheticFiles);
    parsedRecords.stream().filter(r -> r instanceof OutpatientClaim).map(r -> (OutpatientClaim) r).forEach(claim -> {
        LOGGER.info("Running at Bene-Id: {}, Claim-Id: {}", claim.getBeneficiaryId(), claim.getClaimId());
        ExplanationOfBenefit eob = OutpatientClaimTransformer.transform(new MetricRegistry(), claim, Optional.empty());
        assertMatches(claim, eob);
    });
}
Also used : IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) RifFileType(gov.cms.bfd.model.rif.RifFileType) StaticRifResource(gov.cms.bfd.model.rif.samples.StaticRifResource) LoggerFactory(org.slf4j.LoggerFactory) Disabled(org.junit.jupiter.api.Disabled) OutpatientClaimLine(gov.cms.bfd.model.rif.OutpatientClaimLine) CcwCodebookVariable(gov.cms.bfd.model.codebook.data.CcwCodebookVariable) CCWProcedure(gov.cms.bfd.server.war.commons.CCWProcedure) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) StaticRifResourceGroup(gov.cms.bfd.model.rif.samples.StaticRifResourceGroup) ServerTestUtils(gov.cms.bfd.server.war.ServerTestUtils) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) MetricRegistry(com.codahale.metrics.MetricRegistry) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) MedicareSegment(gov.cms.bfd.server.war.commons.MedicareSegment) ItemComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent) Collectors(java.util.stream.Collectors) ZoneId(java.time.ZoneId) Test(org.junit.jupiter.api.Test) List(java.util.List) Stream(java.util.stream.Stream) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) FHIRException(org.hl7.fhir.exceptions.FHIRException) StaticRifResource(gov.cms.bfd.model.rif.samples.StaticRifResource) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) MetricRegistry(com.codahale.metrics.MetricRegistry) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 97 with Claim

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

the class SNFClaimTransformerV2Test method shouldHaveClmIpAdmsnTypeCdSupInfo.

@Test
public void shouldHaveClmIpAdmsnTypeCdSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_ip_admsn_type_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/clm_ip_admsn_type_cd", "Claim Inpatient Admission Type Code")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/clm_ip_admsn_type_cd", "3", "Elective - The patient's condition permitted adequate time to schedule the availability of suitable accommodations."));
    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 98 with Claim

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

the class SNFClaimTransformerV2Test method shouldHaveClmSrcIpAdmsnCdSupInfo.

@Test
public void shouldHaveClmSrcIpAdmsnCdSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_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/clm_src_ip_admsn_cd", "Claim Source Inpatient Admission Code")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", "4", null));
    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 99 with Claim

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

the class SNFClaimTransformerV2Test method shouldHaveClmMcoPdSwSupInfo.

@Test
public void shouldHaveClmMcoPdSwSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_mco_pd_sw", 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/clm_mco_pd_sw", "Claim MCO Paid Switch")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/clm_mco_pd_sw", "0", "No managed care organization (MCO) payment"));
    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 100 with Claim

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

the class SNFClaimTransformerV2Test method shouldHaveClmDrgCdSupInfo.

@Test
public void shouldHaveClmDrgCdSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_drg_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/clm_drg_cd", "Claim Diagnosis Related Group Code (or MS-DRG Code)")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/clm_drg_cd", "645", null));
    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)

Aggregations

Test (org.junit.jupiter.api.Test)149 Coding (org.hl7.fhir.r4.model.Coding)92 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)62 Money (org.hl7.fhir.r4.model.Money)61 BenefitComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent)56 Optional (java.util.Optional)50 Arrays (java.util.Arrays)49 List (java.util.List)49 ExplanationOfBenefit (org.hl7.fhir.r4.model.ExplanationOfBenefit)49 FHIRException (org.hl7.fhir.exceptions.FHIRException)48 SupportingInformationComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent)48 ExplanationOfBenefit (org.hl7.fhir.dstu3.model.ExplanationOfBenefit)47 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)47 StaticRifResourceGroup (gov.cms.bfd.model.rif.samples.StaticRifResourceGroup)45 ServerTestUtils (gov.cms.bfd.server.war.ServerTestUtils)45 TransformerConstants (gov.cms.bfd.server.war.commons.TransformerConstants)41 Instant (java.time.Instant)40 ArrayList (java.util.ArrayList)39 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)37 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)37