Search in sources :

Example 21 with MarkdownType

use of org.hl7.fhir.r4b.model.MarkdownType in project org.hl7.fhir.core by hapifhir.

the class StructureDefinition method setProperty.

@Override
public Base setProperty(String name, Base value) throws FHIRException {
    if (name.equals("url")) {
        // UriType
        this.url = castToUri(value);
    } else if (name.equals("identifier")) {
        this.getIdentifier().add(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("title")) {
        // StringType
        this.title = castToString(value);
    } else if (name.equals("status")) {
        value = new PublicationStatusEnumFactory().fromType(castToCode(value));
        // Enumeration<PublicationStatus>
        this.status = (Enumeration) value;
    } else if (name.equals("experimental")) {
        // BooleanType
        this.experimental = castToBoolean(value);
    } else if (name.equals("date")) {
        // DateTimeType
        this.date = castToDateTime(value);
    } else if (name.equals("publisher")) {
        // StringType
        this.publisher = castToString(value);
    } else if (name.equals("contact")) {
        this.getContact().add(castToContactDetail(value));
    } else if (name.equals("description")) {
        // MarkdownType
        this.description = castToMarkdown(value);
    } else if (name.equals("useContext")) {
        this.getUseContext().add(castToUsageContext(value));
    } else if (name.equals("jurisdiction")) {
        this.getJurisdiction().add(castToCodeableConcept(value));
    } else if (name.equals("purpose")) {
        // MarkdownType
        this.purpose = castToMarkdown(value);
    } else if (name.equals("copyright")) {
        // MarkdownType
        this.copyright = castToMarkdown(value);
    } else if (name.equals("keyword")) {
        this.getKeyword().add(castToCoding(value));
    } else if (name.equals("fhirVersion")) {
        // IdType
        this.fhirVersion = castToId(value);
    } else if (name.equals("mapping")) {
        this.getMapping().add((StructureDefinitionMappingComponent) value);
    } else if (name.equals("kind")) {
        value = new StructureDefinitionKindEnumFactory().fromType(castToCode(value));
        // Enumeration<StructureDefinitionKind>
        this.kind = (Enumeration) value;
    } else if (name.equals("abstract")) {
        // BooleanType
        this.abstract_ = castToBoolean(value);
    } else if (name.equals("contextType")) {
        value = new ExtensionContextEnumFactory().fromType(castToCode(value));
        // Enumeration<ExtensionContext>
        this.contextType = (Enumeration) value;
    } else if (name.equals("context")) {
        this.getContext().add(castToString(value));
    } else if (name.equals("contextInvariant")) {
        this.getContextInvariant().add(castToString(value));
    } else if (name.equals("type")) {
        // CodeType
        this.type = castToCode(value);
    } else if (name.equals("baseDefinition")) {
        // UriType
        this.baseDefinition = castToUri(value);
    } else if (name.equals("derivation")) {
        value = new TypeDerivationRuleEnumFactory().fromType(castToCode(value));
        // Enumeration<TypeDerivationRule>
        this.derivation = (Enumeration) value;
    } else if (name.equals("snapshot")) {
        // StructureDefinitionSnapshotComponent
        this.snapshot = (StructureDefinitionSnapshotComponent) value;
    } else if (name.equals("differential")) {
        // StructureDefinitionDifferentialComponent
        this.differential = (StructureDefinitionDifferentialComponent) value;
    } else
        return super.setProperty(name, value);
    return value;
}
Also used : PublicationStatusEnumFactory(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory)

Example 22 with MarkdownType

use of org.hl7.fhir.r4b.model.MarkdownType in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMarkdown.

protected void composeMarkdown(Complex parent, String parentType, String name, MarkdownType 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.dstu2016may.formats.RdfGenerator.Complex)

Example 23 with MarkdownType

use of org.hl7.fhir.r4b.model.MarkdownType in project org.hl7.fhir.core by hapifhir.

the class CompartmentDefinition method setProperty.

@Override
public Base 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("title")) {
        // StringType
        this.title = castToString(value);
    } else if (name.equals("status")) {
        value = new PublicationStatusEnumFactory().fromType(castToCode(value));
        // Enumeration<PublicationStatus>
        this.status = (Enumeration) value;
    } else if (name.equals("experimental")) {
        // BooleanType
        this.experimental = castToBoolean(value);
    } else if (name.equals("date")) {
        // DateTimeType
        this.date = castToDateTime(value);
    } else if (name.equals("publisher")) {
        // StringType
        this.publisher = castToString(value);
    } else if (name.equals("contact")) {
        this.getContact().add(castToContactDetail(value));
    } else if (name.equals("description")) {
        // MarkdownType
        this.description = castToMarkdown(value);
    } else if (name.equals("purpose")) {
        // MarkdownType
        this.purpose = castToMarkdown(value);
    } else if (name.equals("useContext")) {
        this.getUseContext().add(castToUsageContext(value));
    } else if (name.equals("jurisdiction")) {
        this.getJurisdiction().add(castToCodeableConcept(value));
    } else if (name.equals("code")) {
        value = new CompartmentTypeEnumFactory().fromType(castToCode(value));
        // Enumeration<CompartmentType>
        this.code = (Enumeration) value;
    } else if (name.equals("search")) {
        // BooleanType
        this.search = castToBoolean(value);
    } else if (name.equals("resource")) {
        this.getResource().add((CompartmentDefinitionResourceComponent) value);
    } else
        return super.setProperty(name, value);
    return value;
}
Also used : PublicationStatusEnumFactory(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory)

