Search in sources :

Example 76 with Medication

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

the class RdfParser method composeMedicationMedicationIngredientComponent.

protected void composeMedicationMedicationIngredientComponent(Complex parent, String parentType, String name, Medication.MedicationIngredientComponent 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.hasItem())
        composeType(t, "Medication", "item", element.getItem(), -1);
    if (element.hasIsActiveElement())
        composeBoolean(t, "Medication", "isActive", element.getIsActiveElement(), -1);
    if (element.hasStrength())
        composeRatio(t, "Medication", "strength", element.getStrength(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 77 with Medication

use of org.hl7.fhir.r4.model.Medication 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 Medication

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

the class RdfParser method composeMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponent.

protected void composeMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponent(Complex parent, String parentType, String name, MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "otherTherapy", name, element, index);
    if (element.hasTherapyRelationshipType())
        composeCodeableConcept(t, "MedicinalProductContraindication", "therapyRelationshipType", element.getTherapyRelationshipType(), -1);
    if (element.hasMedication())
        composeType(t, "MedicinalProductContraindication", "medication", element.getMedication(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 79 with Medication

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

the class RdfParser method composeMedication.

protected void composeMedication(Complex parent, String parentType, String name, Medication element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Medication", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Medication", "identifier", element.getIdentifier().get(i), i);
    if (element.hasCode())
        composeCodeableConcept(t, "Medication", "code", element.getCode(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "Medication", "status", element.getStatusElement(), -1);
    if (element.hasManufacturer())
        composeReference(t, "Medication", "manufacturer", element.getManufacturer(), -1);
    if (element.hasForm())
        composeCodeableConcept(t, "Medication", "form", element.getForm(), -1);
    if (element.hasAmount())
        composeRatio(t, "Medication", "amount", element.getAmount(), -1);
    for (int i = 0; i < element.getIngredient().size(); i++) composeMedicationMedicationIngredientComponent(t, "Medication", "ingredient", element.getIngredient().get(i), i);
    if (element.hasBatch())
        composeMedicationMedicationBatchComponent(t, "Medication", "batch", element.getBatch(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 80 with Medication

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

the class RdfParser method composeMedicationMedicationBatchComponent.

protected void composeMedicationMedicationBatchComponent(Complex parent, String parentType, String name, Medication.MedicationBatchComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "batch", name, element, index);
    if (element.hasLotNumberElement())
        composeString(t, "Medication", "lotNumber", element.getLotNumberElement(), -1);
    if (element.hasExpirationDateElement())
        composeDateTime(t, "Medication", "expirationDate", element.getExpirationDateElement(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Aggregations

Test (org.junit.Test)112 Medication (org.hl7.fhir.r4.model.Medication)62 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)43 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)34 Medication (org.hl7.fhir.dstu3.model.Medication)33 BaseFhirIntegrationTest (org.openmrs.module.fhir2.BaseFhirIntegrationTest)30 TokenAndListParam (ca.uhn.fhir.rest.param.TokenAndListParam)24 TokenParam (ca.uhn.fhir.rest.param.TokenParam)24 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)20 SearchParameterMap (org.openmrs.module.fhir2.api.search.param.SearchParameterMap)20 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)19 MedicationRequest (org.hl7.fhir.r4.model.MedicationRequest)18 InputStream (java.io.InputStream)17 TokenOrListParam (ca.uhn.fhir.rest.param.TokenOrListParam)16 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)14 Coding (org.hl7.fhir.r4.model.Coding)14 Date (java.util.Date)13 ArrayList (java.util.ArrayList)12 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)12 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)11