Search in sources :

Example 51 with Coverage

use of org.hl7.fhir.r4.model.Coverage in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCoverage.

protected void composeCoverage(Complex parent, String parentType, String name, Coverage element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Coverage", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Coverage", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "Coverage", "status", element.getStatusElement(), -1);
    if (element.hasType())
        composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
    if (element.hasPolicyHolder())
        composeReference(t, "Coverage", "policyHolder", element.getPolicyHolder(), -1);
    if (element.hasSubscriber())
        composeReference(t, "Coverage", "subscriber", element.getSubscriber(), -1);
    if (element.hasSubscriberIdElement())
        composeString(t, "Coverage", "subscriberId", element.getSubscriberIdElement(), -1);
    if (element.hasBeneficiary())
        composeReference(t, "Coverage", "beneficiary", element.getBeneficiary(), -1);
    if (element.hasDependentElement())
        composeString(t, "Coverage", "dependent", element.getDependentElement(), -1);
    if (element.hasRelationship())
        composeCodeableConcept(t, "Coverage", "relationship", element.getRelationship(), -1);
    if (element.hasPeriod())
        composePeriod(t, "Coverage", "period", element.getPeriod(), -1);
    for (int i = 0; i < element.getPayor().size(); i++) composeReference(t, "Coverage", "payor", element.getPayor().get(i), i);
    for (int i = 0; i < element.getClass_().size(); i++) composeCoverageClassComponent(t, "Coverage", "class", element.getClass_().get(i), i);
    if (element.hasOrderElement())
        composePositiveInt(t, "Coverage", "order", element.getOrderElement(), -1);
    if (element.hasNetworkElement())
        composeString(t, "Coverage", "network", element.getNetworkElement(), -1);
    for (int i = 0; i < element.getCostToBeneficiary().size(); i++) composeCoverageCostToBeneficiaryComponent(t, "Coverage", "costToBeneficiary", element.getCostToBeneficiary().get(i), i);
    if (element.hasSubrogationElement())
        composeBoolean(t, "Coverage", "subrogation", element.getSubrogationElement(), -1);
    for (int i = 0; i < element.getContract().size(); i++) composeReference(t, "Coverage", "contract", element.getContract().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 52 with Coverage

use of org.hl7.fhir.r4.model.Coverage in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeAccountCoverageComponent.

protected void composeAccountCoverageComponent(Complex parent, String parentType, String name, Account.CoverageComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "coverage", name, element, index);
    if (element.hasCoverage())
        composeReference(t, "Account", "coverage", element.getCoverage(), -1);
    if (element.hasPriorityElement())
        composePositiveInt(t, "Account", "priority", element.getPriorityElement(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 53 with Coverage

use of org.hl7.fhir.r4.model.Coverage in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeExplanationOfBenefitInsuranceComponent.

protected void composeExplanationOfBenefitInsuranceComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.InsuranceComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "insurance", name, element, index);
    if (element.hasFocalElement())
        composeBoolean(t, "ExplanationOfBenefit", "focal", element.getFocalElement(), -1);
    if (element.hasCoverage())
        composeReference(t, "ExplanationOfBenefit", "coverage", element.getCoverage(), -1);
    for (int i = 0; i < element.getPreAuthRef().size(); i++) composeString(t, "ExplanationOfBenefit", "preAuthRef", element.getPreAuthRef().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 54 with Coverage

use of org.hl7.fhir.r4.model.Coverage in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCoverageClassComponent.

protected void composeCoverageClassComponent(Complex parent, String parentType, String name, Coverage.ClassComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "class", name, element, index);
    if (element.hasType())
        composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
    if (element.hasValueElement())
        composeString(t, "Coverage", "value", element.getValueElement(), -1);
    if (element.hasNameElement())
        composeString(t, "Coverage", "name", element.getNameElement(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 55 with Coverage

use of org.hl7.fhir.r4.model.Coverage in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeInsurancePlanInsurancePlanCoverageComponent.

protected void composeInsurancePlanInsurancePlanCoverageComponent(Complex parent, String parentType, String name, InsurancePlan.InsurancePlanCoverageComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "coverage", name, element, index);
    if (element.hasType())
        composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
    for (int i = 0; i < element.getNetwork().size(); i++) composeReference(t, "InsurancePlan", "network", element.getNetwork().get(i), i);
    for (int i = 0; i < element.getBenefit().size(); i++) composeInsurancePlanCoverageBenefitComponent(t, "InsurancePlan", "benefit", element.getBenefit().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Aggregations

Test (org.junit.jupiter.api.Test)34 Coverage (org.hl7.fhir.r4.model.Coverage)31 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)17 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)16 MedicareSegment (gov.cms.bfd.server.war.commons.MedicareSegment)15 Coverage (org.hl7.fhir.dstu3.model.Coverage)15 List (java.util.List)14 Reference (org.hl7.fhir.r4.model.Reference)14 Resource (org.hl7.fhir.r4.model.Resource)14 TransformerConstants (gov.cms.bfd.server.war.commons.TransformerConstants)13 Arrays (java.util.Arrays)13 Instant (java.time.Instant)12 Bundle (org.hl7.fhir.r4.model.Bundle)12 Logger (org.slf4j.Logger)12 LoggerFactory (org.slf4j.LoggerFactory)12 Date (java.util.Date)11 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)11 Constants (ca.uhn.fhir.rest.api.Constants)10 Timer (com.codahale.metrics.Timer)10 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)10