Search in sources :

Example 36 with Coverage

use of org.hl7.fhir.r4.model.Coverage in project elexis-server by elexis.

the class CoverageTest method getCoverage.

@Test
public void getCoverage() {
    Patient readPatient = client.read().resource(Patient.class).withId(AllTests.getTestDatabaseInitializer().getPatient().getId()).execute();
    // search by BENEFICIARY
    Bundle results = client.search().forResource(Coverage.class).where(Coverage.BENEFICIARY.hasId(readPatient.getId())).returnBundle(Bundle.class).execute();
    assertNotNull(results);
    List<BundleEntryComponent> entries = results.getEntry();
    assertFalse(entries.isEmpty());
    Coverage coverage = (Coverage) entries.get(0).getResource();
    // read with by id
    Coverage readCoverage = client.read().resource(Coverage.class).withId(coverage.getId()).execute();
    assertNotNull(readCoverage);
    assertEquals(coverage.getId(), readCoverage.getId());
}
Also used : BundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent) Bundle(org.hl7.fhir.r4.model.Bundle) Patient(org.hl7.fhir.r4.model.Patient) Coverage(org.hl7.fhir.r4.model.Coverage) ICoverage(ch.elexis.core.model.ICoverage) Test(org.junit.Test)

Example 37 with Coverage

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

the class RdfParser method composeEnrollmentRequest.

protected void composeEnrollmentRequest(Complex parent, String parentType, String name, EnrollmentRequest element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "EnrollmentRequest", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "EnrollmentRequest", "identifier", element.getIdentifier().get(i), i);
    if (element.hasRuleset())
        composeCoding(t, "EnrollmentRequest", "ruleset", element.getRuleset(), -1);
    if (element.hasOriginalRuleset())
        composeCoding(t, "EnrollmentRequest", "originalRuleset", element.getOriginalRuleset(), -1);
    if (element.hasCreatedElement())
        composeDateTime(t, "EnrollmentRequest", "created", element.getCreatedElement(), -1);
    if (element.hasTarget())
        composeReference(t, "EnrollmentRequest", "target", element.getTarget(), -1);
    if (element.hasProvider())
        composeReference(t, "EnrollmentRequest", "provider", element.getProvider(), -1);
    if (element.hasOrganization())
        composeReference(t, "EnrollmentRequest", "organization", element.getOrganization(), -1);
    if (element.hasSubject())
        composeReference(t, "EnrollmentRequest", "subject", element.getSubject(), -1);
    if (element.hasCoverage())
        composeReference(t, "EnrollmentRequest", "coverage", element.getCoverage(), -1);
    if (element.hasRelationship())
        composeCoding(t, "EnrollmentRequest", "relationship", element.getRelationship(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 38 with Coverage

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

the class RdfParser method composeClaimResponseCoverageComponent.

protected void composeClaimResponseCoverageComponent(Complex parent, String parentType, String name, ClaimResponse.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.hasSequenceElement())
        composePositiveInt(t, "ClaimResponse", "sequence", element.getSequenceElement(), -1);
    if (element.hasFocalElement())
        composeBoolean(t, "ClaimResponse", "focal", element.getFocalElement(), -1);
    if (element.hasCoverage())
        composeType(t, "ClaimResponse", "coverage", element.getCoverage(), -1);
    if (element.hasBusinessArrangementElement())
        composeString(t, "ClaimResponse", "businessArrangement", element.getBusinessArrangementElement(), -1);
    for (int i = 0; i < element.getPreAuthRef().size(); i++) composeString(t, "ClaimResponse", "preAuthRef", element.getPreAuthRef().get(i), i);
    if (element.hasClaimResponse())
        composeReference(t, "ClaimResponse", "claimResponse", element.getClaimResponse(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 39 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);
    if (element.hasIssuer())
        composeType(t, "Coverage", "issuer", element.getIssuer(), -1);
    if (element.hasBinElement())
        composeString(t, "Coverage", "bin", element.getBinElement(), -1);
    if (element.hasPeriod())
        composePeriod(t, "Coverage", "period", element.getPeriod(), -1);
    if (element.hasType())
        composeCoding(t, "Coverage", "type", element.getType(), -1);
    if (element.hasPlanholder())
        composeType(t, "Coverage", "planholder", element.getPlanholder(), -1);
    if (element.hasBeneficiary())
        composeType(t, "Coverage", "beneficiary", element.getBeneficiary(), -1);
    if (element.hasRelationship())
        composeCoding(t, "Coverage", "relationship", element.getRelationship(), -1);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Coverage", "identifier", element.getIdentifier().get(i), i);
    if (element.hasGroupElement())
        composeString(t, "Coverage", "group", element.getGroupElement(), -1);
    if (element.hasPlanElement())
        composeString(t, "Coverage", "plan", element.getPlanElement(), -1);
    if (element.hasSubPlanElement())
        composeString(t, "Coverage", "subPlan", element.getSubPlanElement(), -1);
    if (element.hasDependentElement())
        composePositiveInt(t, "Coverage", "dependent", element.getDependentElement(), -1);
    if (element.hasSequenceElement())
        composePositiveInt(t, "Coverage", "sequence", element.getSequenceElement(), -1);
    for (int i = 0; i < element.getException().size(); i++) composeCoding(t, "Coverage", "exception", element.getException().get(i), i);
    if (element.hasSchoolElement())
        composeString(t, "Coverage", "school", element.getSchoolElement(), -1);
    if (element.hasNetworkElement())
        composeString(t, "Coverage", "network", element.getNetworkElement(), -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.dstu2016may.formats.RdfGenerator.Complex)

Example 40 with Coverage

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

the class RdfParser method composeAccount.

protected void composeAccount(Complex parent, String parentType, String name, Account element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Account", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Account", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "Account", "status", element.getStatusElement(), -1);
    if (element.hasType())
        composeCodeableConcept(t, "Account", "type", element.getType(), -1);
    if (element.hasNameElement())
        composeString(t, "Account", "name", element.getNameElement(), -1);
    if (element.hasSubject())
        composeReference(t, "Account", "subject", element.getSubject(), -1);
    if (element.hasPeriod())
        composePeriod(t, "Account", "period", element.getPeriod(), -1);
    if (element.hasActive())
        composePeriod(t, "Account", "active", element.getActive(), -1);
    if (element.hasBalance())
        composeMoney(t, "Account", "balance", element.getBalance(), -1);
    for (int i = 0; i < element.getCoverage().size(); i++) composeAccountCoverageComponent(t, "Account", "coverage", element.getCoverage().get(i), i);
    if (element.hasOwner())
        composeReference(t, "Account", "owner", element.getOwner(), -1);
    if (element.hasDescriptionElement())
        composeString(t, "Account", "description", element.getDescriptionElement(), -1);
    for (int i = 0; i < element.getGuarantor().size(); i++) composeAccountGuarantorComponent(t, "Account", "guarantor", element.getGuarantor().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.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