Search in sources :

Example 81 with Quantity

use of org.hl7.fhir.r4.model.Quantity 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.hasSubtitleElement())
        composeString(t, "ActivityDefinition", "subtitle", element.getSubtitleElement(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "ActivityDefinition", "status", element.getStatusElement(), -1);
    if (element.hasExperimentalElement())
        composeBoolean(t, "ActivityDefinition", "experimental", element.getExperimentalElement(), -1);
    if (element.hasSubject())
        composeType(t, "ActivityDefinition", "subject", element.getSubject(), -1);
    if (element.hasDateElement())
        composeDateTime(t, "ActivityDefinition", "date", element.getDateElement(), -1);
    if (element.hasPublisherElement())
        composeString(t, "ActivityDefinition", "publisher", element.getPublisherElement(), -1);
    for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "ActivityDefinition", "contact", element.getContact().get(i), i);
    if (element.hasDescriptionElement())
        composeMarkdown(t, "ActivityDefinition", "description", element.getDescriptionElement(), -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);
    if (element.hasPurposeElement())
        composeMarkdown(t, "ActivityDefinition", "purpose", element.getPurposeElement(), -1);
    if (element.hasUsageElement())
        composeString(t, "ActivityDefinition", "usage", element.getUsageElement(), -1);
    if (element.hasCopyrightElement())
        composeMarkdown(t, "ActivityDefinition", "copyright", element.getCopyrightElement(), -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.getTopic().size(); i++) composeCodeableConcept(t, "ActivityDefinition", "topic", element.getTopic().get(i), i);
    for (int i = 0; i < element.getAuthor().size(); i++) composeContactDetail(t, "ActivityDefinition", "author", element.getAuthor().get(i), i);
    for (int i = 0; i < element.getEditor().size(); i++) composeContactDetail(t, "ActivityDefinition", "editor", element.getEditor().get(i), i);
    for (int i = 0; i < element.getReviewer().size(); i++) composeContactDetail(t, "ActivityDefinition", "reviewer", element.getReviewer().get(i), i);
    for (int i = 0; i < element.getEndorser().size(); i++) composeContactDetail(t, "ActivityDefinition", "endorser", element.getEndorser().get(i), i);
    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++) composeCanonical(t, "ActivityDefinition", "library", element.getLibrary().get(i), i);
    if (element.hasKindElement())
        composeEnum(t, "ActivityDefinition", "kind", element.getKindElement(), -1);
    if (element.hasProfileElement())
        composeCanonical(t, "ActivityDefinition", "profile", element.getProfileElement(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "ActivityDefinition", "code", element.getCode(), -1);
    if (element.hasIntentElement())
        composeEnum(t, "ActivityDefinition", "intent", element.getIntentElement(), -1);
    if (element.hasPriorityElement())
        composeEnum(t, "ActivityDefinition", "priority", element.getPriorityElement(), -1);
    if (element.hasDoNotPerformElement())
        composeBoolean(t, "ActivityDefinition", "doNotPerform", element.getDoNotPerformElement(), -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);
    for (int i = 0; i < element.getSpecimenRequirement().size(); i++) composeReference(t, "ActivityDefinition", "specimenRequirement", element.getSpecimenRequirement().get(i), i);
    for (int i = 0; i < element.getObservationRequirement().size(); i++) composeReference(t, "ActivityDefinition", "observationRequirement", element.getObservationRequirement().get(i), i);
    for (int i = 0; i < element.getObservationResultRequirement().size(); i++) composeReference(t, "ActivityDefinition", "observationResultRequirement", element.getObservationResultRequirement().get(i), i);
    if (element.hasTransformElement())
        composeCanonical(t, "ActivityDefinition", "transform", element.getTransformElement(), -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.r4.utils.formats.Turtle.Complex)

Example 82 with Quantity

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

the class RdfParser method composeMedicationKnowledgeMedicationKnowledgePackagingComponent.

protected void composeMedicationKnowledgeMedicationKnowledgePackagingComponent(Complex parent, String parentType, String name, MedicationKnowledge.MedicationKnowledgePackagingComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "packaging", name, element, index);
    if (element.hasType())
        composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "MedicationKnowledge", "quantity", element.getQuantity(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 83 with Quantity

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

the class RdfParser method composeClaimResponseAddedItemDetailComponent.

protected void composeClaimResponseAddedItemDetailComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemDetailComponent 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.hasProductOrService())
        composeCodeableConcept(t, "ClaimResponse", "productOrService", element.getProductOrService(), -1);
    for (int i = 0; i < element.getModifier().size(); i++) composeCodeableConcept(t, "ClaimResponse", "modifier", element.getModifier().get(i), i);
    if (element.hasQuantity())
        composeQuantity(t, "ClaimResponse", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeMoney(t, "ClaimResponse", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "ClaimResponse", "factor", element.getFactorElement(), -1);
    if (element.hasNet())
        composeMoney(t, "ClaimResponse", "net", element.getNet(), -1);
    for (int i = 0; i < element.getNoteNumber().size(); i++) composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
    for (int i = 0; i < element.getAdjudication().size(); i++) composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
    for (int i = 0; i < element.getSubDetail().size(); i++) composeClaimResponseAddedItemSubDetailComponent(t, "ClaimResponse", "subDetail", element.getSubDetail().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 84 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.hasRevenue())
        composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
    if (element.hasProductOrService())
        composeCodeableConcept(t, "Claim", "productOrService", element.getProductOrService(), -1);
    for (int i = 0; i < element.getModifier().size(); i++) composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
    for (int i = 0; i < element.getProgramCode().size(); i++) composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
    if (element.hasQuantity())
        composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
    if (element.hasNet())
        composeMoney(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.r4.utils.formats.Turtle.Complex)

Example 85 with Quantity

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

the class RdfParser method composeContractValuedItemComponent.

protected void composeContractValuedItemComponent(Complex parent, String parentType, String name, Contract.ValuedItemComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "valuedItem", name, element, index);
    if (element.hasEntity())
        composeType(t, "Contract", "entity", element.getEntity(), -1);
    if (element.hasIdentifier())
        composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
    if (element.hasEffectiveTimeElement())
        composeDateTime(t, "Contract", "effectiveTime", element.getEffectiveTimeElement(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "Contract", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeMoney(t, "Contract", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "Contract", "factor", element.getFactorElement(), -1);
    if (element.hasPointsElement())
        composeDecimal(t, "Contract", "points", element.getPointsElement(), -1);
    if (element.hasNet())
        composeMoney(t, "Contract", "net", element.getNet(), -1);
    if (element.hasPaymentElement())
        composeString(t, "Contract", "payment", element.getPaymentElement(), -1);
    if (element.hasPaymentDateElement())
        composeDateTime(t, "Contract", "paymentDate", element.getPaymentDateElement(), -1);
    if (element.hasResponsible())
        composeReference(t, "Contract", "responsible", element.getResponsible(), -1);
    if (element.hasRecipient())
        composeReference(t, "Contract", "recipient", element.getRecipient(), -1);
    for (int i = 0; i < element.getLinkId().size(); i++) composeString(t, "Contract", "linkId", element.getLinkId().get(i), i);
    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++) composeUnsignedInt(t, "Contract", "securityLabelNumber", element.getSecurityLabelNumber().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