Search in sources :

Example 11 with Timing

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

the class Convert method makeTimingFromBoundedEIVL.

private Type makeTimingFromBoundedEIVL(Element ivl, Element eivl) throws Exception {
    Timing t = new Timing();
    t.setRepeat(new TimingRepeatComponent());
    Element e = cda.getChild(eivl, "event");
    t.getRepeat().setBounds(makePeriodFromIVL(ivl));
    t.getRepeat().addWhen(convertEventTiming(e.getAttribute("code")));
    return t;
}
Also used : Element(org.w3c.dom.Element) TimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent) EventTiming(org.hl7.fhir.dstu3.model.Timing.EventTiming)

Example 12 with Timing

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

the class JsonParser method composeType.

protected void composeType(String prefix, Type type) throws IOException {
    if (type == null)
        ;
    else if (type instanceof Age)
        composeAge(prefix + "Age", (Age) type);
    else if (type instanceof Count)
        composeCount(prefix + "Count", (Count) type);
    else if (type instanceof Money)
        composeMoney(prefix + "Money", (Money) type);
    else if (type instanceof Distance)
        composeDistance(prefix + "Distance", (Distance) type);
    else if (type instanceof Duration)
        composeDuration(prefix + "Duration", (Duration) type);
    else if (type instanceof SimpleQuantity)
        composeSimpleQuantity(prefix + "SimpleQuantity", (SimpleQuantity) type);
    else if (type instanceof Period)
        composePeriod(prefix + "Period", (Period) type);
    else if (type instanceof Coding)
        composeCoding(prefix + "Coding", (Coding) type);
    else if (type instanceof Range)
        composeRange(prefix + "Range", (Range) type);
    else if (type instanceof Quantity)
        composeQuantity(prefix + "Quantity", (Quantity) type);
    else if (type instanceof Attachment)
        composeAttachment(prefix + "Attachment", (Attachment) type);
    else if (type instanceof Ratio)
        composeRatio(prefix + "Ratio", (Ratio) type);
    else if (type instanceof Annotation)
        composeAnnotation(prefix + "Annotation", (Annotation) type);
    else if (type instanceof SampledData)
        composeSampledData(prefix + "SampledData", (SampledData) type);
    else if (type instanceof Reference)
        composeReference(prefix + "Reference", (Reference) type);
    else if (type instanceof CodeableConcept)
        composeCodeableConcept(prefix + "CodeableConcept", (CodeableConcept) type);
    else if (type instanceof Identifier)
        composeIdentifier(prefix + "Identifier", (Identifier) type);
    else if (type instanceof Signature)
        composeSignature(prefix + "Signature", (Signature) type);
    else if (type instanceof TriggerDefinition)
        composeTriggerDefinition(prefix + "TriggerDefinition", (TriggerDefinition) type);
    else if (type instanceof ElementDefinition)
        composeElementDefinition(prefix + "ElementDefinition", (ElementDefinition) type);
    else if (type instanceof Timing)
        composeTiming(prefix + "Timing", (Timing) type);
    else if (type instanceof ModuleMetadata)
        composeModuleMetadata(prefix + "ModuleMetadata", (ModuleMetadata) type);
    else if (type instanceof ActionDefinition)
        composeActionDefinition(prefix + "ActionDefinition", (ActionDefinition) type);
    else if (type instanceof Address)
        composeAddress(prefix + "Address", (Address) type);
    else if (type instanceof HumanName)
        composeHumanName(prefix + "HumanName", (HumanName) type);
    else if (type instanceof DataRequirement)
        composeDataRequirement(prefix + "DataRequirement", (DataRequirement) type);
    else if (type instanceof Meta)
        composeMeta(prefix + "Meta", (Meta) type);
    else if (type instanceof ParameterDefinition)
        composeParameterDefinition(prefix + "ParameterDefinition", (ParameterDefinition) type);
    else if (type instanceof ContactPoint)
        composeContactPoint(prefix + "ContactPoint", (ContactPoint) type);
    else if (type instanceof MarkdownType) {
        composeMarkdownCore(prefix + "Markdown", (MarkdownType) type, false);
        composeMarkdownExtras(prefix + "Markdown", (MarkdownType) type, false);
    } else if (type instanceof UnsignedIntType) {
        composeUnsignedIntCore(prefix + "UnsignedInt", (UnsignedIntType) type, false);
        composeUnsignedIntExtras(prefix + "UnsignedInt", (UnsignedIntType) type, false);
    } else if (type instanceof CodeType) {
        composeCodeCore(prefix + "Code", (CodeType) type, false);
        composeCodeExtras(prefix + "Code", (CodeType) type, false);
    } else if (type instanceof IdType) {
        composeIdCore(prefix + "Id", (IdType) type, false);
        composeIdExtras(prefix + "Id", (IdType) type, false);
    } else if (type instanceof OidType) {
        composeOidCore(prefix + "Oid", (OidType) type, false);
        composeOidExtras(prefix + "Oid", (OidType) type, false);
    } else if (type instanceof PositiveIntType) {
        composePositiveIntCore(prefix + "PositiveInt", (PositiveIntType) type, false);
        composePositiveIntExtras(prefix + "PositiveInt", (PositiveIntType) type, false);
    } else if (type instanceof UuidType) {
        composeUuidCore(prefix + "Uuid", (UuidType) type, false);
        composeUuidExtras(prefix + "Uuid", (UuidType) type, false);
    } else if (type instanceof IntegerType) {
        composeIntegerCore(prefix + "Integer", (IntegerType) type, false);
        composeIntegerExtras(prefix + "Integer", (IntegerType) type, false);
    } else if (type instanceof DateTimeType) {
        composeDateTimeCore(prefix + "DateTime", (DateTimeType) type, false);
        composeDateTimeExtras(prefix + "DateTime", (DateTimeType) type, false);
    } else if (type instanceof DateType) {
        composeDateCore(prefix + "Date", (DateType) type, false);
        composeDateExtras(prefix + "Date", (DateType) type, false);
    } else if (type instanceof DecimalType) {
        composeDecimalCore(prefix + "Decimal", (DecimalType) type, false);
        composeDecimalExtras(prefix + "Decimal", (DecimalType) type, false);
    } else if (type instanceof UriType) {
        composeUriCore(prefix + "Uri", (UriType) type, false);
        composeUriExtras(prefix + "Uri", (UriType) 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 StringType) {
        composeStringCore(prefix + "String", (StringType) type, false);
        composeStringExtras(prefix + "String", (StringType) type, false);
    } else if (type instanceof BooleanType) {
        composeBooleanCore(prefix + "Boolean", (BooleanType) type, false);
        composeBooleanExtras(prefix + "Boolean", (BooleanType) type, false);
    } else if (type instanceof InstantType) {
        composeInstantCore(prefix + "Instant", (InstantType) type, false);
        composeInstantExtras(prefix + "Instant", (InstantType) type, false);
    } else
        throw new Error("Unhandled type");
}
Also used : FHIRFormatError(org.hl7.fhir.exceptions.FHIRFormatError)

Example 13 with Timing

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

the class RdfParser method composeClaimSpecialConditionComponent.

protected void composeClaimSpecialConditionComponent(Complex parent, String parentType, String name, Claim.SpecialConditionComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "information", name, element, index);
    if (element.hasSequenceElement())
        composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "Claim", "code", element.getCode(), -1);
    if (element.hasTiming())
        composeType(t, "Claim", "timing", element.getTiming(), -1);
    if (element.hasValue())
        composeType(t, "Claim", "value", element.getValue(), -1);
    if (element.hasReason())
        composeCodeableConcept(t, "Claim", "reason", element.getReason(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 14 with Timing

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

the class RdfParser method composeDosage.

protected void composeDosage(Complex parent, String parentType, String name, Dosage element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeElement(t, "Dosage", name, element, index);
    if (element.hasSequenceElement())
        composeInteger(t, "Dosage", "sequence", element.getSequenceElement(), -1);
    if (element.hasTextElement())
        composeString(t, "Dosage", "text", element.getTextElement(), -1);
    for (int i = 0; i < element.getAdditionalInstruction().size(); i++) composeCodeableConcept(t, "Dosage", "additionalInstruction", element.getAdditionalInstruction().get(i), i);
    if (element.hasPatientInstructionElement())
        composeString(t, "Dosage", "patientInstruction", element.getPatientInstructionElement(), -1);
    if (element.hasTiming())
        composeTiming(t, "Dosage", "timing", element.getTiming(), -1);
    if (element.hasAsNeeded())
        composeType(t, "Dosage", "asNeeded", element.getAsNeeded(), -1);
    if (element.hasSite())
        composeCodeableConcept(t, "Dosage", "site", element.getSite(), -1);
    if (element.hasRoute())
        composeCodeableConcept(t, "Dosage", "route", element.getRoute(), -1);
    if (element.hasMethod())
        composeCodeableConcept(t, "Dosage", "method", element.getMethod(), -1);
    if (element.hasDose())
        composeType(t, "Dosage", "dose", element.getDose(), -1);
    if (element.hasMaxDosePerPeriod())
        composeRatio(t, "Dosage", "maxDosePerPeriod", element.getMaxDosePerPeriod(), -1);
    if (element.hasMaxDosePerAdministration())
        composeQuantity(t, "Dosage", "maxDosePerAdministration", element.getMaxDosePerAdministration(), -1);
    if (element.hasMaxDosePerLifetime())
        composeQuantity(t, "Dosage", "maxDosePerLifetime", element.getMaxDosePerLifetime(), -1);
    if (element.hasRate())
        composeType(t, "Dosage", "rate", element.getRate(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 15 with Timing

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

the class RdfParser method composeDeviceUseStatement.

protected void composeDeviceUseStatement(Complex parent, String parentType, String name, DeviceUseStatement element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "DeviceUseStatement", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "DeviceUseStatement", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "DeviceUseStatement", "status", element.getStatusElement(), -1);
    if (element.hasSubject())
        composeReference(t, "DeviceUseStatement", "subject", element.getSubject(), -1);
    if (element.hasWhenUsed())
        composePeriod(t, "DeviceUseStatement", "whenUsed", element.getWhenUsed(), -1);
    if (element.hasTiming())
        composeType(t, "DeviceUseStatement", "timing", element.getTiming(), -1);
    if (element.hasRecordedOnElement())
        composeDateTime(t, "DeviceUseStatement", "recordedOn", element.getRecordedOnElement(), -1);
    if (element.hasSource())
        composeReference(t, "DeviceUseStatement", "source", element.getSource(), -1);
    if (element.hasDevice())
        composeReference(t, "DeviceUseStatement", "device", element.getDevice(), -1);
    for (int i = 0; i < element.getIndication().size(); i++) composeCodeableConcept(t, "DeviceUseStatement", "indication", element.getIndication().get(i), i);
    if (element.hasBodySite())
        composeCodeableConcept(t, "DeviceUseStatement", "bodySite", element.getBodySite(), -1);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "DeviceUseStatement", "note", element.getNote().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

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