use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformer method transform.
/**
* @param metricRegistry the {@link MetricRegistry} to use
* @param claim the CCW {@link CarrierClaim} to transform
* @param includeTaxNumbers whether or not to include tax numbers in the result (see {@link
* ExplanationOfBenefitResourceProvider#HEADER_NAME_INCLUDE_TAX_NUMBERS}, defaults to <code>
* false</code>)
* @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link
* CarrierClaim}
*/
@Trace
static ExplanationOfBenefit transform(MetricRegistry metricRegistry, Object claim, Optional<Boolean> includeTaxNumbers) {
Timer.Context timer = metricRegistry.timer(MetricRegistry.name(CarrierClaimTransformer.class.getSimpleName(), "transform")).time();
if (!(claim instanceof CarrierClaim))
throw new BadCodeMonkeyException();
ExplanationOfBenefit eob = transformClaim((CarrierClaim) claim, includeTaxNumbers);
timer.stop();
return eob;
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class FissClaimResponseTransformerV2 method transformClaim.
/**
* @param claimGroup the {@link PreAdjFissClaim} to transform
* @return a FHIR {@link ClaimResponse} resource that represents the specified {@link
* PreAdjFissClaim}
*/
private static ClaimResponse transformClaim(PreAdjFissClaim claimGroup) {
ClaimResponse claim = new ClaimResponse();
claim.setId("f-" + claimGroup.getDcn());
claim.setContained(List.of(getContainedPatient(claimGroup)));
claim.setExtension(getExtension(claimGroup));
claim.setIdentifier(getIdentifier(claimGroup));
claim.setStatus(ClaimResponse.ClaimResponseStatus.ACTIVE);
claim.setOutcome(STATUS_TO_OUTCOME.get(Character.toLowerCase(claimGroup.getCurrStatus())));
claim.setType(getType());
claim.setUse(ClaimResponse.Use.CLAIM);
claim.setInsurer(new Reference().setIdentifier(new Identifier().setValue("CMS")));
claim.setPatient(new Reference("#patient"));
claim.setRequest(new Reference(String.format("Claim/f-%s", claimGroup.getDcn())));
claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated())));
claim.setCreated(new Date());
return claim;
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerV2 method transformClaim.
/**
* @param claimGroup the {@link PreAdjFissClaim} to transform
* @return a FHIR {@link Claim} resource that represents the specified {@link PreAdjFissClaim}
*/
private static Claim transformClaim(PreAdjFissClaim claimGroup) {
Claim claim = new Claim();
boolean isIcd9 = claimGroup.getStmtCovToDate() != null && claimGroup.getStmtCovToDate().isBefore(ICD_9_CUTOFF_DATE);
claim.setId("f-" + claimGroup.getDcn());
claim.setContained(List.of(getContainedPatient(claimGroup), getContainedProvider(claimGroup)));
claim.setIdentifier(getIdentifier(claimGroup));
claim.setExtension(getExtension(claimGroup));
claim.setStatus(Claim.ClaimStatus.ACTIVE);
claim.setType(getType(claimGroup));
claim.setSupportingInfo(getSupportingInfo(claimGroup));
claim.setBillablePeriod(getBillablePeriod(claimGroup));
claim.setUse(Claim.Use.CLAIM);
claim.setPriority(getPriority());
claim.setTotal(getTotal(claimGroup));
claim.setProvider(new Reference("#provider-org"));
claim.setPatient(new Reference("#patient"));
claim.setFacility(getFacility(claimGroup));
claim.setDiagnosis(getDiagnosis(claimGroup, isIcd9));
claim.setProcedure(getProcedure(claimGroup, isIcd9));
claim.setInsurance(getInsurance(claimGroup));
claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated())));
claim.setCreated(new Date());
return claim;
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class OutpatientClaimTransformerV2Test method shouldHaveRevenueStatusCode.
/**
* Ensure that when the revenue status code exists in the claim, it should be mapped to an
* extension.
*
* <p>The specific code value of the extension is tested in {@link
* TransformerUtilsV2Test#mapEobCommonItemRevenueStatusCodeWhenStatusCodeExistsExpectExtensionOnItem()}
*/
@Test
public void shouldHaveRevenueStatusCode() {
String expectedExtensionUrl = "https://bluebutton.cms.gov/resources/variables/rev_cntr_stus_ind_cd";
assertNotNull(eob.getItem());
assertTrue(eob.getItem().size() > 0);
ExplanationOfBenefit.ItemComponent item = eob.getItem().get(0);
assertNotNull(item);
assertNotNull(item.getRevenue());
assertNotNull(item.getRevenue().getExtension());
assertEquals(1, item.getRevenue().getExtension().size());
Extension ext = item.getRevenue().getExtensionByUrl(expectedExtensionUrl);
assertNotNull(ext);
assertEquals(expectedExtensionUrl, ext.getUrl());
assertTrue(ext.getValue() instanceof Coding);
assertNotNull(((Coding) ext.getValue()).getCode());
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class OutpatientClaimTransformerV2Test method generateClaim.
/**
* Generates the Claim object to be used in multiple tests
*
* @return
* @throws FHIRException
*/
public OutpatientClaim generateClaim() throws FHIRException {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
OutpatientClaim claim = parsedRecords.stream().filter(r -> r instanceof OutpatientClaim).map(r -> (OutpatientClaim) r).findFirst().get();
claim.setLastUpdated(Instant.now());
return claim;
}
Aggregations