Example 24 with MarkdownType

use of org.hl7.fhir.r4b.model.MarkdownType in project org.hl7.fhir.core by hapifhir.

the class CodeSystem method setProperty.

@Override
public Base 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("title")) {
        // StringType
        this.title = castToString(value);
    } else if (name.equals("status")) {
        value = new PublicationStatusEnumFactory().fromType(castToCode(value));
        // Enumeration<PublicationStatus>
        this.status = (Enumeration) value;
    } else if (name.equals("experimental")) {
        // BooleanType
        this.experimental = castToBoolean(value);
    } else if (name.equals("date")) {
        // DateTimeType
        this.date = castToDateTime(value);
    } else if (name.equals("publisher")) {
        // StringType
        this.publisher = castToString(value);
    } else if (name.equals("contact")) {
        this.getContact().add(castToContactDetail(value));
    } else if (name.equals("description")) {
        // MarkdownType
        this.description = castToMarkdown(value);
    } else if (name.equals("useContext")) {
        this.getUseContext().add(castToUsageContext(value));
    } else if (name.equals("jurisdiction")) {
        this.getJurisdiction().add(castToCodeableConcept(value));
    } else if (name.equals("purpose")) {
        // MarkdownType
        this.purpose = castToMarkdown(value);
    } else if (name.equals("copyright")) {
        // MarkdownType
        this.copyright = castToMarkdown(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("hierarchyMeaning")) {
        value = new CodeSystemHierarchyMeaningEnumFactory().fromType(castToCode(value));
        // Enumeration<CodeSystemHierarchyMeaning>
        this.hierarchyMeaning = (Enumeration) 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")) {
        value = new CodeSystemContentModeEnumFactory().fromType(castToCode(value));
        // Enumeration<CodeSystemContentMode>
        this.content = (Enumeration) 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((PropertyComponent) value);
    } else if (name.equals("concept")) {
        this.getConcept().add((ConceptDefinitionComponent) value);
    } else
        return super.setProperty(name, value);
    return value;
}
Also used : PublicationStatusEnumFactory(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory)

Example 25 with MarkdownType

use of org.hl7.fhir.r4b.model.MarkdownType in project org.hl7.fhir.core by hapifhir.

the class JsonParser method composeType.

