Search in sources :

Example 36 with Dosage

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

the class RdfParser method composeMedicationStatement.

protected void composeMedicationStatement(Complex parent, String parentType, String name, MedicationStatement element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MedicationStatement", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "MedicationStatement", "identifier", element.getIdentifier().get(i), i);
    for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "MedicationStatement", "basedOn", element.getBasedOn().get(i), i);
    for (int i = 0; i < element.getPartOf().size(); i++) composeReference(t, "MedicationStatement", "partOf", element.getPartOf().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "MedicationStatement", "status", element.getStatusElement(), -1);
    for (int i = 0; i < element.getStatusReason().size(); i++) composeCodeableConcept(t, "MedicationStatement", "statusReason", element.getStatusReason().get(i), i);
    if (element.hasCategory())
        composeCodeableConcept(t, "MedicationStatement", "category", element.getCategory(), -1);
    if (element.hasMedication())
        composeType(t, "MedicationStatement", "medication", element.getMedication(), -1);
    if (element.hasSubject())
        composeReference(t, "MedicationStatement", "subject", element.getSubject(), -1);
    if (element.hasContext())
        composeReference(t, "MedicationStatement", "context", element.getContext(), -1);
    if (element.hasEffective())
        composeType(t, "MedicationStatement", "effective", element.getEffective(), -1);
    if (element.hasDateAssertedElement())
        composeDateTime(t, "MedicationStatement", "dateAsserted", element.getDateAssertedElement(), -1);
    if (element.hasInformationSource())
        composeReference(t, "MedicationStatement", "informationSource", element.getInformationSource(), -1);
    for (int i = 0; i < element.getDerivedFrom().size(); i++) composeReference(t, "MedicationStatement", "derivedFrom", element.getDerivedFrom().get(i), i);
    for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "MedicationStatement", "reasonCode", element.getReasonCode().get(i), i);
    for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "MedicationStatement", "reasonReference", element.getReasonReference().get(i), i);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "MedicationStatement", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getDosage().size(); i++) composeDosage(t, "MedicationStatement", "dosage", element.getDosage().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 37 with Dosage

use of org.hl7.fhir.r4.model.Dosage 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);
    for (int i = 0; i < element.getDoseAndRate().size(); i++) composeDosageDosageDoseAndRateComponent(t, "Dosage", "doseAndRate", element.getDoseAndRate().get(i), i);
    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);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 38 with Dosage

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

the class RdfParser method composeMedicationAdministrationMedicationAdministrationDosageComponent.

protected void composeMedicationAdministrationMedicationAdministrationDosageComponent(Complex parent, String parentType, String name, MedicationAdministration.MedicationAdministrationDosageComponent 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, "MedicationAdministration", "text", element.getTextElement(), -1);
    if (element.hasSite())
        composeCodeableConcept(t, "MedicationAdministration", "site", element.getSite(), -1);
    if (element.hasRoute())
        composeCodeableConcept(t, "MedicationAdministration", "route", element.getRoute(), -1);
    if (element.hasMethod())
        composeCodeableConcept(t, "MedicationAdministration", "method", element.getMethod(), -1);
    if (element.hasDose())
        composeQuantity(t, "MedicationAdministration", "dose", element.getDose(), -1);
    if (element.hasRate())
        composeType(t, "MedicationAdministration", "rate", element.getRate(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 39 with Dosage

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

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

the class RdfParser method composeMedicationStatement.

protected void composeMedicationStatement(Complex parent, String parentType, String name, MedicationStatement element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MedicationStatement", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "MedicationStatement", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "MedicationStatement", "status", element.getStatusElement(), -1);
    if (element.hasMedication())
        composeType(t, "MedicationStatement", "medication", element.getMedication(), -1);
    if (element.hasPatient())
        composeReference(t, "MedicationStatement", "patient", element.getPatient(), -1);
    if (element.hasEffective())
        composeType(t, "MedicationStatement", "effective", element.getEffective(), -1);
    if (element.hasInformationSource())
        composeReference(t, "MedicationStatement", "informationSource", element.getInformationSource(), -1);
    for (int i = 0; i < element.getSupportingInformation().size(); i++) composeReference(t, "MedicationStatement", "supportingInformation", element.getSupportingInformation().get(i), i);
    if (element.hasDateAssertedElement())
        composeDateTime(t, "MedicationStatement", "dateAsserted", element.getDateAssertedElement(), -1);
    if (element.hasWasNotTakenElement())
        composeBoolean(t, "MedicationStatement", "wasNotTaken", element.getWasNotTakenElement(), -1);
    for (int i = 0; i < element.getReasonNotTaken().size(); i++) composeCodeableConcept(t, "MedicationStatement", "reasonNotTaken", element.getReasonNotTaken().get(i), i);
    if (element.hasReasonForUse())
        composeType(t, "MedicationStatement", "reasonForUse", element.getReasonForUse(), -1);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "MedicationStatement", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getDosage().size(); i++) composeMedicationStatementMedicationStatementDosageComponent(t, "MedicationStatement", "dosage", element.getDosage().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Aggregations

Dosage (org.hl7.fhir.r4.model.Dosage)8 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)8 Date (java.util.Date)6 ArrayList (java.util.ArrayList)5 Reference (org.hl7.fhir.dstu3.model.Reference)5 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)5 Test (org.junit.Test)5 JsonElement (com.google.gson.JsonElement)4 JsonObject (com.google.gson.JsonObject)4 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)4 Dosage (org.hl7.fhir.dstu3.model.Dosage)4 Coding (org.hl7.fhir.r4.model.Coding)4 Quantity (org.hl7.fhir.r4.model.Quantity)4 NotImplementedException (org.apache.commons.lang3.NotImplementedException)3 Coding (org.hl7.fhir.dstu3.model.Coding)3 Quantity (org.hl7.fhir.dstu3.model.Quantity)3 Timing (org.hl7.fhir.dstu3.model.Timing)3 BooleanType (org.hl7.fhir.r4.model.BooleanType)3 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)3 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)3