Search in sources :

Example 61 with Organization

use of org.hl7.fhir.r4.model.Organization 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);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 62 with Organization

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

the class RdfParser method composePaymentNotice.

protected void composePaymentNotice(Complex parent, String parentType, String name, PaymentNotice element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "PaymentNotice", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "PaymentNotice", "identifier", element.getIdentifier().get(i), i);
    if (element.hasRuleset())
        composeCoding(t, "PaymentNotice", "ruleset", element.getRuleset(), -1);
    if (element.hasOriginalRuleset())
        composeCoding(t, "PaymentNotice", "originalRuleset", element.getOriginalRuleset(), -1);
    if (element.hasCreatedElement())
        composeDateTime(t, "PaymentNotice", "created", element.getCreatedElement(), -1);
    if (element.hasTarget())
        composeType(t, "PaymentNotice", "target", element.getTarget(), -1);
    if (element.hasProvider())
        composeType(t, "PaymentNotice", "provider", element.getProvider(), -1);
    if (element.hasOrganization())
        composeType(t, "PaymentNotice", "organization", element.getOrganization(), -1);
    if (element.hasRequest())
        composeType(t, "PaymentNotice", "request", element.getRequest(), -1);
    if (element.hasResponse())
        composeType(t, "PaymentNotice", "response", element.getResponse(), -1);
    if (element.hasPaymentStatus())
        composeCoding(t, "PaymentNotice", "paymentStatus", element.getPaymentStatus(), -1);
    if (element.hasStatusDateElement())
        composeDate(t, "PaymentNotice", "statusDate", element.getStatusDateElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 63 with Organization

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

the class ProfileUtilitiesTests method testSlicingTask8742.

private void testSlicingTask8742() throws EOperationOutcome, Exception {
    StructureDefinition focus = new StructureDefinition();
    StructureDefinition base = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/Organization").copy();
    focus.setUrl(Utilities.makeUuidUrn());
    focus.setBaseDefinition(base.getUrl());
    focus.setType(base.getType());
    focus.setDerivation(TypeDerivationRule.CONSTRAINT);
    ElementDefinition id = focus.getDifferential().addElement();
    id.setPath("Organization.address");
    id.setMin(1);
    id.setMax("1");
    id.setMustSupport(true);
    id = focus.getDifferential().addElement();
    id.setPath("Organization.address.extension");
    id.setSliceName("USLabCountycodes");
    id.getSlicing().setOrdered(false).setRules(SlicingRules.OPEN).addDiscriminator().setPath("url").setType(DiscriminatorType.VALUE);
    id.setShort("County/Parish FIPS codes");
    id.setDefinition("County/Parish FIPS codes.");
    id.setRequirements("County/Parish Code SHALL use FIPS 6-4  ( INCITS 31:2009).");
    id.setMin(0);
    id.setMax("1");
    id.addType().setCode("Extension").setProfile("http://hl7.org/fhir/StructureDefinition/us-core-county");
    id.setMustSupport(true);
    id.getBinding().setStrength(BindingStrength.REQUIRED).setDescription("FIPS codes for US counties and county equivalent entities.").setValueSet(new Reference().setReference("http://hl7.org/fhir/ValueSet/fips-county"));
    List<ValidationMessage> messages = new ArrayList<ValidationMessage>();
    new ProfileUtilities(context, messages, null).generateSnapshot(base, focus, focus.getUrl(), "Simple Test");
    // 14 for address with one sliced extension
    boolean ok = base.getSnapshot().getElement().size() == focus.getSnapshot().getElement().size() - 13;
    if (!ok) {
        compareXml(base, focus);
        throw new FHIRException("Snap shot generation test 8742 failed");
    } else
        System.out.println("Snap shot generation test 8742 passed");
}
Also used : StructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition) ValidationMessage(org.hl7.fhir.utilities.validation.ValidationMessage) ProfileUtilities(org.hl7.fhir.dstu3.conformance.ProfileUtilities) Reference(org.hl7.fhir.dstu3.model.Reference) ArrayList(java.util.ArrayList) ElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition) FHIRException(org.hl7.fhir.exceptions.FHIRException)

Example 64 with Organization

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

the class TurtleTests method test_organization_example_f003_burgers_ENT.

@Test
public void test_organization_example_f003_burgers_ENT() throws FileNotFoundException, IOException, Exception {
    System.out.println("organization-example-f003-burgers-ENT.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\organization-example-f003-burgers-ENT.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 65 with Organization

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

the class RdfParser method composeConsent.

protected void composeConsent(Complex parent, String parentType, String name, Consent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Consent", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Consent", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "Consent", "status", element.getStatusElement(), -1);
    if (element.hasScope())
        composeCodeableConcept(t, "Consent", "scope", element.getScope(), -1);
    for (int i = 0; i < element.getCategory().size(); i++) composeCodeableConcept(t, "Consent", "category", element.getCategory().get(i), i);
    if (element.hasPatient())
        composeReference(t, "Consent", "patient", element.getPatient(), -1);
    if (element.hasDateTimeElement())
        composeDateTime(t, "Consent", "dateTime", element.getDateTimeElement(), -1);
    for (int i = 0; i < element.getPerformer().size(); i++) composeReference(t, "Consent", "performer", element.getPerformer().get(i), i);
    for (int i = 0; i < element.getOrganization().size(); i++) composeReference(t, "Consent", "organization", element.getOrganization().get(i), i);
    if (element.hasSource())
        composeType(t, "Consent", "source", element.getSource(), -1);
    for (int i = 0; i < element.getPolicy().size(); i++) composeConsentConsentPolicyComponent(t, "Consent", "policy", element.getPolicy().get(i), i);
    if (element.hasPolicyRule())
        composeCodeableConcept(t, "Consent", "policyRule", element.getPolicyRule(), -1);
    for (int i = 0; i < element.getVerification().size(); i++) composeConsentConsentVerificationComponent(t, "Consent", "verification", element.getVerification().get(i), i);
    if (element.hasProvision())
        composeConsentprovisionComponent(t, "Consent", "provision", element.getProvision(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Aggregations

Test (org.junit.jupiter.api.Test)101 Organization (org.hl7.fhir.dstu3.model.Organization)90 Organization (org.hl7.fhir.r4.model.Organization)69 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)41 Resource (org.hl7.fhir.r4.model.Resource)38 ArrayList (java.util.ArrayList)34 List (java.util.List)33 Reference (org.hl7.fhir.r4.model.Reference)33 Identifier (org.hl7.fhir.r4.model.Identifier)30 Bundle (org.hl7.fhir.dstu3.model.Bundle)27 UUID (java.util.UUID)26 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)25 Patient (org.hl7.fhir.r4.model.Patient)25 IdType (org.hl7.fhir.dstu3.model.IdType)24 Bundle (org.hl7.fhir.r4.model.Bundle)24 Coding (org.hl7.fhir.r4.model.Coding)24 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)19 ContactPoint (org.hl7.fhir.r4.model.ContactPoint)17 Reference (org.hl7.fhir.dstu3.model.Reference)16 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)16