Search in sources :

Example 66 with Quantity

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

the class RdfParser method composeExplanationOfBenefitSubDetailComponent.

protected void composeExplanationOfBenefitSubDetailComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.SubDetailComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "subDetail", name, element, index);
    if (element.hasSequenceElement())
        composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
    if (element.hasType())
        composeCoding(t, "ExplanationOfBenefit", "type", element.getType(), -1);
    if (element.hasService())
        composeCoding(t, "ExplanationOfBenefit", "service", element.getService(), -1);
    for (int i = 0; i < element.getProgramCode().size(); i++) composeCoding(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
    if (element.hasQuantity())
        composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeQuantity(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
    if (element.hasPointsElement())
        composeDecimal(t, "ExplanationOfBenefit", "points", element.getPointsElement(), -1);
    if (element.hasNet())
        composeQuantity(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
    for (int i = 0; i < element.getUdi().size(); i++) composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
    for (int i = 0; i < element.getAdjudication().size(); i++) composeExplanationOfBenefitSubDetailAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 67 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.dstu2016may.formats.RdfGenerator.Complex)

Example 68 with Quantity

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

the class RdfParser method composeMedicationOrderMedicationOrderDispenseRequestComponent.

protected void composeMedicationOrderMedicationOrderDispenseRequestComponent(Complex parent, String parentType, String name, MedicationOrder.MedicationOrderDispenseRequestComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "dispenseRequest", name, element, index);
    if (element.hasMedication())
        composeType(t, "MedicationOrder", "medication", element.getMedication(), -1);
    if (element.hasValidityPeriod())
        composePeriod(t, "MedicationOrder", "validityPeriod", element.getValidityPeriod(), -1);
    if (element.hasNumberOfRepeatsAllowedElement())
        composePositiveInt(t, "MedicationOrder", "numberOfRepeatsAllowed", element.getNumberOfRepeatsAllowedElement(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "MedicationOrder", "quantity", element.getQuantity(), -1);
    if (element.hasExpectedSupplyDuration())
        composeQuantity(t, "MedicationOrder", "expectedSupplyDuration", element.getExpectedSupplyDuration(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 69 with Quantity

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

the class RdfParser method composeSubstanceSubstanceIngredientComponent.

protected void composeSubstanceSubstanceIngredientComponent(Complex parent, String parentType, String name, Substance.SubstanceIngredientComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "ingredient", name, element, index);
    if (element.hasQuantity())
        composeRatio(t, "Substance", "quantity", element.getQuantity(), -1);
    if (element.hasSubstance())
        composeReference(t, "Substance", "substance", element.getSubstance(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 70 with Quantity

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

the class RdfParser method composeQuantity.

protected void composeQuantity(Complex parent, String parentType, String name, Quantity element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeElement(t, "Quantity", name, element, index);
    if (element.hasValueElement())
        composeDecimal(t, "Quantity", "value", element.getValueElement(), -1);
    if (element.hasComparatorElement())
        composeEnum(t, "Quantity", "comparator", element.getComparatorElement(), -1);
    if (element.hasUnitElement())
        composeString(t, "Quantity", "unit", element.getUnitElement(), -1);
    if (element.hasSystemElement())
        composeUri(t, "Quantity", "system", element.getSystemElement(), -1);
    if (element.hasCodeElement())
        composeCode(t, "Quantity", "code", element.getCodeElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.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