Search in sources :

Example 36 with DataRequirement

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

Example 37 with DataRequirement

use of org.hl7.fhir.r5.model.DataRequirement in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeDecisionSupportServiceModule.

protected void composeDecisionSupportServiceModule(Complex parent, String parentType, String name, DecisionSupportServiceModule element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "DecisionSupportServiceModule", name, element, index);
    if (element.hasModuleMetadata())
        composeModuleMetadata(t, "DecisionSupportServiceModule", "moduleMetadata", element.getModuleMetadata(), -1);
    for (int i = 0; i < element.getTrigger().size(); i++) composeTriggerDefinition(t, "DecisionSupportServiceModule", "trigger", element.getTrigger().get(i), i);
    for (int i = 0; i < element.getParameter().size(); i++) composeParameterDefinition(t, "DecisionSupportServiceModule", "parameter", element.getParameter().get(i), i);
    for (int i = 0; i < element.getDataRequirement().size(); i++) composeDataRequirement(t, "DecisionSupportServiceModule", "dataRequirement", element.getDataRequirement().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 38 with DataRequirement

use of org.hl7.fhir.r5.model.DataRequirement in project org.hl7.fhir.core by hapifhir.

the class DataRenderer method renderDataRequirement.

public void renderDataRequirement(XhtmlNode x, DataRequirement dr) throws FHIRFormatError, DefinitionException, IOException {
    XhtmlNode tbl = x.table("grid");
    XhtmlNode tr = tbl.tr();
    XhtmlNode td = tr.td().colspan("2");
    td.b().tx("Type");
    td.tx(": ");
    StructureDefinition sd = context.getWorker().fetchTypeDefinition(dr.getType().toCode());
    if (sd != null && sd.hasUserData("path")) {
        td.ah(sd.getUserString("path")).tx(dr.getType().toCode());
    } else {
        td.tx(dr.getType().toCode());
    }
    if (dr.hasProfile()) {
        td.tx(" (");
        boolean first = true;
        for (CanonicalType p : dr.getProfile()) {
            if (first)
                first = false;
            else
                td.tx(" | ");
            sd = context.getWorker().fetchResource(StructureDefinition.class, p.getValue());
            if (sd != null && sd.hasUserData("path")) {
                td.ah(sd.getUserString("path")).tx(sd.present());
            } else {
                td.tx(p.asStringValue());
            }
        }
        td.tx(")");
    }
    if (dr.hasSubject()) {
        tr = tbl.tr();
        td = tr.td().colspan("2");
        td.b().tx("Subject");
        if (dr.hasSubjectReference()) {
            renderReference(td, dr.getSubjectReference());
        } else {
            renderCodeableConcept(td, dr.getSubjectCodeableConcept());
        }
    }
    if (dr.hasCodeFilter() || dr.hasDateFilter()) {
        tr = tbl.tr().backgroundColor("#efefef");
        tr.td().tx("Filter");
        tr.td().tx("Value");
    }
    for (DataRequirementCodeFilterComponent cf : dr.getCodeFilter()) {
        tr = tbl.tr();
        if (cf.hasPath()) {
            tr.td().tx(cf.getPath());
        } else {
            tr.td().tx("Search on " + cf.getSearchParam());
        }
        if (cf.hasValueSet()) {
            td = tr.td();
            td.tx("In ValueSet ");
            render(td, cf.getValueSetElement());
        } else {
            boolean first = true;
            td = tr.td();
            td.tx("One of these codes: ");
            for (Coding c : cf.getCode()) {
                if (first)
                    first = false;
                else
                    td.tx(", ");
                render(td, c);
            }
        }
    }
    for (DataRequirementDateFilterComponent cf : dr.getDateFilter()) {
        tr = tbl.tr();
        if (cf.hasPath()) {
            tr.td().tx(cf.getPath());
        } else {
            tr.td().tx("Search on " + cf.getSearchParam());
        }
        render(tr.td(), cf.getValue());
    }
    if (dr.hasSort() || dr.hasLimit()) {
        tr = tbl.tr();
        td = tr.td().colspan("2");
        if (dr.hasLimit()) {
            td.b().tx("Limit");
            td.tx(": ");
            td.tx(dr.getLimit());
            if (dr.hasSort()) {
                td.tx(", ");
            }
        }
        if (dr.hasSort()) {
            td.b().tx("Sort");
            td.tx(": ");
            boolean first = true;
            for (DataRequirementSortComponent p : dr.getSort()) {
                if (first)
                    first = false;
                else
                    td.tx(" | ");
                td.tx(p.getDirection() == SortDirection.ASCENDING ? "+" : "-");
                td.tx(p.getPath());
            }
        }
    }
}
Also used : StructureDefinition(org.hl7.fhir.r5.model.StructureDefinition) Coding(org.hl7.fhir.r5.model.Coding) DataRequirementSortComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent) CanonicalType(org.hl7.fhir.r5.model.CanonicalType) DataRequirementCodeFilterComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent) DataRequirementDateFilterComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 39 with DataRequirement

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

