Search in sources :

Example 76 with Quantity

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

the class RdfParser method composeSubstanceSubstanceInstanceComponent.

protected void composeSubstanceSubstanceInstanceComponent(Complex parent, String parentType, String name, Substance.SubstanceInstanceComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "instance", name, element, index);
    if (element.hasIdentifier())
        composeIdentifier(t, "Substance", "identifier", element.getIdentifier(), -1);
    if (element.hasExpiryElement())
        composeDateTime(t, "Substance", "expiry", element.getExpiryElement(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "Substance", "quantity", element.getQuantity(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 77 with Quantity

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

the class RdfParser method composeMedicationDispense.

protected void composeMedicationDispense(Complex parent, String parentType, String name, MedicationDispense element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MedicationDispense", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "MedicationDispense", "identifier", element.getIdentifier().get(i), i);
    for (int i = 0; i < element.getPartOf().size(); i++) composeReference(t, "MedicationDispense", "partOf", element.getPartOf().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "MedicationDispense", "status", element.getStatusElement(), -1);
    if (element.hasStatusReason())
        composeType(t, "MedicationDispense", "statusReason", element.getStatusReason(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "MedicationDispense", "category", element.getCategory(), -1);
    if (element.hasMedication())
        composeType(t, "MedicationDispense", "medication", element.getMedication(), -1);
    if (element.hasSubject())
        composeReference(t, "MedicationDispense", "subject", element.getSubject(), -1);
    if (element.hasContext())
        composeReference(t, "MedicationDispense", "context", element.getContext(), -1);
    for (int i = 0; i < element.getSupportingInformation().size(); i++) composeReference(t, "MedicationDispense", "supportingInformation", element.getSupportingInformation().get(i), i);
    for (int i = 0; i < element.getPerformer().size(); i++) composeMedicationDispenseMedicationDispensePerformerComponent(t, "MedicationDispense", "performer", element.getPerformer().get(i), i);
    if (element.hasLocation())
        composeReference(t, "MedicationDispense", "location", element.getLocation(), -1);
    for (int i = 0; i < element.getAuthorizingPrescription().size(); i++) composeReference(t, "MedicationDispense", "authorizingPrescription", element.getAuthorizingPrescription().get(i), i);
    if (element.hasType())
        composeCodeableConcept(t, "MedicationDispense", "type", element.getType(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "MedicationDispense", "quantity", element.getQuantity(), -1);
    if (element.hasDaysSupply())
        composeQuantity(t, "MedicationDispense", "daysSupply", element.getDaysSupply(), -1);
    if (element.hasWhenPreparedElement())
        composeDateTime(t, "MedicationDispense", "whenPrepared", element.getWhenPreparedElement(), -1);
    if (element.hasWhenHandedOverElement())
        composeDateTime(t, "MedicationDispense", "whenHandedOver", element.getWhenHandedOverElement(), -1);
    if (element.hasDestination())
        composeReference(t, "MedicationDispense", "destination", element.getDestination(), -1);
    for (int i = 0; i < element.getReceiver().size(); i++) composeReference(t, "MedicationDispense", "receiver", element.getReceiver().get(i), i);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "MedicationDispense", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getDosageInstruction().size(); i++) composeDosage(t, "MedicationDispense", "dosageInstruction", element.getDosageInstruction().get(i), i);
    if (element.hasSubstitution())
        composeMedicationDispenseMedicationDispenseSubstitutionComponent(t, "MedicationDispense", "substitution", element.getSubstitution(), -1);
    for (int i = 0; i < element.getDetectedIssue().size(); i++) composeReference(t, "MedicationDispense", "detectedIssue", element.getDetectedIssue().get(i), i);
    for (int i = 0; i < element.getEventHistory().size(); i++) composeReference(t, "MedicationDispense", "eventHistory", element.getEventHistory().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 78 with Quantity

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

the class RdfParser method composeMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent.

protected void composeMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent(Complex parent, String parentType, String name, MedicinalProductPackaged.MedicinalProductPackagedPackageItemComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "packageItem", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "MedicinalProductPackaged", "identifier", element.getIdentifier().get(i), i);
    if (element.hasType())
        composeCodeableConcept(t, "MedicinalProductPackaged", "type", element.getType(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "MedicinalProductPackaged", "quantity", element.getQuantity(), -1);
    for (int i = 0; i < element.getMaterial().size(); i++) composeCodeableConcept(t, "MedicinalProductPackaged", "material", element.getMaterial().get(i), i);
    for (int i = 0; i < element.getAlternateMaterial().size(); i++) composeCodeableConcept(t, "MedicinalProductPackaged", "alternateMaterial", element.getAlternateMaterial().get(i), i);
    for (int i = 0; i < element.getDevice().size(); i++) composeReference(t, "MedicinalProductPackaged", "device", element.getDevice().get(i), i);
    for (int i = 0; i < element.getManufacturedItem().size(); i++) composeReference(t, "MedicinalProductPackaged", "manufacturedItem", element.getManufacturedItem().get(i), i);
    for (int i = 0; i < element.getPackageItem().size(); i++) composeMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent(t, "MedicinalProductPackaged", "packageItem", element.getPackageItem().get(i), i);
    if (element.hasPhysicalCharacteristics())
        composeProdCharacteristic(t, "MedicinalProductPackaged", "physicalCharacteristics", element.getPhysicalCharacteristics(), -1);
    for (int i = 0; i < element.getOtherCharacteristics().size(); i++) composeCodeableConcept(t, "MedicinalProductPackaged", "otherCharacteristics", element.getOtherCharacteristics().get(i), i);
    for (int i = 0; i < element.getShelfLifeStorage().size(); i++) composeProductShelfLife(t, "MedicinalProductPackaged", "shelfLifeStorage", element.getShelfLifeStorage().get(i), i);
    for (int i = 0; i < element.getManufacturer().size(); i++) composeReference(t, "MedicinalProductPackaged", "manufacturer", element.getManufacturer().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 79 with Quantity

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

the class RdfParser method composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent.

protected void composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "administration", name, element, index);
    if (element.hasSchedule())
        composeTiming(t, "NutritionOrder", "schedule", element.getSchedule(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "NutritionOrder", "quantity", element.getQuantity(), -1);
    if (element.hasRate())
        composeType(t, "NutritionOrder", "rate", element.getRate(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 80 with Quantity

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

the class RdfParser method composeGroup.

protected void composeGroup(Complex parent, String parentType, String name, Group element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Group", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Group", "identifier", element.getIdentifier().get(i), i);
    if (element.hasActiveElement())
        composeBoolean(t, "Group", "active", element.getActiveElement(), -1);
    if (element.hasTypeElement())
        composeEnum(t, "Group", "type", element.getTypeElement(), -1);
    if (element.hasActualElement())
        composeBoolean(t, "Group", "actual", element.getActualElement(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "Group", "code", element.getCode(), -1);
    if (element.hasNameElement())
        composeString(t, "Group", "name", element.getNameElement(), -1);
    if (element.hasQuantityElement())
        composeUnsignedInt(t, "Group", "quantity", element.getQuantityElement(), -1);
    if (element.hasManagingEntity())
        composeReference(t, "Group", "managingEntity", element.getManagingEntity(), -1);
    for (int i = 0; i < element.getCharacteristic().size(); i++) composeGroupGroupCharacteristicComponent(t, "Group", "characteristic", element.getCharacteristic().get(i), i);
    for (int i = 0; i < element.getMember().size(); i++) composeGroupGroupMemberComponent(t, "Group", "member", element.getMember().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Aggregations

Quantity (org.hl7.fhir.r4.model.Quantity)58 ArrayList (java.util.ArrayList)47 Test (org.junit.jupiter.api.Test)40 BigDecimal (java.math.BigDecimal)39 Quantity (org.hl7.fhir.dstu3.model.Quantity)39 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)37 Test (org.junit.Test)25 List (java.util.List)24 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)23 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)23 NotImplementedException (org.apache.commons.lang3.NotImplementedException)19 FHIRException (org.hl7.fhir.exceptions.FHIRException)18 PathEngineException (org.hl7.fhir.exceptions.PathEngineException)18 Observation (org.hl7.fhir.r4.model.Observation)18 UcumException (org.fhir.ucum.UcumException)16 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)16 Resource (org.hl7.fhir.r4.model.Resource)16 Quantity (org.hl7.fhir.r5.model.Quantity)16 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)15 Coding (org.hl7.fhir.r4.model.Coding)13