protected void composeType(String prefix, DataType type) throws IOException {
    if (type == null) {
        ;
    } else if (type instanceof Address) {
        composeAddress(prefix + "Address", (Address) type);
    } else if (type instanceof Age) {
        composeAge(prefix + "Age", (Age) type);
    } else if (type instanceof Annotation) {
        composeAnnotation(prefix + "Annotation", (Annotation) type);
    } else if (type instanceof Attachment) {
        composeAttachment(prefix + "Attachment", (Attachment) type);
    } else if (type instanceof CodeableConcept) {
        composeCodeableConcept(prefix + "CodeableConcept", (CodeableConcept) type);
    } else if (type instanceof CodeableReference) {
        composeCodeableReference(prefix + "CodeableReference", (CodeableReference) type);
    } else if (type instanceof Coding) {
        composeCoding(prefix + "Coding", (Coding) type);
    } else if (type instanceof ContactDetail) {
        composeContactDetail(prefix + "ContactDetail", (ContactDetail) type);
    } else if (type instanceof ContactPoint) {
        composeContactPoint(prefix + "ContactPoint", (ContactPoint) type);
    } else if (type instanceof Contributor) {
        composeContributor(prefix + "Contributor", (Contributor) type);
    } else if (type instanceof Count) {
        composeCount(prefix + "Count", (Count) type);
    } else if (type instanceof DataRequirement) {
        composeDataRequirement(prefix + "DataRequirement", (DataRequirement) type);
    } else if (type instanceof Distance) {
        composeDistance(prefix + "Distance", (Distance) type);
    } else if (type instanceof Dosage) {
        composeDosage(prefix + "Dosage", (Dosage) type);
    } else if (type instanceof Duration) {
        composeDuration(prefix + "Duration", (Duration) type);
    } else if (type instanceof ElementDefinition) {
        composeElementDefinition(prefix + "ElementDefinition", (ElementDefinition) type);
    } else if (type instanceof Expression) {
        composeExpression(prefix + "Expression", (Expression) type);
    } else if (type instanceof Extension) {
        composeExtension(prefix + "Extension", (Extension) type);
    } else if (type instanceof HumanName) {
        composeHumanName(prefix + "HumanName", (HumanName) type);
    } else if (type instanceof Identifier) {
        composeIdentifier(prefix + "Identifier", (Identifier) type);
    } else if (type instanceof MarketingStatus) {
        composeMarketingStatus(prefix + "MarketingStatus", (MarketingStatus) type);
    } else if (type instanceof Meta) {
        composeMeta(prefix + "Meta", (Meta) type);
    } else if (type instanceof Money) {
        composeMoney(prefix + "Money", (Money) type);
    } else if (type instanceof Narrative) {
        composeNarrative(prefix + "Narrative", (Narrative) type);
    } else if (type instanceof ParameterDefinition) {
        composeParameterDefinition(prefix + "ParameterDefinition", (ParameterDefinition) type);
    } else if (type instanceof Period) {
        composePeriod(prefix + "Period", (Period) type);
    } else if (type instanceof Population) {
        composePopulation(prefix + "Population", (Population) type);
    } else if (type instanceof ProdCharacteristic) {
        composeProdCharacteristic(prefix + "ProdCharacteristic", (ProdCharacteristic) type);
    } else if (type instanceof ProductShelfLife) {
        composeProductShelfLife(prefix + "ProductShelfLife", (ProductShelfLife) type);
    } else if (type instanceof Quantity) {
        composeQuantity(prefix + "Quantity", (Quantity) type);
    } else if (type instanceof Range) {
        composeRange(prefix + "Range", (Range) type);
    } else if (type instanceof Ratio) {
        composeRatio(prefix + "Ratio", (Ratio) type);
    } else if (type instanceof RatioRange) {
        composeRatioRange(prefix + "RatioRange", (RatioRange) type);
    } else if (type instanceof Reference) {
        composeReference(prefix + "Reference", (Reference) type);
    } else if (type instanceof RelatedArtifact) {
        composeRelatedArtifact(prefix + "RelatedArtifact", (RelatedArtifact) type);
    } else if (type instanceof SampledData) {
        composeSampledData(prefix + "SampledData", (SampledData) type);
    } else if (type instanceof Signature) {
        composeSignature(prefix + "Signature", (Signature) type);
    } else if (type instanceof Timing) {
        composeTiming(prefix + "Timing", (Timing) type);
    } else if (type instanceof TriggerDefinition) {
        composeTriggerDefinition(prefix + "TriggerDefinition", (TriggerDefinition) type);
    } else if (type instanceof UsageContext) {
        composeUsageContext(prefix + "UsageContext", (UsageContext) type);
    } else if (type instanceof CodeType) {
        composeCodeCore(prefix + "Code", (CodeType) type, false);
        composeCodeExtras(prefix + "Code", (CodeType) type, false);
    } else if (type instanceof OidType) {
        composeOidCore(prefix + "Oid", (OidType) type, false);
        composeOidExtras(prefix + "Oid", (OidType) type, false);
    } else if (type instanceof CanonicalType) {
        composeCanonicalCore(prefix + "Canonical", (CanonicalType) type, false);
        composeCanonicalExtras(prefix + "Canonical", (CanonicalType) type, false);
    } else if (type instanceof UuidType) {
        composeUuidCore(prefix + "Uuid", (UuidType) type, false);
        composeUuidExtras(prefix + "Uuid", (UuidType) type, false);
    } else if (type instanceof UrlType) {
        composeUrlCore(prefix + "Url", (UrlType) type, false);
        composeUrlExtras(prefix + "Url", (UrlType) type, false);
    } else if (type instanceof UnsignedIntType) {
        composeUnsignedIntCore(prefix + "UnsignedInt", (UnsignedIntType) type, false);
        composeUnsignedIntExtras(prefix + "UnsignedInt", (UnsignedIntType) type, false);
    } else if (type instanceof MarkdownType) {
        composeMarkdownCore(prefix + "Markdown", (MarkdownType) type, false);
        composeMarkdownExtras(prefix + "Markdown", (MarkdownType) type, false);
    } else if (type instanceof IdType) {
        composeIdCore(prefix + "Id", (IdType) type, false);
        composeIdExtras(prefix + "Id", (IdType) type, false);
    } else if (type instanceof PositiveIntType) {
        composePositiveIntCore(prefix + "PositiveInt", (PositiveIntType) type, false);
        composePositiveIntExtras(prefix + "PositiveInt", (PositiveIntType) type, false);
    } else if (type instanceof DateType) {
        composeDateCore(prefix + "Date", (DateType) type, false);
        composeDateExtras(prefix + "Date", (DateType) type, false);
    } else if (type instanceof DateTimeType) {
        composeDateTimeCore(prefix + "DateTime", (DateTimeType) type, false);
        composeDateTimeExtras(prefix + "DateTime", (DateTimeType) type, false);
    } else if (type instanceof StringType) {
        composeStringCore(prefix + "String", (StringType) type, false);
        composeStringExtras(prefix + "String", (StringType) type, false);
    } else if (type instanceof IntegerType) {
        composeIntegerCore(prefix + "Integer", (IntegerType) type, false);
        composeIntegerExtras(prefix + "Integer", (IntegerType) type, false);
    } else if (type instanceof Integer64Type) {
        composeInteger64Core(prefix + "Integer64", (Integer64Type) type, false);
        composeInteger64Extras(prefix + "Integer64", (Integer64Type) type, false);
    } else if (type instanceof UriType) {
        composeUriCore(prefix + "Uri", (UriType) type, false);
        composeUriExtras(prefix + "Uri", (UriType) type, false);
    } else if (type instanceof InstantType) {
        composeInstantCore(prefix + "Instant", (InstantType) type, false);
        composeInstantExtras(prefix + "Instant", (InstantType) type, false);
    } else if (type instanceof BooleanType) {
        composeBooleanCore(prefix + "Boolean", (BooleanType) type, false);
        composeBooleanExtras(prefix + "Boolean", (BooleanType) type, false);
    } else if (type instanceof Base64BinaryType) {
        composeBase64BinaryCore(prefix + "Base64Binary", (Base64BinaryType) type, false);
        composeBase64BinaryExtras(prefix + "Base64Binary", (Base64BinaryType) type, false);
    } else if (type instanceof TimeType) {
        composeTimeCore(prefix + "Time", (TimeType) type, false);
        composeTimeExtras(prefix + "Time", (TimeType) type, false);
    } else if (type instanceof DecimalType) {
        composeDecimalCore(prefix + "Decimal", (DecimalType) type, false);
        composeDecimalExtras(prefix + "Decimal", (DecimalType) type, false);
    } else
        throw new Error("Unhandled type");
}
Also used : FHIRFormatError(org.hl7.fhir.exceptions.FHIRFormatError)

Aggregations

PublicationStatusEnumFactory (org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory)6 Test (org.junit.jupiter.api.Test)6 MarkdownType (org.hl7.fhir.r4b.model.MarkdownType)5 DisplayName (org.junit.jupiter.api.DisplayName)5 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)4 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)4 Observation (org.hl7.fhir.r4.model.Observation)4 Resource (org.hl7.fhir.r4.model.Resource)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 FHIRException (org.hl7.fhir.exceptions.FHIRException)2 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)2 Practitioner (org.hl7.fhir.r4.model.Practitioner)2 ServiceRequest (org.hl7.fhir.r4.model.ServiceRequest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2 CodeInfo (au.csiro.redmatch.terminology.CodeInfo)1 JsonElement (com.google.gson.JsonElement)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 Field (java.lang.reflect.Field)1 URISyntaxException (java.net.URISyntaxException)1