Search in sources :

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

Example 57 with Quantity

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

the class RdfParser method composeNutritionOrderNutritionOrderSupplementComponent.

protected void composeNutritionOrderNutritionOrderSupplementComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderSupplementComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "supplement", name, element, index);
    if (element.hasType())
        composeCodeableConcept(t, "NutritionOrder", "type", element.getType(), -1);
    if (element.hasProductNameElement())
        composeString(t, "NutritionOrder", "productName", element.getProductNameElement(), -1);
    for (int i = 0; i < element.getSchedule().size(); i++) composeTiming(t, "NutritionOrder", "schedule", element.getSchedule().get(i), i);
    if (element.hasQuantity())
        composeQuantity(t, "NutritionOrder", "quantity", element.getQuantity(), -1);
    if (element.hasInstructionElement())
        composeString(t, "NutritionOrder", "instruction", element.getInstructionElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 58 with Quantity

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

the class RdfParser method composeMedicationRequestMedicationRequestDispenseRequestComponent.

protected void composeMedicationRequestMedicationRequestDispenseRequestComponent(Complex parent, String parentType, String name, MedicationRequest.MedicationRequestDispenseRequestComponent 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.hasValidityPeriod())
        composePeriod(t, "MedicationRequest", "validityPeriod", element.getValidityPeriod(), -1);
    if (element.hasNumberOfRepeatsAllowedElement())
        composePositiveInt(t, "MedicationRequest", "numberOfRepeatsAllowed", element.getNumberOfRepeatsAllowedElement(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "MedicationRequest", "quantity", element.getQuantity(), -1);
    if (element.hasExpectedSupplyDuration())
        composeDuration(t, "MedicationRequest", "expectedSupplyDuration", element.getExpectedSupplyDuration(), -1);
    if (element.hasPerformer())
        composeReference(t, "MedicationRequest", "performer", element.getPerformer(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 59 with Quantity

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

the class RdfParser method composeClaimDetailComponent.

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

Example 60 with Quantity

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

the class RdfParser method composeClaimItemsComponent.

protected void composeClaimItemsComponent(Complex parent, String parentType, String name, Claim.ItemsComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "item", name, element, index);
    if (element.hasSequenceElement())
        composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
    if (element.hasType())
        composeCoding(t, "Claim", "type", element.getType(), -1);
    if (element.hasProvider())
        composeType(t, "Claim", "provider", element.getProvider(), -1);
    if (element.hasSupervisor())
        composeType(t, "Claim", "supervisor", element.getSupervisor(), -1);
    if (element.hasProviderQualification())
        composeCoding(t, "Claim", "providerQualification", element.getProviderQualification(), -1);
    for (int i = 0; i < element.getDiagnosisLinkId().size(); i++) composePositiveInt(t, "Claim", "diagnosisLinkId", element.getDiagnosisLinkId().get(i), i);
    if (element.hasService())
        composeCoding(t, "Claim", "service", element.getService(), -1);
    for (int i = 0; i < element.getServiceModifier().size(); i++) composeCoding(t, "Claim", "serviceModifier", element.getServiceModifier().get(i), i);
    for (int i = 0; i < element.getModifier().size(); i++) composeCoding(t, "Claim", "modifier", element.getModifier().get(i), i);
    for (int i = 0; i < element.getProgramCode().size(); i++) composeCoding(t, "Claim", "programCode", element.getProgramCode().get(i), i);
    if (element.hasServiced())
        composeType(t, "Claim", "serviced", element.getServiced(), -1);
    if (element.hasPlace())
        composeCoding(t, "Claim", "place", element.getPlace(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeQuantity(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
    if (element.hasPointsElement())
        composeDecimal(t, "Claim", "points", element.getPointsElement(), -1);
    if (element.hasNet())
        composeQuantity(t, "Claim", "net", element.getNet(), -1);
    for (int i = 0; i < element.getUdi().size(); i++) composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
    if (element.hasBodySite())
        composeCoding(t, "Claim", "bodySite", element.getBodySite(), -1);
    for (int i = 0; i < element.getSubSite().size(); i++) composeCoding(t, "Claim", "subSite", element.getSubSite().get(i), i);
    for (int i = 0; i < element.getDetail().size(); i++) composeClaimDetailComponent(t, "Claim", "detail", element.getDetail().get(i), i);
    if (element.hasProsthesis())
        composeClaimProsthesisComponent(t, "Claim", "prosthesis", element.getProsthesis(), -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