Merge pull request #391 from azizjonh/patch-1

Load context from classpath allowing duplicates
This commit is contained in:
Grahame Grieve 2020-12-03 13:52:07 +11:00 committed by GitHub
commit 45530c0f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -243,10 +243,14 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
}
public static SimpleWorkerContext fromClassPath(String name) throws IOException, FHIRException {
InputStream s = SimpleWorkerContext.class.getResourceAsStream("/"+name);
SimpleWorkerContext res = new SimpleWorkerContext();
return fromClassPath(name, false);
}
public static SimpleWorkerContext fromClassPath(String name, boolean allowDuplicates) throws IOException, FHIRException {
InputStream s = SimpleWorkerContext.class.getResourceAsStream("/" + name);
SimpleWorkerContext res = new SimpleWorkerContext();
res.setAllowLoadingDuplicates(allowDuplicates);
res.loadFromStream(s, null);
return res;
return res;
}
// public static SimpleWorkerContext fromDefinitions(Map<String, byte[]> source) throws IOException, FHIRException {
@ -829,4 +833,4 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
}
}
}