use of org.hl7.fhir.dstu3.model.codesystems.BenefitCategory in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveBenefitBalance.
/**
* Benefit Balance
*/
@Test
public void shouldHaveBenefitBalance() {
assertEquals(1, eob.getBenefitBalance().size());
// Test Category here
CodeableConcept compare = new CodeableConcept().setCoding(Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/ex-benefitcategory", "1", "Medical Care")));
assertTrue(compare.equalsDeep(eob.getBenefitBalanceFirstRep().getCategory()));
}
use of org.hl7.fhir.dstu3.model.codesystems.BenefitCategory in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeEligibilityRequest.
protected void composeEligibilityRequest(Complex parent, String parentType, String name, EligibilityRequest element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "EligibilityRequest", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "EligibilityRequest", "identifier", element.getIdentifier().get(i), i);
if (element.hasRuleset())
composeCoding(t, "EligibilityRequest", "ruleset", element.getRuleset(), -1);
if (element.hasOriginalRuleset())
composeCoding(t, "EligibilityRequest", "originalRuleset", element.getOriginalRuleset(), -1);
if (element.hasCreatedElement())
composeDateTime(t, "EligibilityRequest", "created", element.getCreatedElement(), -1);
if (element.hasTarget())
composeType(t, "EligibilityRequest", "target", element.getTarget(), -1);
if (element.hasProvider())
composeType(t, "EligibilityRequest", "provider", element.getProvider(), -1);
if (element.hasOrganization())
composeType(t, "EligibilityRequest", "organization", element.getOrganization(), -1);
if (element.hasPriority())
composeCoding(t, "EligibilityRequest", "priority", element.getPriority(), -1);
if (element.hasEnterer())
composeType(t, "EligibilityRequest", "enterer", element.getEnterer(), -1);
if (element.hasFacility())
composeType(t, "EligibilityRequest", "facility", element.getFacility(), -1);
if (element.hasPatient())
composeType(t, "EligibilityRequest", "patient", element.getPatient(), -1);
if (element.hasCoverage())
composeType(t, "EligibilityRequest", "coverage", element.getCoverage(), -1);
if (element.hasBusinessArrangementElement())
composeString(t, "EligibilityRequest", "businessArrangement", element.getBusinessArrangementElement(), -1);
if (element.hasServiced())
composeType(t, "EligibilityRequest", "serviced", element.getServiced(), -1);
if (element.hasBenefitCategory())
composeCoding(t, "EligibilityRequest", "benefitCategory", element.getBenefitCategory(), -1);
if (element.hasBenefitSubCategory())
composeCoding(t, "EligibilityRequest", "benefitSubCategory", element.getBenefitSubCategory(), -1);
}
use of org.hl7.fhir.dstu3.model.codesystems.BenefitCategory in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method findOrAddBenefitBalance.
/**
* @param eob the {@link ExplanationOfBenefit} that the {@link BenefitComponent} should be part of
* @param benefitCategory the {@link BenefitCategory} to map to {@link
* BenefitBalanceComponent#getCategory()}
* @return the already-existing {@link BenefitBalanceComponent} that matches the specified
* parameters, or a new one
*/
private static BenefitBalanceComponent findOrAddBenefitBalance(ExplanationOfBenefit eob, BenefitCategory benefitCategory) {
Optional<BenefitBalanceComponent> matchingBenefitBalance = eob.getBenefitBalance().stream().filter(bb -> isCodeInConcept(bb.getCategory(), benefitCategory.getSystem(), benefitCategory.toCode())).findAny();
if (matchingBenefitBalance.isPresent())
return matchingBenefitBalance.get();
CodeableConcept benefitCategoryConcept = new CodeableConcept();
benefitCategoryConcept.addCoding().setSystem(benefitCategory.getSystem()).setCode(benefitCategory.toCode()).setDisplay(benefitCategory.getDisplay());
BenefitBalanceComponent newBenefitBalance = new BenefitBalanceComponent(benefitCategoryConcept);
eob.addBenefitBalance(newBenefitBalance);
return newBenefitBalance;
}
use of org.hl7.fhir.dstu3.model.codesystems.BenefitCategory in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method addBenefitBalanceFinancial.
/**
* @param eob the {@link ExplanationOfBenefit} that the {@link BenefitComponent} should be part of
* @param benefitCategory the {@link BenefitCategory} (see {@link
* BenefitBalanceComponent#getCategory()}) for the {@link BenefitBalanceComponent} that the
* new {@link BenefitComponent} should be part of
* @param financialType the {@link CcwCodebookInterface} to map to {@link
* BenefitComponent#getType()}
* @return the new {@link BenefitBalanceComponent}, which will have already been added to the
* appropriate {@link ExplanationOfBenefit#getBenefitBalance()} entry
*/
static BenefitComponent addBenefitBalanceFinancial(ExplanationOfBenefit eob, BenefitCategory benefitCategory, CcwCodebookInterface financialType) {
BenefitBalanceComponent eobPrimaryBenefitBalance = findOrAddBenefitBalance(eob, benefitCategory);
CodeableConcept financialTypeConcept = TransformerUtils.createCodeableConcept(TransformerConstants.CODING_BBAPI_BENEFIT_BALANCE_TYPE, CCWUtils.calculateVariableReferenceUrl(financialType));
financialTypeConcept.getCodingFirstRep().setDisplay(financialType.getVariable().getLabel());
BenefitComponent financialEntry = new BenefitComponent(financialTypeConcept);
eobPrimaryBenefitBalance.getFinancial().add(financialEntry);
return financialEntry;
}
use of org.hl7.fhir.dstu3.model.codesystems.BenefitCategory in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveBenefitBalance.
/**
* Benefit Balance
*/
@Test
public void shouldHaveBenefitBalance() {
assertEquals(1, eob.getBenefitBalance().size());
// Test Category here
CodeableConcept compare = new CodeableConcept().setCoding(Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/ex-benefitcategory", "1", "Medical Care")));
assertTrue(compare.equalsDeep(eob.getBenefitBalanceFirstRep().getCategory()));
}
Aggregations