Search in sources :

Example 61 with Timing

use of org.hl7.fhir.r4.model.Timing in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMedicationStatementMedicationStatementDosageComponent.

protected void composeMedicationStatementMedicationStatementDosageComponent(Complex parent, String parentType, String name, MedicationStatement.MedicationStatementDosageComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "dosage", name, element, index);
    if (element.hasTextElement())
        composeString(t, "MedicationStatement", "text", element.getTextElement(), -1);
    if (element.hasTiming())
        composeTiming(t, "MedicationStatement", "timing", element.getTiming(), -1);
    if (element.hasAsNeeded())
        composeType(t, "MedicationStatement", "asNeeded", element.getAsNeeded(), -1);
    if (element.hasSite())
        composeType(t, "MedicationStatement", "site", element.getSite(), -1);
    if (element.hasRoute())
        composeCodeableConcept(t, "MedicationStatement", "route", element.getRoute(), -1);
    if (element.hasMethod())
        composeCodeableConcept(t, "MedicationStatement", "method", element.getMethod(), -1);
    if (element.hasQuantity())
        composeType(t, "MedicationStatement", "quantity", element.getQuantity(), -1);
    if (element.hasRate())
        composeType(t, "MedicationStatement", "rate", element.getRate(), -1);
    if (element.hasMaxDosePerPeriod())
        composeRatio(t, "MedicationStatement", "maxDosePerPeriod", element.getMaxDosePerPeriod(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 62 with Timing

use of org.hl7.fhir.r4.model.Timing in project org.hl7.fhir.core by hapifhir.

the class ProfileDrivenRenderer method displayLeaf.

private boolean displayLeaf(ResourceWrapper res, BaseWrapper ew, ElementDefinition defn, XhtmlNode x, String name, boolean showCodeDetails, boolean allowLinks) throws FHIRException, UnsupportedEncodingException, IOException {
    if (ew == null)
        return false;
    Base e = ew.getBase();
    if (e == null)
        return false;
    Map<String, String> displayHints = readDisplayHints(defn);
    if (name.endsWith("[x]"))
        name = name.substring(0, name.length() - 3);
    if (!showCodeDetails && e instanceof PrimitiveType && isDefault(displayHints, ((PrimitiveType) e)))
        return false;
    if (e instanceof StringType) {
        x.addText(name + ": " + ((StringType) e).getValue());
        return true;
    } else if (e instanceof CodeType) {
        x.addText(name + ": " + ((CodeType) e).getValue());
        return true;
    } else if (e instanceof IdType) {
        x.addText(name + ": " + ((IdType) e).getValue());
        return true;
    } else if (e instanceof UriType) {
        if (Utilities.isAbsoluteUrlLinkable(((UriType) e).getValue()) && allowLinks) {
            x.tx(name + ": ");
            x.ah(((UriType) e).getValue()).addText(((UriType) e).getValue());
        } else {
            x.addText(name + ": " + ((UriType) e).getValue());
        }
        return true;
    } else if (e instanceof DateTimeType) {
        x.addText(name + ": " + ((DateTimeType) e).toHumanDisplay());
        return true;
    } else if (e instanceof InstantType) {
        x.addText(name + ": " + ((InstantType) e).toHumanDisplay());
        return true;
    } else if (e instanceof Extension) {
        // x.tx("Extensions: todo");
        return false;
    } else if (e instanceof org.hl7.fhir.r5.model.DateType) {
        x.addText(name + ": " + ((org.hl7.fhir.r5.model.DateType) e).toHumanDisplay());
        return true;
    } else if (e instanceof Enumeration) {
        // todo: look up a display name if there is one
        x.addText(((Enumeration<?>) e).getValue().toString());
        return true;
    } else if (e instanceof BooleanType) {
        if (((BooleanType) e).hasValue()) {
            x.addText(name);
            x.addText(": ");
            x.addText(((BooleanType) e).getValueAsString());
            return true;
        }
    } else if (e instanceof CodeableReference) {
        if (((CodeableReference) e).hasReference()) {
            Reference r = ((CodeableReference) e).getReference();
            renderReference(res, x, r, allowLinks);
        } else {
            renderCodeableConcept(x, ((CodeableReference) e).getConcept(), showCodeDetails);
        }
        return true;
    } else if (e instanceof CodeableConcept) {
        renderCodeableConcept(x, (CodeableConcept) e, showCodeDetails);
        return true;
    } else if (e instanceof Coding) {
        renderCoding(x, (Coding) e, showCodeDetails);
        return true;
    } else if (e instanceof Annotation) {
        renderAnnotation(x, (Annotation) e, showCodeDetails);
        return true;
    } else if (e instanceof org.hl7.fhir.r5.model.IntegerType) {
        x.addText(Integer.toString(((org.hl7.fhir.r5.model.IntegerType) e).getValue()));
        return true;
    } else if (e instanceof org.hl7.fhir.r5.model.DecimalType) {
        x.addText(((org.hl7.fhir.r5.model.DecimalType) e).getValue().toString());
        return true;
    } else if (e instanceof Identifier) {
        renderIdentifier(x, (Identifier) e);
        return true;
    } else if (e instanceof HumanName) {
        renderHumanName(x, (HumanName) e);
        return true;
    } else if (e instanceof SampledData) {
        renderSampledData(x, (SampledData) e);
        return true;
    } else if (e instanceof Address) {
        renderAddress(x, (Address) e);
        return true;
    } else if (e instanceof ContactPoint) {
        if (allowLinks) {
            renderContactPoint(x, (ContactPoint) e);
        } else {
            displayContactPoint(x, (ContactPoint) e);
        }
        return true;
    } else if (e instanceof Timing) {
        renderTiming(x, (Timing) e);
        return true;
    } else if (e instanceof Quantity) {
        renderQuantity(x, (Quantity) e, showCodeDetails);
        return true;
    } else if (e instanceof Ratio) {
        renderQuantity(x, ((Ratio) e).getNumerator(), showCodeDetails);
        x.tx("/");
        renderQuantity(x, ((Ratio) e).getDenominator(), showCodeDetails);
        return true;
    } else if (e instanceof Period) {
        Period p = (Period) e;
        x.addText(name + ": ");
        x.addText(!p.hasStart() ? "?ngen-2?" : p.getStartElement().toHumanDisplay());
        x.tx(" --> ");
        x.addText(!p.hasEnd() ? "(ongoing)" : p.getEndElement().toHumanDisplay());
        return true;
    } else if (e instanceof Reference) {
        Reference r = (Reference) e;
        if (r.hasDisplayElement())
            x.addText(r.getDisplay());
        else if (r.hasReferenceElement()) {
            ResourceWithReference tr = resolveReference(res, r.getReference());
            // getDisplayForReference(tr.getReference()));
            x.addText(tr == null ? r.getReference() : "?ngen-3");
        } else
            x.tx("?ngen-4?");
        return true;
    } else if (e instanceof Narrative) {
        return false;
    } else if (e instanceof Resource) {
        return false;
    } else if (e instanceof ContactDetail) {
        ContactDetail cd = (ContactDetail) e;
        if (cd.hasName()) {
            x.tx(cd.getName() + ": ");
        }
        boolean first = true;
        for (ContactPoint c : cd.getTelecom()) {
            if (first)
                first = false;
            else
                x.tx(",");
            if (allowLinks) {
                renderContactPoint(x, c);
            } else {
                displayContactPoint(x, c);
            }
        }
        return true;
    } else if (e instanceof Range) {
        return false;
    } else if (e instanceof Meta) {
        return false;
    } else if (e instanceof Dosage) {
        return false;
    } else if (e instanceof Signature) {
        return false;
    } else if (e instanceof UsageContext) {
        return false;
    } else if (e instanceof RelatedArtifact) {
        return false;
    } else if (e instanceof ElementDefinition) {
        return false;
    } else if (e instanceof Base64BinaryType) {
        return false;
    } else if (!(e instanceof Attachment))
        throw new NotImplementedException("type " + e.getClass().getName() + " not handled yet");
    return false;
}
Also used : Meta(org.hl7.fhir.r5.model.Meta) Address(org.hl7.fhir.r5.model.Address) StringType(org.hl7.fhir.r5.model.StringType) Attachment(org.hl7.fhir.r5.model.Attachment) Dosage(org.hl7.fhir.r5.model.Dosage) Identifier(org.hl7.fhir.r5.model.Identifier) Coding(org.hl7.fhir.r5.model.Coding) Narrative(org.hl7.fhir.r5.model.Narrative) SampledData(org.hl7.fhir.r5.model.SampledData) PrimitiveType(org.hl7.fhir.r5.model.PrimitiveType) ElementDefinition(org.hl7.fhir.r5.model.ElementDefinition) InstantType(org.hl7.fhir.r5.model.InstantType) Resource(org.hl7.fhir.r5.model.Resource) DomainResource(org.hl7.fhir.r5.model.DomainResource) Period(org.hl7.fhir.r5.model.Period) ResourceWithReference(org.hl7.fhir.r5.renderers.utils.Resolver.ResourceWithReference) Range(org.hl7.fhir.r5.model.Range) RelatedArtifact(org.hl7.fhir.r5.model.RelatedArtifact) IdType(org.hl7.fhir.r5.model.IdType) DateTimeType(org.hl7.fhir.r5.model.DateTimeType) UsageContext(org.hl7.fhir.r5.model.UsageContext) Timing(org.hl7.fhir.r5.model.Timing) CodeableConcept(org.hl7.fhir.r5.model.CodeableConcept) NotImplementedException(org.apache.commons.lang3.NotImplementedException) UriType(org.hl7.fhir.r5.model.UriType) HumanName(org.hl7.fhir.r5.model.HumanName) ContactPoint(org.hl7.fhir.r5.model.ContactPoint) Ratio(org.hl7.fhir.r5.model.Ratio) Enumeration(org.hl7.fhir.r5.model.Enumeration) Reference(org.hl7.fhir.r5.model.Reference) ResourceWithReference(org.hl7.fhir.r5.renderers.utils.Resolver.ResourceWithReference) CodeableReference(org.hl7.fhir.r5.model.CodeableReference) BooleanType(org.hl7.fhir.r5.model.BooleanType) Quantity(org.hl7.fhir.r5.model.Quantity) Base(org.hl7.fhir.r5.model.Base) Annotation(org.hl7.fhir.r5.model.Annotation) Extension(org.hl7.fhir.r5.model.Extension) ContactDetail(org.hl7.fhir.r5.model.ContactDetail) CodeableReference(org.hl7.fhir.r5.model.CodeableReference) Signature(org.hl7.fhir.r5.model.Signature) CodeType(org.hl7.fhir.r5.model.CodeType) Base64BinaryType(org.hl7.fhir.r5.model.Base64BinaryType)

Example 63 with Timing

use of org.hl7.fhir.r4.model.Timing in project org.hl7.fhir.core by hapifhir.

the class NarrativeGenerator method displayLeaf.

private boolean displayLeaf(ResourceWrapper res, BaseWrapper ew, ElementDefinition defn, XhtmlNode x, String name, boolean showCodeDetails) throws FHIRException, UnsupportedEncodingException, IOException {
    if (ew == null)
        return false;
    Base e = ew.getBase();
    if (e == null)
        return false;
    Map<String, String> displayHints = readDisplayHints(defn);
    if (name.endsWith("[x]"))
        name = name.substring(0, name.length() - 3);
    if (!showCodeDetails && e instanceof PrimitiveType && isDefault(displayHints, ((PrimitiveType) e)))
        return false;
    if (e instanceof StringType) {
        x.addText(name + ": " + ((StringType) e).getValue());
        return true;
    } else if (e instanceof CodeType) {
        x.addText(name + ": " + ((CodeType) e).getValue());
        return true;
    } else if (e instanceof IdType) {
        x.addText(name + ": " + ((IdType) e).getValue());
        return true;
    } else if (e instanceof UriType) {
        x.addText(name + ": " + ((UriType) e).getValue());
        return true;
    } else if (e instanceof DateTimeType) {
        x.addText(name + ": " + ((DateTimeType) e).toHumanDisplay());
        return true;
    } else if (e instanceof InstantType) {
        x.addText(name + ": " + ((InstantType) e).toHumanDisplay());
        return true;
    } else if (e instanceof Extension) {
        // x.tx("Extensions: todo");
        return false;
    } else if (e instanceof org.hl7.fhir.dstu3.model.DateType) {
        x.addText(name + ": " + ((org.hl7.fhir.dstu3.model.DateType) e).toHumanDisplay());
        return true;
    } else if (e instanceof Enumeration) {
        // todo: look up a display name if there is one
        x.addText(((Enumeration<?>) e).getValue().toString());
        return true;
    } else if (e instanceof BooleanType) {
        if (((BooleanType) e).getValue()) {
            x.addText(name);
            return true;
        }
    } else if (e instanceof CodeableConcept) {
        renderCodeableConcept((CodeableConcept) e, x, showCodeDetails);
        return true;
    } else if (e instanceof Coding) {
        renderCoding((Coding) e, x, showCodeDetails);
        return true;
    } else if (e instanceof Annotation) {
        renderAnnotation((Annotation) e, x, showCodeDetails);
        return true;
    } else if (e instanceof org.hl7.fhir.dstu3.model.IntegerType) {
        x.addText(Integer.toString(((org.hl7.fhir.dstu3.model.IntegerType) e).getValue()));
        return true;
    } else if (e instanceof org.hl7.fhir.dstu3.model.DecimalType) {
        x.addText(((org.hl7.fhir.dstu3.model.DecimalType) e).getValue().toString());
        return true;
    } else if (e instanceof Identifier) {
        renderIdentifier((Identifier) e, x);
        return true;
    } else if (e instanceof HumanName) {
        renderHumanName((HumanName) e, x);
        return true;
    } else if (e instanceof SampledData) {
        renderSampledData((SampledData) e, x);
        return true;
    } else if (e instanceof Address) {
        renderAddress((Address) e, x);
        return true;
    } else if (e instanceof ContactPoint) {
        renderContactPoint((ContactPoint) e, x);
        return true;
    } else if (e instanceof Timing) {
        renderTiming((Timing) e, x);
        return true;
    } else if (e instanceof Quantity) {
        renderQuantity((Quantity) e, x, showCodeDetails);
        return true;
    } else if (e instanceof Ratio) {
        renderQuantity(((Ratio) e).getNumerator(), x, showCodeDetails);
        x.tx("/");
        renderQuantity(((Ratio) e).getDenominator(), x, showCodeDetails);
        return true;
    } else if (e instanceof Period) {
        Period p = (Period) e;
        x.addText(name + ": ");
        x.addText(!p.hasStart() ? "??" : p.getStartElement().toHumanDisplay());
        x.tx(" --> ");
        x.addText(!p.hasEnd() ? "(ongoing)" : p.getEndElement().toHumanDisplay());
        return true;
    } else if (e instanceof Reference) {
        Reference r = (Reference) e;
        if (r.hasDisplayElement())
            x.addText(r.getDisplay());
        else if (r.hasReferenceElement()) {
            ResourceWithReference tr = resolveReference(res, r.getReference());
            // getDisplayForReference(tr.getReference()));
            x.addText(tr == null ? r.getReference() : "????");
        } else
            x.tx("??");
        return true;
    } else if (e instanceof Narrative) {
        return false;
    } else if (e instanceof Resource) {
        return false;
    } else if (e instanceof ContactDetail) {
        return false;
    } else if (e instanceof Range) {
        return false;
    } else if (e instanceof Meta) {
        return false;
    } else if (e instanceof Dosage) {
        return false;
    } else if (e instanceof Signature) {
        return false;
    } else if (e instanceof UsageContext) {
        return false;
    } else if (e instanceof ElementDefinition) {
        return false;
    } else if (!(e instanceof Attachment))
        throw new NotImplementedException("type " + e.getClass().getName() + " not handled yet");
    return false;
}
Also used : Meta(org.hl7.fhir.dstu3.model.Meta) Address(org.hl7.fhir.dstu3.model.Address) StringType(org.hl7.fhir.dstu3.model.StringType) NotImplementedException(org.apache.commons.lang3.NotImplementedException) Attachment(org.hl7.fhir.dstu3.model.Attachment) Dosage(org.hl7.fhir.dstu3.model.Dosage) UriType(org.hl7.fhir.dstu3.model.UriType) HumanName(org.hl7.fhir.dstu3.model.HumanName) ContactPoint(org.hl7.fhir.dstu3.model.ContactPoint) Identifier(org.hl7.fhir.dstu3.model.Identifier) Coding(org.hl7.fhir.dstu3.model.Coding) Narrative(org.hl7.fhir.dstu3.model.Narrative) SampledData(org.hl7.fhir.dstu3.model.SampledData) PrimitiveType(org.hl7.fhir.dstu3.model.PrimitiveType) Ratio(org.hl7.fhir.dstu3.model.Ratio) ElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition) InstantType(org.hl7.fhir.dstu3.model.InstantType) Enumeration(org.hl7.fhir.dstu3.model.Enumeration) Reference(org.hl7.fhir.dstu3.model.Reference) BooleanType(org.hl7.fhir.dstu3.model.BooleanType) DomainResource(org.hl7.fhir.dstu3.model.DomainResource) MetadataResource(org.hl7.fhir.dstu3.model.MetadataResource) Resource(org.hl7.fhir.dstu3.model.Resource) Quantity(org.hl7.fhir.dstu3.model.Quantity) Period(org.hl7.fhir.dstu3.model.Period) Range(org.hl7.fhir.dstu3.model.Range) Base(org.hl7.fhir.dstu3.model.Base) Annotation(org.hl7.fhir.dstu3.model.Annotation) IdType(org.hl7.fhir.dstu3.model.IdType) Extension(org.hl7.fhir.dstu3.model.Extension) ContactDetail(org.hl7.fhir.dstu3.model.ContactDetail) DateTimeType(org.hl7.fhir.dstu3.model.DateTimeType) UsageContext(org.hl7.fhir.dstu3.model.UsageContext) Signature(org.hl7.fhir.dstu3.model.Signature) CodeType(org.hl7.fhir.dstu3.model.CodeType) EventTiming(org.hl7.fhir.dstu3.model.Timing.EventTiming) Timing(org.hl7.fhir.dstu3.model.Timing) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 64 with Timing

use of org.hl7.fhir.r4.model.Timing in project org.hl7.fhir.core by hapifhir.

the class NarrativeGenerator method displayTiming.

private String displayTiming(Timing s) throws FHIRException {
    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
    if (s.hasCode())
        b.append("Code: " + displayCodeableConcept(s.getCode()));
    if (s.getEvent().size() > 0) {
        CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder();
        for (DateTimeType p : s.getEvent()) {
            c.append(p.toHumanDisplay());
        }
        b.append("Events: " + c.toString());
    }
    if (s.hasRepeat()) {
        TimingRepeatComponent rep = s.getRepeat();
        if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasStart())
            b.append("Starting " + rep.getBoundsPeriod().getStartElement().toHumanDisplay());
        if (rep.hasCount())
            b.append("Count " + Integer.toString(rep.getCount()) + " times");
        if (rep.hasDuration())
            b.append("Duration " + rep.getDuration().toPlainString() + displayTimeUnits(rep.getPeriodUnit()));
        if (rep.hasWhen()) {
            String st = "";
            if (rep.hasOffset()) {
                st = Integer.toString(rep.getOffset()) + "min ";
            }
            b.append("Do " + st);
            for (Enumeration<EventTiming> wh : rep.getWhen()) b.append(displayEventCode(wh.getValue()));
        } else {
            String st = "";
            if (!rep.hasFrequency() || (!rep.hasFrequencyMax() && rep.getFrequency() == 1))
                st = "Once";
            else {
                st = Integer.toString(rep.getFrequency());
                if (rep.hasFrequencyMax())
                    st = st + "-" + Integer.toString(rep.getFrequency());
            }
            if (rep.hasPeriod()) {
                st = st + " per " + rep.getPeriod().toPlainString();
                if (rep.hasPeriodMax())
                    st = st + "-" + rep.getPeriodMax().toPlainString();
                st = st + " " + displayTimeUnits(rep.getPeriodUnit());
            }
            b.append("Do " + st);
        }
        if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasEnd())
            b.append("Until " + rep.getBoundsPeriod().getEndElement().toHumanDisplay());
    }
    return b.toString();
}
Also used : EventTiming(org.hl7.fhir.r4.model.Timing.EventTiming) CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) TimingRepeatComponent(org.hl7.fhir.r4.model.Timing.TimingRepeatComponent)

Example 65 with Timing

use of org.hl7.fhir.r4.model.Timing 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

NotImplementedException (org.apache.commons.lang3.NotImplementedException)14 Timing (org.hl7.fhir.r4.model.Timing)11 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)10 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)9 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)8 Base64 (org.apache.commons.codec.binary.Base64)6 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)6 ArrayList (java.util.ArrayList)5 Date (java.util.Date)5 Timing (org.hl7.fhir.dstu3.model.Timing)5 DateTimeType (org.hl7.fhir.r4.model.DateTimeType)5 Reference (org.hl7.fhir.dstu3.model.Reference)4 EventTiming (org.hl7.fhir.dstu3.model.Timing.EventTiming)4 TimingRepeatComponent (org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent)4 BigDecimal (java.math.BigDecimal)3 Dosage (org.hl7.fhir.r4.model.Dosage)3 Period (org.hl7.fhir.r4.model.Period)3 Quantity (org.hl7.fhir.r4.model.Quantity)3 TimingRepeatComponent (org.hl7.fhir.r4.model.Timing.TimingRepeatComponent)3 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)3