use of org.hl7.fhir.dstu2016may.model.Resource 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.dstu2016may.model.Resource in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerV2 method getContainedProvider.
private static Resource getContainedProvider(PreAdjFissClaim claimGroup) {
Organization organization = new Organization();
if (claimGroup.getMedaProv_6() != null) {
organization.getIdentifier().add(new Identifier().setType(new CodeableConcept(new Coding(C4BBOrganizationIdentifierType.PRN.getSystem(), C4BBOrganizationIdentifierType.PRN.toCode(), C4BBOrganizationIdentifierType.PRN.getDisplay()))).setSystem(BBCodingSystems.PROVIDER_NUM).setValue(claimGroup.getMedaProv_6()));
}
if (claimGroup.getFedTaxNumber() != null) {
organization.getIdentifier().add(new Identifier().setType(new CodeableConcept(new Coding(C4BBOrganizationIdentifierType.TAX.getSystem(), C4BBOrganizationIdentifierType.TAX.toCode(), C4BBOrganizationIdentifierType.TAX.getDisplay()))).setSystem(BBCodingSystems.FISS.TAX_NUM).setValue(claimGroup.getFedTaxNumber()));
}
if (claimGroup.getNpiNumber() != null) {
organization.getIdentifier().add(new Identifier().setType(new CodeableConcept(new Coding(C4BBIdentifierType.NPI.getSystem(), C4BBIdentifierType.NPI.toCode(), C4BBIdentifierType.NPI.getDisplay()))).setSystem(TransformerConstants.CODING_NPI_US).setValue(claimGroup.getNpiNumber()));
}
organization.setId("provider-org");
return organization;
}
use of org.hl7.fhir.dstu2016may.model.Resource 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.dstu2016may.model.Resource in project beneficiary-fhir-data by CMSgov.
the class McsClaimTransformerV2 method getContainedProvider.
private static Resource getContainedProvider(PreAdjMcsClaim claimGroup) {
Organization organization = new Organization();
if (claimGroup.getIdrBillProvType() != null) {
organization.getExtension().add(new Extension(BBCodingSystems.MCS.BILL_PROV_TYPE).setValue(new Coding(BBCodingSystems.MCS.BILL_PROV_TYPE, claimGroup.getIdrBillProvType(), null)));
}
if (claimGroup.getIdrBillProvSpec() != null) {
organization.getExtension().add(new Extension(BBCodingSystems.MCS.BILL_PROV_SPEC).setValue(new Coding(BBCodingSystems.MCS.BILL_PROV_SPEC, claimGroup.getIdrBillProvSpec(), null)));
}
if (claimGroup.getIdrBillProvEin() != null) {
organization.getIdentifier().add(new Identifier().setType(new CodeableConcept(new Coding(C4BBOrganizationIdentifierType.TAX.getSystem(), C4BBOrganizationIdentifierType.TAX.toCode(), C4BBOrganizationIdentifierType.TAX.getDisplay()))).setSystem(BBCodingSystems.MCS.BILL_PROV_EIN).setValue(claimGroup.getIdrBillProvEin()));
}
if (claimGroup.getIdrBillProvNum() != null) {
organization.getIdentifier().add(new Identifier().setType(new CodeableConcept(new Coding(C4BBIdentifierType.NPI.getSystem(), C4BBIdentifierType.NPI.toCode(), C4BBIdentifierType.NPI.getDisplay()))).setSystem(TransformerConstants.CODING_NPI_US).setValue(claimGroup.getIdrBillProvNpi()));
}
organization.setId("provider-org");
return organization;
}
use of org.hl7.fhir.dstu2016may.model.Resource in project beneficiary-fhir-data by CMSgov.
the class HHAClaimTransformerV2Test method shouldHaveLineItemRevenue.
@Test
public void shouldHaveLineItemRevenue() {
CodeableConcept revenue = eob.getItemFirstRep().getRevenue();
Coding code1 = revenue.getCoding().stream().filter(coding -> coding.getSystem().equals("https://bluebutton.cms.gov/resources/variables/rev_cntr")).findFirst().orElse(null);
Coding code2 = revenue.getCoding().stream().filter(coding -> coding.getSystem().equals("https://www.nubc.org/CodeSystem/RevenueCodes")).findFirst().orElse(null);
Coding code3 = revenue.getCoding().stream().filter(coding -> coding.getSystem().equals("https://bluebutton.cms.gov/resources/variables/rev_cntr_ddctbl_coinsrnc_cd")).findFirst().orElse(null);
assertNotNull(code1, "Missing expected rev_cntr coding");
assertEquals("0023", code1.getCode());
assertEquals("Home Health services paid under PPS submitted as TOB 32X and 33X, effective 10/00. This code may appear multiple times on a claim to identify different HIPPS/Home Health Resource Groups (HRG).", code1.getDisplay());
assertNotNull(code2, "Missing expected RevenueCodes coding");
assertEquals("4", code2.getCode());
assertNull(code2.getDisplay());
assertNotNull(code3, "Missing expected rev_cntr_ddctbl_coinsrnc_cd coding");
assertEquals("4", code3.getCode());
assertEquals("No charge or units associated with this revenue center code. (For multiple HCPCS per single revenue center code) For revenue center code 0001, the following MSP override values may be present:", code3.getDisplay());
}
Aggregations