Merge branch 'val_fhirpath_resolveinbundle' of https://github.com/ahdis/org.hl7.fhir.core into ahdis-val_fhirpath_resolveinbundle
# Conflicts: # org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
This commit is contained in:
commit
ff02c5b71a
|
@ -50,6 +50,8 @@ import org.hl7.fhir.validation.cli.model.ScanOutputItem;
|
||||||
import org.hl7.fhir.validation.cli.services.StandAloneValidatorFetcher.IPackageInstaller;
|
import org.hl7.fhir.validation.cli.services.StandAloneValidatorFetcher.IPackageInstaller;
|
||||||
import org.hl7.fhir.validation.cli.utils.*;
|
import org.hl7.fhir.validation.cli.utils.*;
|
||||||
import org.hl7.fhir.validation.instance.InstanceValidator;
|
import org.hl7.fhir.validation.instance.InstanceValidator;
|
||||||
|
import org.hl7.fhir.validation.instance.utils.NodeStack;
|
||||||
|
import org.hl7.fhir.validation.instance.utils.ValidatorHostContext;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
@ -1390,8 +1392,10 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
|
||||||
|
|
||||||
public String evaluateFhirPath(String source, String expression) throws FHIRException, IOException {
|
public String evaluateFhirPath(String source, String expression) throws FHIRException, IOException {
|
||||||
Content cnt = loadContent(source, "validate", false);
|
Content cnt = loadContent(source, "validate", false);
|
||||||
|
FHIRPathEngine fpe = this.getValidator().getFHIRPathEngine();
|
||||||
Element e = Manager.parse(context, new ByteArrayInputStream(cnt.focus), cnt.cntType);
|
Element e = Manager.parse(context, new ByteArrayInputStream(cnt.focus), cnt.cntType);
|
||||||
return fpe.evaluateToString(e, expression);
|
ExpressionNode exp = fpe.parse(expression);
|
||||||
|
return fpe.evaluateToString(new ValidatorHostContext(context, e), e, e, e, exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StructureDefinition snapshot(String source, String version) throws FHIRException, IOException {
|
public StructureDefinition snapshot(String source, String version) throws FHIRException, IOException {
|
||||||
|
|
|
@ -332,6 +332,10 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
}
|
}
|
||||||
private FHIRPathEngine fpe;
|
private FHIRPathEngine fpe;
|
||||||
|
|
||||||
|
public FHIRPathEngine getFHIRPathEngine() {
|
||||||
|
return fpe;
|
||||||
|
}
|
||||||
|
|
||||||
// configuration items
|
// configuration items
|
||||||
private CheckDisplayOption checkDisplay;
|
private CheckDisplayOption checkDisplay;
|
||||||
private boolean anyExtensionsAllowed;
|
private boolean anyExtensionsAllowed;
|
||||||
|
|
Loading…
Reference in New Issue