Example 40 with DataRequirement

use of org.hl7.fhir.r5.model.DataRequirement in project org.hl7.fhir.core by hapifhir.

the class DataRenderer method renderDataRequirement.

public void renderDataRequirement(XhtmlNode x, DataRequirement dr) throws FHIRFormatError, DefinitionException, IOException {
    XhtmlNode tbl = x.table("grid");
    XhtmlNode tr = tbl.tr();
    XhtmlNode td = tr.td().colspan("2");
    td.b().tx("Type");
    td.tx(": ");
    StructureDefinition sd = context.getWorker().fetchTypeDefinition(dr.getType().toCode());
    if (sd != null && sd.hasUserData("path")) {
        td.ah(sd.getUserString("path")).tx(dr.getType().toCode());
    } else {
        td.tx(dr.getType().toCode());
    }
    if (dr.hasProfile()) {
        td.tx(" (");
        boolean first = true;
        for (CanonicalType p : dr.getProfile()) {
            if (first)
                first = false;
            else
                td.tx(" | ");
            sd = context.getWorker().fetchResource(StructureDefinition.class, p.getValue());
            if (sd != null && sd.hasUserData("path")) {
                td.ah(sd.getUserString("path")).tx(sd.present());
            } else {
                td.tx(p.asStringValue());
            }
        }
        td.tx(")");
    }
    if (dr.hasSubject()) {
        tr = tbl.tr();
        td = tr.td().colspan("2");
        td.b().tx("Subject");
        if (dr.hasSubjectReference()) {
            renderReference(td, dr.getSubjectReference());
        } else {
            renderCodeableConcept(td, dr.getSubjectCodeableConcept());
        }
    }
    if (dr.hasCodeFilter() || dr.hasDateFilter()) {
        tr = tbl.tr().backgroundColor("#efefef");
        tr.td().tx("Filter");
        tr.td().tx("Value");
    }
    for (DataRequirementCodeFilterComponent cf : dr.getCodeFilter()) {
        tr = tbl.tr();
        if (cf.hasPath()) {
            tr.td().tx(cf.getPath());
        } else {
            tr.td().tx("Search on " + cf.getSearchParam());
        }
        if (cf.hasValueSet()) {
            td = tr.td();
            td.tx("In ValueSet ");
            render(td, cf.getValueSetElement());
        } else {
            boolean first = true;
            td = tr.td();
            td.tx("One of these codes: ");
            for (Coding c : cf.getCode()) {
                if (first)
                    first = false;
                else
                    td.tx(", ");
                render(td, c);
            }
        }
    }
    for (DataRequirementDateFilterComponent cf : dr.getDateFilter()) {
        tr = tbl.tr();
        if (cf.hasPath()) {
            tr.td().tx(cf.getPath());
        } else {
            tr.td().tx("Search on " + cf.getSearchParam());
        }
        render(tr.td(), cf.getValue());
    }
    if (dr.hasSort() || dr.hasLimit()) {
        tr = tbl.tr();
        td = tr.td().colspan("2");
        if (dr.hasLimit()) {
            td.b().tx("Limit");
            td.tx(": ");
            td.tx(dr.getLimit());
            if (dr.hasSort()) {
                td.tx(", ");
            }
        }
        if (dr.hasSort()) {
            td.b().tx("Sort");
            td.tx(": ");
            boolean first = true;
            for (DataRequirementSortComponent p : dr.getSort()) {
                if (first)
                    first = false;
                else
                    td.tx(" | ");
                td.tx(p.getDirection() == SortDirection.ASCENDING ? "+" : "-");
                td.tx(p.getPath());
            }
        }
    }
}
Also used : StructureDefinition(org.hl7.fhir.r4b.model.StructureDefinition) Coding(org.hl7.fhir.r4b.model.Coding) DataRequirementSortComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent) CanonicalType(org.hl7.fhir.r4b.model.CanonicalType) DataRequirementCodeFilterComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent) DataRequirementDateFilterComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Aggregations

DataRequirement (org.hl7.fhir.r4.model.DataRequirement)7 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)6 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)6 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)6 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)6 FhirContext (ca.uhn.fhir.context.FhirContext)4 IParser (ca.uhn.fhir.parser.IParser)4 IOException (java.io.IOException)4 Library (org.hl7.fhir.r4.model.Library)4 org.hl7.fhir.r5.model (org.hl7.fhir.r5.model)4 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)3 Bundle (org.hl7.fhir.r4.model.Bundle)3 IdType (org.hl7.fhir.r4.model.IdType)3 Parameters (org.hl7.fhir.r4.model.Parameters)3 StringType (org.hl7.fhir.r4.model.StringType)3 Attachment (org.hl7.fhir.r4b.model.Attachment)3 ContactPoint (org.hl7.fhir.r4b.model.ContactPoint)3 Attachment (org.hl7.fhir.r5.model.Attachment)3 ContactPoint (org.hl7.fhir.r5.model.ContactPoint)3 Test (org.junit.jupiter.api.Test)3