Search in sources :

Example 46 with Quantity

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

the class RdfParser method composeSupplyRequestSupplyRequestOrderedItemComponent.

protected void composeSupplyRequestSupplyRequestOrderedItemComponent(Complex parent, String parentType, String name, SupplyRequest.SupplyRequestOrderedItemComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "orderedItem", name, element, index);
    if (element.hasQuantity())
        composeQuantity(t, "SupplyRequest", "quantity", element.getQuantity(), -1);
    if (element.hasItem())
        composeType(t, "SupplyRequest", "item", element.getItem(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 47 with Quantity

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

the class RdfParser method composeExplanationOfBenefitItemComponent.

protected void composeExplanationOfBenefitItemComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.ItemComponent 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, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
    for (int i = 0; i < element.getCareTeamLinkId().size(); i++) composePositiveInt(t, "ExplanationOfBenefit", "careTeamLinkId", element.getCareTeamLinkId().get(i), i);
    for (int i = 0; i < element.getDiagnosisLinkId().size(); i++) composePositiveInt(t, "ExplanationOfBenefit", "diagnosisLinkId", element.getDiagnosisLinkId().get(i), i);
    for (int i = 0; i < element.getProcedureLinkId().size(); i++) composePositiveInt(t, "ExplanationOfBenefit", "procedureLinkId", element.getProcedureLinkId().get(i), i);
    for (int i = 0; i < element.getInformationLinkId().size(); i++) composePositiveInt(t, "ExplanationOfBenefit", "informationLinkId", element.getInformationLinkId().get(i), i);
    if (element.hasRevenue())
        composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
    if (element.hasService())
        composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
    for (int i = 0; i < element.getModifier().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
    for (int i = 0; i < element.getProgramCode().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
    if (element.hasServiced())
        composeType(t, "ExplanationOfBenefit", "serviced", element.getServiced(), -1);
    if (element.hasLocation())
        composeType(t, "ExplanationOfBenefit", "location", element.getLocation(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
    if (element.hasNet())
        composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
    for (int i = 0; i < element.getUdi().size(); i++) composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
    if (element.hasBodySite())
        composeCodeableConcept(t, "ExplanationOfBenefit", "bodySite", element.getBodySite(), -1);
    for (int i = 0; i < element.getSubSite().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "subSite", element.getSubSite().get(i), i);
    for (int i = 0; i < element.getEncounter().size(); i++) composeReference(t, "ExplanationOfBenefit", "encounter", element.getEncounter().get(i), i);
    for (int i = 0; i < element.getNoteNumber().size(); i++) composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
    for (int i = 0; i < element.getAdjudication().size(); i++) composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
    for (int i = 0; i < element.getDetail().size(); i++) composeExplanationOfBenefitDetailComponent(t, "ExplanationOfBenefit", "detail", element.getDetail().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 48 with Quantity

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

the class RdfParser method composeChargeItem.

protected void composeChargeItem(Complex parent, String parentType, String name, ChargeItem element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "ChargeItem", name, element, index);
    if (element.hasIdentifier())
        composeIdentifier(t, "ChargeItem", "identifier", element.getIdentifier(), -1);
    for (int i = 0; i < element.getDefinition().size(); i++) composeUri(t, "ChargeItem", "definition", element.getDefinition().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "ChargeItem", "status", element.getStatusElement(), -1);
    for (int i = 0; i < element.getPartOf().size(); i++) composeReference(t, "ChargeItem", "partOf", element.getPartOf().get(i), i);
    if (element.hasCode())
        composeCodeableConcept(t, "ChargeItem", "code", element.getCode(), -1);
    if (element.hasSubject())
        composeReference(t, "ChargeItem", "subject", element.getSubject(), -1);
    if (element.hasContext())
        composeReference(t, "ChargeItem", "context", element.getContext(), -1);
    if (element.hasOccurrence())
        composeType(t, "ChargeItem", "occurrence", element.getOccurrence(), -1);
    for (int i = 0; i < element.getParticipant().size(); i++) composeChargeItemChargeItemParticipantComponent(t, "ChargeItem", "participant", element.getParticipant().get(i), i);
    if (element.hasPerformingOrganization())
        composeReference(t, "ChargeItem", "performingOrganization", element.getPerformingOrganization(), -1);
    if (element.hasRequestingOrganization())
        composeReference(t, "ChargeItem", "requestingOrganization", element.getRequestingOrganization(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "ChargeItem", "quantity", element.getQuantity(), -1);
    for (int i = 0; i < element.getBodysite().size(); i++) composeCodeableConcept(t, "ChargeItem", "bodysite", element.getBodysite().get(i), i);
    if (element.hasFactorOverrideElement())
        composeDecimal(t, "ChargeItem", "factorOverride", element.getFactorOverrideElement(), -1);
    if (element.hasPriceOverride())
        composeMoney(t, "ChargeItem", "priceOverride", element.getPriceOverride(), -1);
    if (element.hasOverrideReasonElement())
        composeString(t, "ChargeItem", "overrideReason", element.getOverrideReasonElement(), -1);
    if (element.hasEnterer())
        composeReference(t, "ChargeItem", "enterer", element.getEnterer(), -1);
    if (element.hasEnteredDateElement())
        composeDateTime(t, "ChargeItem", "enteredDate", element.getEnteredDateElement(), -1);
    for (int i = 0; i < element.getReason().size(); i++) composeCodeableConcept(t, "ChargeItem", "reason", element.getReason().get(i), i);
    for (int i = 0; i < element.getService().size(); i++) composeReference(t, "ChargeItem", "service", element.getService().get(i), i);
    for (int i = 0; i < element.getAccount().size(); i++) composeReference(t, "ChargeItem", "account", element.getAccount().get(i), i);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "ChargeItem", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getSupportingInformation().size(); i++) composeReference(t, "ChargeItem", "supportingInformation", element.getSupportingInformation().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 49 with Quantity

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

the class RdfParser method composeExplanationOfBenefitDetailComponent.

protected void composeExplanationOfBenefitDetailComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.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, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
    if (element.hasType())
        composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
    if (element.hasRevenue())
        composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
    if (element.hasService())
        composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
    for (int i = 0; i < element.getModifier().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
    for (int i = 0; i < element.getProgramCode().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
    if (element.hasQuantity())
        composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
    if (element.hasUnitPrice())
        composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
    if (element.hasFactorElement())
        composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
    if (element.hasNet())
        composeMoney(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.getNoteNumber().size(); i++) composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
    for (int i = 0; i < element.getAdjudication().size(); i++) composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
    for (int i = 0; i < element.getSubDetail().size(); i++) composeExplanationOfBenefitSubDetailComponent(t, "ExplanationOfBenefit", "subDetail", element.getSubDetail().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 50 with Quantity

use of org.hl7.fhir.dstu2.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.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);
    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);
    if (element.hasNotDoneElement())
        composeBoolean(t, "MedicationDispense", "notDone", element.getNotDoneElement(), -1);
    if (element.hasNotDoneReason())
        composeType(t, "MedicationDispense", "notDoneReason", element.getNotDoneReason(), -1);
    for (int i = 0; i < element.getEventHistory().size(); i++) composeReference(t, "MedicationDispense", "eventHistory", element.getEventHistory().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.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