make binaries part of standard context

This commit is contained in:
Grahame Grieve 2019-12-19 10:47:19 +11:00
parent 96a4bc7aac
commit 86a905114d
3 changed files with 13 additions and 8 deletions

View File

@ -140,7 +140,8 @@ public abstract class BaseWorkerContext implements IWorkerContext {
private MetadataResourceManager<PlanDefinition> plans = new MetadataResourceManager<PlanDefinition>(false);
private List<NamingSystem> systems = new ArrayList<NamingSystem>();
private UcumService ucumService;
protected Map<String, byte[]> binaries = new HashMap<String, byte[]>();
protected Map<String, Map<String, ValidationResult>> validationCache = new HashMap<String, Map<String,ValidationResult>>();
protected String tsServer;
protected String name;
@ -1243,5 +1244,11 @@ public abstract class BaseWorkerContext implements IWorkerContext {
guides.listAll(res);
return res;
}
@Override
public Map<String, byte[]> getBinaries() {
return binaries;
}
}

View File

@ -543,6 +543,7 @@ public interface IWorkerContext {
public void setUcumService(UcumService ucumService);
public String getLinkForUrl(String corePath, String s);
public Map<String, byte[]> getBinaries();
}

View File

@ -97,7 +97,6 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
}
private Questionnaire questionnaire;
private Map<String, byte[]> binaries = new HashMap<String, byte[]>();
private String version;
private String revision;
private String date;
@ -299,7 +298,9 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
for (String s : pi.list("other")) {
binaries.put(s, TextFile.streamToBytes(pi.load("other", s)));
}
version = pi.version();
if (version == null) {
version = pi.version();
}
}
public void loadFromFile(String file, IContextResourceLoader loader) throws IOException, FHIRException {
@ -533,10 +534,6 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
}
}
public Map<String, byte[]> getBinaries() {
return binaries;
}
@Override
public boolean prependLinks() {
return false;