Search in sources :

Example 56 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.setBase(base.getUrl());
    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.setName("USLabCountycodes");
    id.getSlicing().setOrdered(false).setRules(SlicingRules.OPEN).addDiscriminator("url");
    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").addProfile("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.dstu2.model.StructureDefinition) ValidationMessage(org.hl7.fhir.utilities.validation.ValidationMessage) ProfileUtilities(org.hl7.fhir.dstu2.utils.ProfileUtilities) Reference(org.hl7.fhir.dstu2.model.Reference) ArrayList(java.util.ArrayList) ElementDefinition(org.hl7.fhir.dstu2.model.ElementDefinition) FHIRException(org.hl7.fhir.exceptions.FHIRException)

Example 57 with Organization

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

the class ClaimResponse method setProperty.

@Override
public void setProperty(String name, Base value) throws FHIRException {
    if (name.equals("identifier"))
        this.getIdentifier().add(castToIdentifier(value));
    else if (name.equals("request[x]"))
        // Type
        this.request = (Type) value;
    else if (name.equals("ruleset"))
        // Coding
        this.ruleset = castToCoding(value);
    else if (name.equals("originalRuleset"))
        // Coding
        this.originalRuleset = castToCoding(value);
    else if (name.equals("created"))
        // DateTimeType
        this.created = castToDateTime(value);
    else if (name.equals("organization[x]"))
        // Type
        this.organization = (Type) value;
    else if (name.equals("requestProvider[x]"))
        // Type
        this.requestProvider = (Type) value;
    else if (name.equals("requestOrganization[x]"))
        // Type
        this.requestOrganization = (Type) value;
    else if (name.equals("outcome"))
        // Enumeration<RemittanceOutcome>
        this.outcome = new RemittanceOutcomeEnumFactory().fromType(value);
    else if (name.equals("disposition"))
        // StringType
        this.disposition = castToString(value);
    else if (name.equals("payeeType"))
        // Coding
        this.payeeType = castToCoding(value);
    else if (name.equals("item"))
        this.getItem().add((ItemsComponent) value);
    else if (name.equals("addItem"))
        this.getAddItem().add((AddedItemComponent) value);
    else if (name.equals("error"))
        this.getError().add((ErrorsComponent) value);
    else if (name.equals("totalCost"))
        // Money
        this.totalCost = castToMoney(value);
    else if (name.equals("unallocDeductable"))
        // Money
        this.unallocDeductable = castToMoney(value);
    else if (name.equals("totalBenefit"))
        // Money
        this.totalBenefit = castToMoney(value);
    else if (name.equals("paymentAdjustment"))
        // Money
        this.paymentAdjustment = castToMoney(value);
    else if (name.equals("paymentAdjustmentReason"))
        // Coding
        this.paymentAdjustmentReason = castToCoding(value);
    else if (name.equals("paymentDate"))
        // DateType
        this.paymentDate = castToDate(value);
    else if (name.equals("paymentAmount"))
        // Money
        this.paymentAmount = castToMoney(value);
    else if (name.equals("paymentRef"))
        // Identifier
        this.paymentRef = castToIdentifier(value);
    else if (name.equals("reserved"))
        // Coding
        this.reserved = castToCoding(value);
    else if (name.equals("form"))
        // Coding
        this.form = castToCoding(value);
    else if (name.equals("note"))
        this.getNote().add((NotesComponent) value);
    else if (name.equals("coverage"))
        this.getCoverage().add((CoverageComponent) value);
    else
        super.setProperty(name, value);
}
Also used : RemittanceOutcomeEnumFactory(org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory)

Example 58 with Organization

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

the class RdfParser method composePatientContactComponent.

protected void composePatientContactComponent(Complex parent, String parentType, String name, Patient.ContactComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "contact", name, element, index);
    for (int i = 0; i < element.getRelationship().size(); i++) composeCodeableConcept(t, "Patient", "relationship", element.getRelationship().get(i), i);
    if (element.hasName())
        composeHumanName(t, "Patient", "name", element.getName(), -1);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Patient", "telecom", element.getTelecom().get(i), i);
    if (element.hasAddress())
        composeAddress(t, "Patient", "address", element.getAddress(), -1);
    if (element.hasGenderElement())
        composeEnum(t, "Patient", "gender", element.getGenderElement(), -1);
    if (element.hasOrganization())
        composeReference(t, "Patient", "organization", element.getOrganization(), -1);
    if (element.hasPeriod())
        composePeriod(t, "Patient", "period", element.getPeriod(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 59 with Organization

use of org.hl7.fhir.r4.model.Organization 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.hasStatusElement())
        composeEnum(t, "EnrollmentRequest", "status", element.getStatusElement(), -1);
    if (element.hasCreatedElement())
        composeDateTime(t, "EnrollmentRequest", "created", element.getCreatedElement(), -1);
    if (element.hasInsurer())
        composeReference(t, "EnrollmentRequest", "insurer", element.getInsurer(), -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);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 60 with Organization

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

the class ExplanationOfBenefit method setProperty.

@Override
public void setProperty(String name, Base value) throws FHIRException {
    if (name.equals("identifier"))
        this.getIdentifier().add(castToIdentifier(value));
    else if (name.equals("request"))
        // Reference
        this.request = castToReference(value);
    else if (name.equals("outcome"))
        // Enumeration<RemittanceOutcome>
        this.outcome = new RemittanceOutcomeEnumFactory().fromType(value);
    else if (name.equals("disposition"))
        // StringType
        this.disposition = castToString(value);
    else if (name.equals("ruleset"))
        // Coding
        this.ruleset = castToCoding(value);
    else if (name.equals("originalRuleset"))
        // Coding
        this.originalRuleset = castToCoding(value);
    else if (name.equals("created"))
        // DateTimeType
        this.created = castToDateTime(value);
    else if (name.equals("organization"))
        // Reference
        this.organization = castToReference(value);
    else if (name.equals("requestProvider"))
        // Reference
        this.requestProvider = castToReference(value);
    else if (name.equals("requestOrganization"))
        // Reference
        this.requestOrganization = castToReference(value);
    else
        super.setProperty(name, value);
}
Also used : RemittanceOutcomeEnumFactory(org.hl7.fhir.dstu2.model.Enumerations.RemittanceOutcomeEnumFactory)

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