Search in sources :

Example 6 with Timing

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

the class RdfParser method composeMedicationDispenseMedicationDispenseDosageInstructionComponent.

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

Example 7 with Timing

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

the class RdfParser method composeTiming.

protected void composeTiming(Complex parent, String parentType, String name, Timing element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeElement(t, "Timing", name, element, index);
    for (int i = 0; i < element.getEvent().size(); i++) composeDateTime(t, "Timing", "event", element.getEvent().get(i), i);
    if (element.hasRepeat())
        composeTimingTimingRepeatComponent(t, "Timing", "repeat", element.getRepeat(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "Timing", "code", element.getCode(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 8 with Timing

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

the class RdfParser method composeActivityDefinition.

protected void composeActivityDefinition(Complex parent, String parentType, String name, ActivityDefinition element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "ActivityDefinition", name, element, index);
    if (element.hasUrlElement())
        composeUri(t, "ActivityDefinition", "url", element.getUrlElement(), -1);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ActivityDefinition", "identifier", element.getIdentifier().get(i), i);
    if (element.hasVersionElement())
        composeString(t, "ActivityDefinition", "version", element.getVersionElement(), -1);
    if (element.hasNameElement())
        composeString(t, "ActivityDefinition", "name", element.getNameElement(), -1);
    if (element.hasTitleElement())
        composeString(t, "ActivityDefinition", "title", element.getTitleElement(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "ActivityDefinition", "status", element.getStatusElement(), -1);
    if (element.hasExperimentalElement())
        composeBoolean(t, "ActivityDefinition", "experimental", element.getExperimentalElement(), -1);
    if (element.hasDateElement())
        composeDateTime(t, "ActivityDefinition", "date", element.getDateElement(), -1);
    if (element.hasPublisherElement())
        composeString(t, "ActivityDefinition", "publisher", element.getPublisherElement(), -1);
    if (element.hasDescriptionElement())
        composeMarkdown(t, "ActivityDefinition", "description", element.getDescriptionElement(), -1);
    if (element.hasPurposeElement())
        composeMarkdown(t, "ActivityDefinition", "purpose", element.getPurposeElement(), -1);
    if (element.hasUsageElement())
        composeString(t, "ActivityDefinition", "usage", element.getUsageElement(), -1);
    if (element.hasApprovalDateElement())
        composeDate(t, "ActivityDefinition", "approvalDate", element.getApprovalDateElement(), -1);
    if (element.hasLastReviewDateElement())
        composeDate(t, "ActivityDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
    if (element.hasEffectivePeriod())
        composePeriod(t, "ActivityDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
    for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "ActivityDefinition", "useContext", element.getUseContext().get(i), i);
    for (int i = 0; i < element.getJurisdiction().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
    for (int i = 0; i < element.getTopic().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "topic", element.getTopic().get(i), i);
    for (int i = 0; i < element.getContributor().size(); i++) composeContributor(t, "ActivityDefinition", "contributor", element.getContributor().get(i), i);
    for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "ActivityDefinition", "contact", element.getContact().get(i), i);
    if (element.hasCopyrightElement())
        composeMarkdown(t, "ActivityDefinition", "copyright", element.getCopyrightElement(), -1);
    for (int i = 0; i < element.getRelatedArtifact().size(); i++) composeRelatedArtifact(t, "ActivityDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
    for (int i = 0; i < element.getLibrary().size(); i++) composeReference(t, "ActivityDefinition", "library", element.getLibrary().get(i), i);
    if (element.hasKindElement())
        composeEnum(t, "ActivityDefinition", "kind", element.getKindElement(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "ActivityDefinition", "code", element.getCode(), -1);
    if (element.hasTiming())
        composeType(t, "ActivityDefinition", "timing", element.getTiming(), -1);
    if (element.hasLocation())
        composeReference(t, "ActivityDefinition", "location", element.getLocation(), -1);
    for (int i = 0; i < element.getParticipant().size(); i++) composeActivityDefinitionActivityDefinitionParticipantComponent(t, "ActivityDefinition", "participant", element.getParticipant().get(i), i);
    if (element.hasProduct())
        composeType(t, "ActivityDefinition", "product", element.getProduct(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "ActivityDefinition", "quantity", element.getQuantity(), -1);
    for (int i = 0; i < element.getDosage().size(); i++) composeDosage(t, "ActivityDefinition", "dosage", element.getDosage().get(i), i);
    for (int i = 0; i < element.getBodySite().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "bodySite", element.getBodySite().get(i), i);
    if (element.hasTransform())
        composeReference(t, "ActivityDefinition", "transform", element.getTransform(), -1);
    for (int i = 0; i < element.getDynamicValue().size(); i++) composeActivityDefinitionActivityDefinitionDynamicValueComponent(t, "ActivityDefinition", "dynamicValue", element.getDynamicValue().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 9 with Timing

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

the class RdfParser method composeExplanationOfBenefitSupportingInformationComponent.

protected void composeExplanationOfBenefitSupportingInformationComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.SupportingInformationComponent 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, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "ExplanationOfBenefit", "code", element.getCode(), -1);
    if (element.hasTiming())
        composeType(t, "ExplanationOfBenefit", "timing", element.getTiming(), -1);
    if (element.hasValue())
        composeType(t, "ExplanationOfBenefit", "value", element.getValue(), -1);
    if (element.hasReason())
        composeCoding(t, "ExplanationOfBenefit", "reason", element.getReason(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 10 with Timing

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

the class Convert method makeTimingFromBoundedPIVL.

private Timing makeTimingFromBoundedPIVL(Element ivl, Element pivl) throws Exception {
    Timing t = new Timing();
    t.setRepeat(new TimingRepeatComponent());
    Element p = cda.getChild(pivl, "period");
    t.getRepeat().setBounds(makePeriodFromIVL(ivl));
    t.getRepeat().setPeriod(new BigDecimal(p.getAttribute("value")));
    t.getRepeat().setPeriodUnit(convertTimeUnit(p.getAttribute("unit")));
    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) BigDecimal(java.math.BigDecimal)

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