fixes for change to validator resolve interface
This commit is contained in:
parent
149f7caad2
commit
9e0e8fec3b
|
@ -405,11 +405,11 @@ public class LiquidEngine implements IEvaluationContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Base resolveReference(Object appContext, String url) throws FHIRException {
|
public Base resolveReference(Object appContext, String url, Base refContext) throws FHIRException {
|
||||||
if (externalHostServices == null)
|
if (externalHostServices == null)
|
||||||
return null;
|
return null;
|
||||||
LiquidEngineContext ctxt = (LiquidEngineContext) appContext;
|
LiquidEngineContext ctxt = (LiquidEngineContext) appContext;
|
||||||
return resolveReference(ctxt.externalContext, url);
|
return resolveReference(ctxt.externalContext, url, refContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -198,7 +198,7 @@ public class StructureMapUtilities {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Base resolveReference(Object appContext, String url) throws FHIRException {
|
public Base resolveReference(Object appContext, String url, Base refContext) throws FHIRException {
|
||||||
if (services == null)
|
if (services == null)
|
||||||
return null;
|
return null;
|
||||||
return services.resolveReference(appContext, url);
|
return services.resolveReference(appContext, url);
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class FHIRPathTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Base resolveReference(Object appContext, String url) throws FHIRException {
|
public Base resolveReference(Object appContext, String url, Base refContext) throws FHIRException {
|
||||||
throw new NotImplementedException("Not done yet (FHIRPathTestEvaluationServices.resolveReference), when item is element");
|
throw new NotImplementedException("Not done yet (FHIRPathTestEvaluationServices.resolveReference), when item is element");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ public class SnapShotGenerationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Base resolveReference(Object appContext, String url) {
|
public Base resolveReference(Object appContext, String url, Base refContext) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -468,14 +468,23 @@ public class SnapShotGenerationTests {
|
||||||
|
|
||||||
private void testGen(boolean fail) throws Exception {
|
private void testGen(boolean fail) throws Exception {
|
||||||
if (!Utilities.noString(test.register)) {
|
if (!Utilities.noString(test.register)) {
|
||||||
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), null, null);
|
List<ValidationMessage> messages = new ArrayList<ValidationMessage>();
|
||||||
|
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), messages, null);
|
||||||
pu.setNewSlicingProcessing(true);
|
pu.setNewSlicingProcessing(true);
|
||||||
List<String> errors = new ArrayList<String>();
|
|
||||||
pu.setIds(test.included, false);
|
pu.setIds(test.included, false);
|
||||||
StructureDefinition base = TestingUtilities.context().fetchResource(StructureDefinition.class, test.included.getBaseDefinition());
|
StructureDefinition base = TestingUtilities.context().fetchResource(StructureDefinition.class, test.included.getBaseDefinition());
|
||||||
pu.generateSnapshot(base, test.included, test.included.getUrl(), "http://test.org/profile", test.included.getName());
|
pu.generateSnapshot(base, test.included, test.included.getUrl(), "http://test.org/profile", test.included.getName());
|
||||||
if (!TestingUtilities.context().hasResource(StructureDefinition.class, test.included.getUrl()))
|
if (!TestingUtilities.context().hasResource(StructureDefinition.class, test.included.getUrl()))
|
||||||
TestingUtilities.context().cacheResource(test.included);
|
TestingUtilities.context().cacheResource(test.included);
|
||||||
|
int ec = 0;
|
||||||
|
for (ValidationMessage vm : messages) {
|
||||||
|
if (vm.getLevel() == IssueSeverity.ERROR) {
|
||||||
|
System.out.println(vm.summary());
|
||||||
|
ec++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ec > 0)
|
||||||
|
throw new FHIRException("register gen failed: "+messages.toString());
|
||||||
}
|
}
|
||||||
StructureDefinition base = getSD(test.getSource().getBaseDefinition());
|
StructureDefinition base = getSD(test.getSource().getBaseDefinition());
|
||||||
if (!base.getUrl().equals(test.getSource().getBaseDefinition()))
|
if (!base.getUrl().equals(test.getSource().getBaseDefinition()))
|
||||||
|
|
|
@ -380,7 +380,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Base resolveReference(Object appContext, String url) {
|
public Base resolveReference(Object appContext, String url, Base refContext) {
|
||||||
if (url.equals("Patient/test"))
|
if (url.equals("Patient/test"))
|
||||||
return new Patient();
|
return new Patient();
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue