Search in sources :

Example 91 with CanonicalType

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

the class RdfParser method composeCanonical.

protected void composeCanonical(Complex parent, String parentType, String name, CanonicalType 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.r4.utils.formats.Turtle.Complex)

Example 92 with CanonicalType

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

the class XLSXWriter method canonicalList.

private String canonicalList(List<CanonicalType> list) {
    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder("|");
    for (CanonicalType c : list) {
        String v = c.getValue();
        if (v.startsWith("http://hl7.org/fhir/StructureDefinition/"))
            v = v.substring(40);
        b.append(v);
    }
    return b.toString();
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) CanonicalType(org.hl7.fhir.r4b.model.CanonicalType)

Example 93 with CanonicalType

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

the class QuestionnaireBuilder method addReferenceQuestions.

// Special Types ---------------------------------------------------------------
private void addReferenceQuestions(QuestionnaireItemComponent group, ElementDefinition element, String path, List<CanonicalType> profileURL, List<QuestionnaireResponse.QuestionnaireResponseItemComponent> answerGroups) throws FHIRException {
    // var
    // rn : String;
    // i : integer;
    // q : TFhirQuestionnaireGroupQuestion;
    ToolingExtensions.addFhirType(group, "Reference");
    QuestionnaireItemComponent q = addQuestion(group, QuestionnaireItemType.REFERENCE, path, "value", group.getText(), answerGroups);
    group.setText(null);
    CommaSeparatedStringBuilder rn = new CommaSeparatedStringBuilder();
    for (UriType u : profileURL) if (u.getValue().startsWith("http://hl7.org/fhir/StructureDefinition/"))
        rn.append(u.getValue().substring(40));
    if (rn.length() == 0)
        ToolingExtensions.addReferenceFilter(q, "subject=$subj&patient=$subj&encounter=$encounter");
    else {
        ToolingExtensions.addAllowedResource(q, rn.toString());
        ToolingExtensions.addReferenceFilter(q, "subject=$subj&patient=$subj&encounter=$encounter");
    }
    for (QuestionnaireResponse.QuestionnaireResponseItemComponent ag : answerGroups) ag.setText(null);
}
Also used : QuestionnaireItemComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent) CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) QuestionnaireResponse(org.hl7.fhir.r4b.model.QuestionnaireResponse) UriType(org.hl7.fhir.r4b.model.UriType)

Example 94 with CanonicalType

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

the class ConceptMap30_50 method convertUriAndVersionToCanonical.

private static CanonicalType convertUriAndVersionToCanonical(org.hl7.fhir.dstu3.model.UriType srcUri, org.hl7.fhir.dstu3.model.StringType srcVersion) {
    if (srcUri == null && srcVersion == null)
        return null;
    org.hl7.fhir.r5.model.CanonicalType tgt = new org.hl7.fhir.r5.model.CanonicalType();
    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(srcUri == null ? srcVersion : srcUri, tgt);
    if (srcUri.hasValue()) {
        if (srcVersion.hasValue()) {
            tgt.setValue(srcUri.getValue() + "|" + srcVersion.getValue());
        } else {
            tgt.setValue(srcUri.getValue());
        }
    }
    return tgt;
}
Also used : CanonicalType(org.hl7.fhir.r5.model.CanonicalType) CanonicalType(org.hl7.fhir.r5.model.CanonicalType)

Example 95 with CanonicalType

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

the class XLSXWriter method canonicalList.

private String canonicalList(List<CanonicalType> list) {
    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder("|");
    for (CanonicalType c : list) {
        String v = c.getValue();
        if (v.startsWith("http://hl7.org/fhir/StructureDefinition/"))
            v = v.substring(40);
        b.append(v);
    }
    return b.toString();
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) CanonicalType(org.hl7.fhir.r4.model.CanonicalType)

Aggregations

CanonicalType (org.hl7.fhir.r4.model.CanonicalType)45 CanonicalType (org.hl7.fhir.r5.model.CanonicalType)37 ArrayList (java.util.ArrayList)27 CanonicalType (org.hl7.fhir.r4b.model.CanonicalType)19 TypeRefComponent (org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent)14 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)13 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)12 Test (org.junit.jupiter.api.Test)12 List (java.util.List)10 FHIRException (org.hl7.fhir.exceptions.FHIRException)9 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)9 HashMap (java.util.HashMap)7 HashSet (java.util.HashSet)7 Extension (org.hl7.fhir.r4.model.Extension)7 Library (org.hl7.fhir.r4.model.Library)7 StringType (org.hl7.fhir.r4.model.StringType)6 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)6 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)5 Bundle (org.hl7.fhir.r4.model.Bundle)5 IdType (org.hl7.fhir.r4.model.IdType)5