Search in sources :

Example 1 with CodeSystemFilterComponent

use of org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent 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 2 with CodeSystemFilterComponent

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

the class CodeSystemSpreadsheetGenerator method addFilters.

private void addFilters(List<CodeSystemFilterComponent> filters) {
    Sheet sheet = makeSheet("Filters");
    addHeaders(sheet, "Code", "Description", "Operators", "Value");
    for (CodeSystemFilterComponent f : filters) {
        CommaSeparatedStringBuilder cs = new CommaSeparatedStringBuilder();
        for (Enumeration<FilterOperator> op : f.getOperator()) {
            cs.append(op.asStringValue());
        }
        addRow(sheet, f.getCode(), f.getDescription(), cs.toString(), f.getValue());
    }
}
Also used : FilterOperator(org.hl7.fhir.r5.model.Enumerations.FilterOperator) CodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent) CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) Sheet(org.apache.poi.ss.usermodel.Sheet)

Example 3 with CodeSystemFilterComponent

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

the class CodeSystemRenderer method generateFilters.

private void generateFilters(XhtmlNode x, CodeSystem cs) {
    if (cs.hasFilter()) {
        x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Filters", getContext().getLang()));
        XhtmlNode tbl = x.table("grid");
        XhtmlNode tr = tbl.tr();
        tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang()));
        tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Description", getContext().getLang()));
        tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "operator", getContext().getLang()));
        tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Value", getContext().getLang()));
        for (CodeSystemFilterComponent f : cs.getFilter()) {
            tr = tbl.tr();
            tr.td().tx(f.getCode());
            tr.td().tx(f.getDescription());
            XhtmlNode td = tr.td();
            for (Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> t : f.getOperator()) td.tx(t.asStringValue() + " ");
            tr.td().tx(f.getValue());
        }
    }
}
Also used : CodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 4 with CodeSystemFilterComponent

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

the class CodeSystemSpreadsheetGenerator method addFilters.

private void addFilters(List<CodeSystemFilterComponent> filters) {
    Sheet sheet = makeSheet("Filters");
    addHeaders(sheet, "Code", "Description", "Operators", "Value");
    for (CodeSystemFilterComponent f : filters) {
        CommaSeparatedStringBuilder cs = new CommaSeparatedStringBuilder();
        for (Enumeration<FilterOperator> op : f.getOperator()) {
            cs.append(op.asStringValue());
        }
        addRow(sheet, f.getCode(), f.getDescription(), cs.toString(), f.getValue());
    }
}
Also used : FilterOperator(org.hl7.fhir.r4b.model.Enumerations.FilterOperator) CodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent) CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) Sheet(org.apache.poi.ss.usermodel.Sheet)

Example 5 with CodeSystemFilterComponent

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

the class NarrativeGenerator method generateFilters.

private void generateFilters(XhtmlNode x, CodeSystem cs) {
    if (cs.hasFilter()) {
        x.para().b().tx("Filters");
        XhtmlNode tbl = x.table("grid");
        XhtmlNode tr = tbl.tr();
        tr.td().b().tx("Code");
        tr.td().b().tx("Description");
        tr.td().b().tx("operator");
        tr.td().b().tx("Value");
        for (CodeSystemFilterComponent f : cs.getFilter()) {
            tr = tbl.tr();
            tr.td().tx(f.getCode());
            tr.td().tx(f.getDescription());
            XhtmlNode td = tr.td();
            for (Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator> t : f.getOperator()) td.tx(t.asStringValue() + " ");
            tr.td().tx(f.getValue());
        }
    }
}
Also used : FilterOperator(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator) CodeSystemFilterComponent(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Aggregations

XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)4 Sheet (org.apache.poi.ss.usermodel.Sheet)2 CodeSystemFilterComponent (org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent)2 CodeSystemFilterComponent (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent)2 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)2 ConformanceResourceStatusEnumFactory (org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory)1 CodeSystemFilterComponent (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent)1 PublicationStatusEnumFactory (org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory)1 FilterOperator (org.hl7.fhir.dstu3.model.ValueSet.FilterOperator)1 org.hl7.fhir.r4.model (org.hl7.fhir.r4.model)1 FilterOperator (org.hl7.fhir.r4.model.ValueSet.FilterOperator)1 FilterOperator (org.hl7.fhir.r4b.model.Enumerations.FilterOperator)1 FilterOperator (org.hl7.fhir.r5.model.Enumerations.FilterOperator)1