Search in sources :

Example 46 with EvaluationResult

use of io.github.linuxforhealth.api.EvaluationResult in project hl7v2-fhir-converter by LinuxForHealth.

the class ContextValueUtils method fetchValueFromVar.

private static EvaluationResult fetchValueFromVar(String varName, Map<String, EvaluationResult> contextValues, boolean isUseGroup) {
    String[] tokens = StringUtils.split(varName, ":", 2);
    ImmutablePair<String, String> fetch = ImmutablePair.of(tokens[0], tokens[1]);
    String keyname = getKeyName(contextValues, VariableUtils.getVarName(fetch.left), isUseGroup);
    EvaluationResult resource = contextValues.get(keyname);
    return ExpressionUtility.extractComponent(fetch, resource);
}
Also used : EvaluationResult(io.github.linuxforhealth.api.EvaluationResult)

Aggregations

EvaluationResult (io.github.linuxforhealth.api.EvaluationResult)46 HashMap (java.util.HashMap)36 SimpleEvaluationResult (io.github.linuxforhealth.core.expression.SimpleEvaluationResult)30 Test (org.junit.jupiter.api.Test)26 Message (ca.uhn.hl7v2.model.Message)19 EmptyEvaluationResult (io.github.linuxforhealth.core.expression.EmptyEvaluationResult)19 HL7MessageData (io.github.linuxforhealth.hl7.message.HL7MessageData)19 HL7DataExtractor (io.github.linuxforhealth.hl7.parsing.HL7DataExtractor)19 Structure (ca.uhn.hl7v2.model.Structure)18 List (java.util.List)11 ImmutableMap (com.google.common.collect.ImmutableMap)10 ArrayList (java.util.ArrayList)10 Map (java.util.Map)10 ResourceValue (io.github.linuxforhealth.api.ResourceValue)6 RequiredConstraintFailureException (io.github.linuxforhealth.core.exception.RequiredConstraintFailureException)5 ResourceEvaluationResult (io.github.linuxforhealth.hl7.resource.ResourceEvaluationResult)5 ResourceResult (io.github.linuxforhealth.core.resource.ResourceResult)4 SimpleCode (io.github.linuxforhealth.core.terminology.SimpleCode)4 DataExtractionException (io.github.linuxforhealth.core.exception.DataExtractionException)3 Expression (io.github.linuxforhealth.api.Expression)2