Search in sources :

Example 36 with BooleanType

use of org.hl7.fhir.dstu2.model.BooleanType 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)

Example 37 with BooleanType

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

the class CompartmentDefinition 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("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((CompartmentDefinitionContactComponent) 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("requirements"))
        // StringType
        this.requirements = castToString(value);
    else if (name.equals("code"))
        // Enumeration<CompartmentType>
        this.code = new CompartmentTypeEnumFactory().fromType(value);
    else if (name.equals("search"))
        // BooleanType
        this.search = castToBoolean(value);
    else if (name.equals("resource"))
        this.getResource().add((CompartmentDefinitionResourceComponent) value);
    else
        super.setProperty(name, value);
}
Also used : ConformanceResourceStatusEnumFactory(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory)

Example 38 with BooleanType

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

the class ConceptMap 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((ConceptMapContactComponent) 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("source[x]"))
        // Type
        this.source = (Type) value;
    else if (name.equals("target[x]"))
        // Type
        this.target = (Type) value;
    else if (name.equals("element"))
        this.getElement().add((SourceElementComponent) value);
    else
        super.setProperty(name, value);
}
Also used : ConformanceResourceStatusEnumFactory(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory)

Example 39 with BooleanType

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

the class RdfParser method composeBoolean.

protected void composeBoolean(Complex parent, String parentType, String name, BooleanType 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);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 40 with BooleanType

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

the class ValueSet10_40 method convertValueSet.

public static org.hl7.fhir.r4.model.ValueSet convertValueSet(org.hl7.fhir.dstu2.model.ValueSet src, BaseAdvisor_10_40 advisor) throws FHIRException {
    if (src == null || src.isEmpty())
        return null;
    org.hl7.fhir.r4.model.ValueSet tgt = new org.hl7.fhir.r4.model.ValueSet();
    ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyDomainResource(src, tgt);
    if (src.hasUrlElement())
        tgt.setUrlElement(Uri10_40.convertUri(src.getUrlElement()));
    if (src.hasIdentifier())
        tgt.addIdentifier(Identifier10_40.convertIdentifier(src.getIdentifier()));
    if (src.hasVersionElement())
        tgt.setVersionElement(String10_40.convertString(src.getVersionElement()));
    if (src.hasNameElement())
        tgt.setNameElement(String10_40.convertString(src.getNameElement()));
    if (src.hasStatus())
        tgt.setStatusElement(Enumerations10_40.convertConformanceResourceStatus(src.getStatusElement()));
    if (src.hasExperimental())
        tgt.setExperimentalElement(Boolean10_40.convertBoolean(src.getExperimentalElement()));
    if (src.hasPublisherElement())
        tgt.setPublisherElement(String10_40.convertString(src.getPublisherElement()));
    for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t));
    if (src.hasDate())
        tgt.setDateElement(DateTime10_40.convertDateTime(src.getDateElement()));
    if (src.hasDescription())
        tgt.setDescription(src.getDescription());
    for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t))
        tgt.addJurisdiction(CodeableConcept10_40.convertCodeableConcept(t));
    else
        tgt.addUseContext(CodeableConcept10_40.convertCodeableConceptToUsageContext(t));
    if (src.hasImmutableElement())
        tgt.setImmutableElement(Boolean10_40.convertBoolean(src.getImmutableElement()));
    if (src.hasRequirements())
        tgt.setPurpose(src.getRequirements());
    if (src.hasCopyright())
        tgt.setCopyright(src.getCopyright());
    if (src.hasExtensible())
        tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible()));
    if (src.hasCompose()) {
        if (src.hasCompose())
            tgt.setCompose(convertValueSetComposeComponent(src.getCompose()));
        tgt.getCompose().setLockedDate(src.getLockedDate());
    }
    if (src.hasCodeSystem() && advisor != null) {
        org.hl7.fhir.r4.model.CodeSystem tgtcs = new org.hl7.fhir.r4.model.CodeSystem();
        ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyDomainResource(src, tgtcs);
        tgtcs.setUrl(src.getCodeSystem().getSystem());
        tgtcs.addIdentifier(Identifier10_40.convertIdentifier(src.getIdentifier()));
        tgtcs.setVersion(src.getCodeSystem().getVersion());
        tgtcs.setName(src.getName() + " Code System");
        tgtcs.setStatusElement(Enumerations10_40.convertConformanceResourceStatus(src.getStatusElement()));
        if (src.hasExperimental())
            tgtcs.setExperimental(src.getExperimental());
        tgtcs.setPublisher(src.getPublisher());
        for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t));
        if (src.hasDate())
            tgtcs.setDate(src.getDate());
        tgtcs.setDescription(src.getDescription());
        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t))
            tgtcs.addJurisdiction(CodeableConcept10_40.convertCodeableConcept(t));
        else
            tgtcs.addUseContext(CodeableConcept10_40.convertCodeableConceptToUsageContext(t));
        tgtcs.setPurpose(src.getRequirements());
        tgtcs.setCopyright(src.getCopyright());
        tgtcs.setContent(CodeSystemContentMode.COMPLETE);
        tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive());
        for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs);
        advisor.handleCodeSystem(tgtcs, tgt);
        tgt.setUserData("r2-cs", tgtcs);
        tgt.getCompose().addInclude().setSystem(tgtcs.getUrl());
    }
    if (src.hasExpansion())
        tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion()));
    return tgt;
}
Also used : CodeSystem(org.hl7.fhir.r4.model.CodeSystem) BooleanType(org.hl7.fhir.r4.model.BooleanType) CodeSystem(org.hl7.fhir.r4.model.CodeSystem) ValueSet(org.hl7.fhir.dstu2.model.ValueSet)

Aggregations

ArrayList (java.util.ArrayList)59 BooleanType (org.hl7.fhir.r5.model.BooleanType)38 BooleanType (org.hl7.fhir.r4.model.BooleanType)37 FHIRException (org.hl7.fhir.exceptions.FHIRException)33 BooleanType (org.hl7.fhir.r4b.model.BooleanType)27 BooleanType (org.hl7.fhir.dstu3.model.BooleanType)19 NotImplementedException (org.apache.commons.lang3.NotImplementedException)18 Base (org.hl7.fhir.r5.model.Base)17 Test (org.junit.Test)16 StringType (org.hl7.fhir.r4.model.StringType)15 Base (org.hl7.fhir.r4b.model.Base)15 BooleanType (org.hl7.fhir.dstu2016may.model.BooleanType)13 IOException (java.io.IOException)12 HashMap (java.util.HashMap)11 BooleanType (org.hl7.fhir.dstu2.model.BooleanType)11 Base (org.hl7.fhir.dstu2.model.Base)10 StringType (org.hl7.fhir.dstu3.model.StringType)10 StringType (org.hl7.fhir.r5.model.StringType)10 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)9 Coding (org.hl7.fhir.r4.model.Coding)9