Search in sources :

Example 11 with Enumeration

use of org.hl7.fhir.dstu2.model.Enumeration in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeEnum.

private void composeEnum(Complex parent, String parentType, String name, Enumeration<? extends Enum> value, int index) {
    if (value == null)
        return;
    Complex t = parent.predicate("fhir:" + parentType + "." + name);
    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
    composeElement(t, parentType, name, value, index);
    decorateCode(t, value);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 12 with Enumeration

use of org.hl7.fhir.dstu2.model.Enumeration in project org.hl7.fhir.core by hapifhir.

the class ImplementationGuide30_50 method convertImplementationGuide.

public static org.hl7.fhir.dstu3.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r5.model.ImplementationGuide src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.dstu3.model.ImplementationGuide tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide();
    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
    if (src.hasUrl())
        tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
    if (src.hasVersion())
        tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
    if (src.hasName())
        tgt.setNameElement(String30_50.convertString(src.getNameElement()));
    if (src.hasStatus())
        tgt.setStatusElement(Enumerations30_50.convertPublicationStatus(src.getStatusElement()));
    if (src.hasExperimental())
        tgt.setExperimentalElement(Boolean30_50.convertBoolean(src.getExperimentalElement()));
    if (src.hasDate())
        tgt.setDateElement(DateTime30_50.convertDateTime(src.getDateElement()));
    if (src.hasPublisher())
        tgt.setPublisherElement(String30_50.convertString(src.getPublisherElement()));
    for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(ContactDetail30_50.convertContactDetail(t));
    if (src.hasDescription())
        tgt.setDescriptionElement(MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
    for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(UsageContext30_50.convertUsageContext(t));
    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept(t));
    if (src.hasCopyright())
        tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
    if (src.hasFhirVersion())
        for (Enumeration<org.hl7.fhir.r5.model.Enumerations.FHIRVersion> v : src.getFhirVersion()) {
            tgt.setFhirVersion(v.asStringValue());
            break;
        }
    for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t));
    for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t));
    for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) {
        findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t));
    }
    for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t));
    if (src.getDefinition().hasPage())
        tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage()));
    return tgt;
}
Also used : Enumeration(org.hl7.fhir.r5.model.Enumeration) ImplementationGuide(org.hl7.fhir.dstu3.model.ImplementationGuide) ImplementationGuide(org.hl7.fhir.dstu3.model.ImplementationGuide)

Example 13 with Enumeration

use of org.hl7.fhir.dstu2.model.Enumeration in project org.hl7.fhir.core by hapifhir.

the class FamilyMemberHistory 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("patient"))
        // Reference
        this.patient = castToReference(value);
    else if (name.equals("date"))
        // DateTimeType
        this.date = castToDateTime(value);
    else if (name.equals("status"))
        // Enumeration<FamilyHistoryStatus>
        this.status = new FamilyHistoryStatusEnumFactory().fromType(value);
    else if (name.equals("name"))
        // StringType
        this.name = castToString(value);
    else if (name.equals("relationship"))
        // CodeableConcept
        this.relationship = castToCodeableConcept(value);
    else if (name.equals("gender"))
        // Enumeration<AdministrativeGender>
        this.gender = new AdministrativeGenderEnumFactory().fromType(value);
    else if (name.equals("born[x]"))
        // Type
        this.born = (Type) value;
    else if (name.equals("age[x]"))
        // Type
        this.age = (Type) value;
    else if (name.equals("deceased[x]"))
        // Type
        this.deceased = (Type) value;
    else if (name.equals("note"))
        // Annotation
        this.note = castToAnnotation(value);
    else if (name.equals("condition"))
        this.getCondition().add((FamilyMemberHistoryConditionComponent) value);
    else
        super.setProperty(name, value);
}
Also used : AdministrativeGenderEnumFactory(org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory)

Example 14 with Enumeration

use of org.hl7.fhir.dstu2.model.Enumeration 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 15 with Enumeration

use of org.hl7.fhir.dstu2.model.Enumeration in project org.hl7.fhir.core by hapifhir.

the class CodeSystem method setProperty.

@Override
public void setProperty(String name, Base value) throws FHIRException {
    if (name.equals("url"))
        // UriType
        this.url = castToUri(value);
    else if (name.equals("identifier"))
        // Identifier
        this.identifier = castToIdentifier(value);
    else if (name.equals("version"))
        // StringType
        this.version = castToString(value);
    else if (name.equals("name"))
        // StringType
        this.name = castToString(value);
    else if (name.equals("status"))
        // Enumeration<ConformanceResourceStatus>
        this.status = new ConformanceResourceStatusEnumFactory().fromType(value);
    else if (name.equals("experimental"))
        // BooleanType
        this.experimental = castToBoolean(value);
    else if (name.equals("publisher"))
        // StringType
        this.publisher = castToString(value);
    else if (name.equals("contact"))
        this.getContact().add((CodeSystemContactComponent) value);
    else if (name.equals("date"))
        // DateTimeType
        this.date = castToDateTime(value);
    else if (name.equals("description"))
        // StringType
        this.description = castToString(value);
    else if (name.equals("useContext"))
        this.getUseContext().add(castToCodeableConcept(value));
    else if (name.equals("requirements"))
        // StringType
        this.requirements = castToString(value);
    else if (name.equals("copyright"))
        // StringType
        this.copyright = castToString(value);
    else if (name.equals("caseSensitive"))
        // BooleanType
        this.caseSensitive = castToBoolean(value);
    else if (name.equals("valueSet"))
        // UriType
        this.valueSet = castToUri(value);
    else if (name.equals("compositional"))
        // BooleanType
        this.compositional = castToBoolean(value);
    else if (name.equals("versionNeeded"))
        // BooleanType
        this.versionNeeded = castToBoolean(value);
    else if (name.equals("content"))
        // Enumeration<CodeSystemContentMode>
        this.content = new CodeSystemContentModeEnumFactory().fromType(value);
    else if (name.equals("count"))
        // UnsignedIntType
        this.count = castToUnsignedInt(value);
    else if (name.equals("filter"))
        this.getFilter().add((CodeSystemFilterComponent) value);
    else if (name.equals("property"))
        this.getProperty().add((CodeSystemPropertyComponent) value);
    else if (name.equals("concept"))
        this.getConcept().add((ConceptDefinitionComponent) value);
    else
        super.setProperty(name, value);
}
Also used : ConformanceResourceStatusEnumFactory(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory)

Aggregations

CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)14 ArrayList (java.util.ArrayList)11 NotImplementedException (org.apache.commons.lang3.NotImplementedException)11 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)10 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)10 FHIRException (org.hl7.fhir.exceptions.FHIRException)7 StringType (org.hl7.fhir.r5.model.StringType)7 ConformanceResourceStatusEnumFactory (org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory)6 Enumeration (org.hl7.fhir.dstu3.model.Enumeration)6 Enumeration (org.hl7.fhir.r4.model.Enumeration)6 StringType (org.hl7.fhir.r4b.model.StringType)6 Enumeration (org.hl7.fhir.r5.model.Enumeration)6 UriType (org.hl7.fhir.r5.model.UriType)6 Base64 (org.apache.commons.codec.binary.Base64)5 PublicationStatusEnumFactory (org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory)5 StringType (org.hl7.fhir.dstu3.model.StringType)5 Enumeration (org.hl7.fhir.dstu2.model.Enumeration)4 Reference (org.hl7.fhir.dstu2.model.Reference)4 StringType (org.hl7.fhir.dstu2.model.StringType)4 Patient (org.hl7.fhir.r4.model.Patient)4