Search in sources :

Example 96 with Use

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

the class FHIRPathEngine method evaluate.

/**
 * evaluate a path and return the matching elements
 *
 * @param base - the object against which the path is being evaluated
 * @param path - the FHIR Path statement to use
 * @return
 * @throws PathEngineException
 * @throws FHIRLexerException
 * @
 * @
 */
public List<Base> evaluate(Object appContext, Resource resource, Base base, String path) throws PathEngineException, FHIRLexerException {
    ExpressionNode exp = parse(path);
    List<Base> list = new ArrayList<Base>();
    if (base != null)
        list.add(base);
    log = new StringBuilder();
    return execute(new ExecutionContext(appContext, resource, base, base), list, exp, true);
}
Also used : ExpressionNode(org.hl7.fhir.dstu2.model.ExpressionNode) ArrayList(java.util.ArrayList) Base(org.hl7.fhir.dstu2.model.Base)

Example 97 with Use

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

the class RdfParser method composeExpansionProfileDesignationIncludeDesignationComponent.

protected void composeExpansionProfileDesignationIncludeDesignationComponent(Complex parent, String parentType, String name, ExpansionProfile.DesignationIncludeDesignationComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "designation", name, element, index);
    if (element.hasLanguageElement())
        composeCode(t, "ExpansionProfile", "language", element.getLanguageElement(), -1);
    if (element.hasUse())
        composeCoding(t, "ExpansionProfile", "use", element.getUse(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 98 with Use

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

the class RdfParser method composeModuleDefinitionModuleDefinitionParameterComponent.

protected void composeModuleDefinitionModuleDefinitionParameterComponent(Complex parent, String parentType, String name, ModuleDefinition.ModuleDefinitionParameterComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "parameter", name, element, index);
    if (element.hasNameElement())
        composeCode(t, "ModuleDefinition", "name", element.getNameElement(), -1);
    if (element.hasUseElement())
        composeCode(t, "ModuleDefinition", "use", element.getUseElement(), -1);
    if (element.hasDocumentationElement())
        composeString(t, "ModuleDefinition", "documentation", element.getDocumentationElement(), -1);
    if (element.hasTypeElement())
        composeCode(t, "ModuleDefinition", "type", element.getTypeElement(), -1);
    if (element.hasProfile())
        composeReference(t, "ModuleDefinition", "profile", element.getProfile(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 99 with Use

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

the class FHIRPathEngine method evaluate.

/**
 * evaluate a path and return the matching elements
 *
 * @param base - the object against which the path is being evaluated
 * @param path - the FHIR Path statement to use
 * @return
 * @throws FHIRException
 * @
 */
public List<Base> evaluate(Object appContext, Resource resource, Base base, String path) throws FHIRException {
    ExpressionNode exp = parse(path);
    List<Base> list = new ArrayList<Base>();
    if (base != null)
        list.add(base);
    log = new StringBuilder();
    return execute(new ExecutionContext(appContext, resource, base), list, exp, true);
}
Also used : ExpressionNode(org.hl7.fhir.dstu2016may.model.ExpressionNode) ArrayList(java.util.ArrayList) ParserBase(org.hl7.fhir.dstu2016may.metamodel.ParserBase) Base(org.hl7.fhir.dstu2016may.model.Base)

Example 100 with Use

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

the class FHIRPathEngine method evaluate.

/**
 * evaluate a path and return the matching elements
 *
 * @param base - the object against which the path is being evaluated
 * @param path - the FHIR Path statement to use
 * @return
 * @throws FHIRException
 * @
 */
public List<Base> evaluate(Base base, String path) throws FHIRException {
    ExpressionNode exp = parse(path);
    List<Base> list = new ArrayList<Base>();
    if (base != null)
        list.add(base);
    log = new StringBuilder();
    return execute(new ExecutionContext(null, null, base), list, exp, true);
}
Also used : ExpressionNode(org.hl7.fhir.dstu2016may.model.ExpressionNode) ArrayList(java.util.ArrayList) ParserBase(org.hl7.fhir.dstu2016may.metamodel.ParserBase) Base(org.hl7.fhir.dstu2016may.model.Base)

Aggregations

ArrayList (java.util.ArrayList)82 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)43 List (java.util.List)41 FHIRException (org.hl7.fhir.exceptions.FHIRException)40 Date (java.util.Date)39 IOException (java.io.IOException)38 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)35 Test (org.junit.jupiter.api.Test)35 Resource (org.hl7.fhir.r4.model.Resource)34 Collectors (java.util.stream.Collectors)29 Coding (org.hl7.fhir.r4.model.Coding)27 Reference (org.hl7.fhir.r4.model.Reference)27 Timer (com.codahale.metrics.Timer)26 HashMap (java.util.HashMap)25 Bundle (org.hl7.fhir.r4.model.Bundle)25 Reference (org.hl7.fhir.dstu3.model.Reference)24 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)23 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)21 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)21 JsonObject (com.google.gson.JsonObject)20