Gg 202110 validation various (#634)
* add explicit control over the User-Agent header, and make sure headers flow through properly to all calls * #328 - wrong processing of markdown URLs * test fixes for URL handling * fix tests * improved validation of UUIDs * fix test case dependency * Add Dicom Package builder
This commit is contained in:
parent
69cee8b485
commit
1c65a9b261
|
@ -0,0 +1,182 @@
|
|||
package org.hl7.fhir.convertors.misc;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.r4.formats.JsonParser;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
import org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode;
|
||||
import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.r4.model.Identifier;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
import org.hl7.fhir.r4.utils.NPMPackageGenerator;
|
||||
import org.hl7.fhir.r4.utils.NPMPackageGenerator.Category;
|
||||
import org.hl7.fhir.r4.model.Enumerations.PublicationStatus;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xml.XMLUtil;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
public class DicomPackageBuilder {
|
||||
|
||||
private String version;
|
||||
private String dest;
|
||||
private String source;
|
||||
|
||||
public static void main(String[] args) throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
|
||||
if (args.length == 0 || args[0].equals("-help")) {
|
||||
System.out.println("Dicom Package Builder");
|
||||
System.out.println("");
|
||||
System.out.println("Before running, use FTP get the latest copy of ftp://medical.nema.org/MEDICAL/Dicom/Resources");
|
||||
System.out.println("Then run with the following parameters (in order):");
|
||||
System.out.println("1. the local folder that contains the copy of the FTP folder");
|
||||
System.out.println("2. the local folder to put the package when it's created");
|
||||
System.out.println("");
|
||||
System.out.println("For help, see ");
|
||||
return;
|
||||
}
|
||||
String source = args[0];
|
||||
String dest = args[1];
|
||||
|
||||
DicomPackageBuilder self = new DicomPackageBuilder();
|
||||
self.setSource(source);
|
||||
self.setDest(dest);
|
||||
self.execute();
|
||||
}
|
||||
|
||||
private void execute() throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
|
||||
CodeSystem cs = buildCodeSystem();
|
||||
NPMPackageGenerator gen = new NPMPackageGenerator(Utilities.path(dest, "fhir.dicom#"+version+".tgz"), buildPackage());
|
||||
int i = 2;
|
||||
gen.addFile(Category.RESOURCE, "CodeSystem-"+cs.getId()+".json", new JsonParser().setOutputStyle(OutputStyle.NORMAL).composeBytes(cs));
|
||||
ValueSet vs = buildAllValueSet();
|
||||
gen.addFile(Category.RESOURCE, "ValueSet-"+vs.getId()+".json", new JsonParser().setOutputStyle(OutputStyle.NORMAL).composeBytes(vs));
|
||||
Set<String> ids = new HashSet<>();
|
||||
ids.add(vs.getId());
|
||||
|
||||
for (File f : new File(Utilities.path(source, "Resources", "valuesets", "fhir", "json")).listFiles()) {
|
||||
vs = (ValueSet) JsonParser.loadFile(new FileInputStream(f));
|
||||
vs.setVersion(version);
|
||||
if (vs.getId().length() > 64) {
|
||||
vs.setId(vs.getId().substring(0, 64));
|
||||
}
|
||||
if (ids.contains(vs.getId())) {
|
||||
throw new Error("Duplicate Id once Ids cut off at 64 char: "+vs.getId());
|
||||
}
|
||||
ids.add(vs.getId());
|
||||
gen.addFile(Category.RESOURCE, "ValueSet-"+vs.getId()+".json", new JsonParser().setOutputStyle(OutputStyle.NORMAL).composeBytes(vs));
|
||||
i++;
|
||||
}
|
||||
gen.finish();
|
||||
System.out.println("Finished - "+i+" resources");
|
||||
|
||||
}
|
||||
|
||||
private ValueSet buildAllValueSet() {
|
||||
ValueSet vs = new ValueSet();
|
||||
vs.setId("all");
|
||||
vs.setUrl("http://dicom.nema.org/resources/ValueSet/all");
|
||||
vs.setVersion(version);
|
||||
vs.setName("All DICOMTerminologyDefinitions");
|
||||
vs.setTitle("All DICOM Controlled Terminology Definitions");
|
||||
vs.setStatus(PublicationStatus.ACTIVE);
|
||||
vs.setExperimental(false);
|
||||
vs.setPublisher("FHIR Project on behalf of DICOM");
|
||||
vs.setDate(new Date());
|
||||
vs.setDescription("All DICOM Code Definitions (Coding Scheme Designator \"DCM\" Coding Scheme Version "+version);
|
||||
vs.setPurpose("This value set is published as part of FHIR in order to make the codes available to FHIR terminology services and so implementers can easily leverage the codes");
|
||||
vs.setCopyright("These codes are excerpted from Digital Imaging and Communications in Medicine (DICOM) Standard, Part 16: Content Mapping Resource, Copyright © 2011 by the National Electrical Manufacturers Association.");
|
||||
|
||||
vs.getCompose().getIncludeFirstRep().setSystem("http://dicom.nema.org/resources/ontology/DCM");
|
||||
return vs;
|
||||
}
|
||||
|
||||
private JsonObject buildPackage() {
|
||||
JsonObject npm = new JsonObject();
|
||||
npm.addProperty("tools-version", 3);
|
||||
npm.addProperty("type", "fhir.ig");
|
||||
npm.addProperty("license", "free");
|
||||
npm.addProperty("author", "FHIR Project for DICOM");
|
||||
npm.addProperty("name", "fhir.dicom");
|
||||
npm.addProperty("url", "http://fhir.org/packages/fhir.dicom");
|
||||
npm.addProperty("canonical", "http://fhir.org/packages/fhir.dicom");
|
||||
npm.addProperty("version", version);
|
||||
JsonArray fv = new JsonArray();
|
||||
npm.add("fhirVersions", fv);
|
||||
fv.add("4.0");
|
||||
return npm;
|
||||
}
|
||||
|
||||
private CodeSystem buildCodeSystem() throws ParserConfigurationException, FileNotFoundException, SAXException, IOException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
Document doc = builder.parse(new FileInputStream(Utilities.path(source, "Resources", "Ontology", "DCM", "dcm.owl")));
|
||||
Element rdf = doc.getDocumentElement();
|
||||
Element d = XMLUtil.getFirstChild(rdf);
|
||||
version = processVersion(XMLUtil.getNamedChildText(d, "versionInfo"));
|
||||
|
||||
CodeSystem cs = new CodeSystem();
|
||||
cs.setId("DCM");
|
||||
cs.setUrl("http://dicom.nema.org/resources/ontology/DCM");
|
||||
cs.setVersion(version);
|
||||
cs.setName("DICOMTerminologyDefinitions");
|
||||
cs.setTitle("DICOM Controlled Terminology Definitions");
|
||||
cs.getIdentifier().add(new Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:1.2.840.10008.2.16.4"));
|
||||
cs.setStatus(PublicationStatus.ACTIVE);
|
||||
cs.setExperimental(false);
|
||||
cs.setPublisher("FHIR Project on behalf of DICOM");
|
||||
cs.setDate(new Date());
|
||||
cs.setDescription("DICOM Code Definitions (Coding Scheme Designator \"DCM\" Coding Scheme Version "+version);
|
||||
cs.setPurpose("This code system is published as part of FHIR in order to make the codes available to FHIR terminology services and so implementers can easily leverage the codes");
|
||||
cs.setCopyright("These codes are excerpted from Digital Imaging and Communications in Medicine (DICOM) Standard, Part 16: Content Mapping Resource, Copyright © 2011 by the National Electrical Manufacturers Association.");
|
||||
cs.setCaseSensitive(true);
|
||||
cs.setValueSet("http://dicom.nema.org/resources/ValueSet/all");
|
||||
cs.setContent(CodeSystemContentMode.COMPLETE);
|
||||
|
||||
d = XMLUtil.getNextSibling(d);
|
||||
while (d != null) {
|
||||
String code = XMLUtil.getNamedChildText(d, "notation");
|
||||
String display = XMLUtil.getNamedChildText(d, "prefLabel");
|
||||
String definition = XMLUtil.getNamedChildText(d, "definition");
|
||||
ConceptDefinitionComponent cc = new ConceptDefinitionComponent();
|
||||
cs.getConcept().add(cc);
|
||||
cc.setCode(code);
|
||||
cc.setDisplay(display);
|
||||
cc.setDefinition(definition);
|
||||
d = XMLUtil.getNextSibling(d);
|
||||
}
|
||||
return cs;
|
||||
}
|
||||
|
||||
private String processVersion(String s) {
|
||||
String[] p = s.split("\\_");
|
||||
return p[0].substring(0, 4)+"."+(1+(p[0].charAt(4) - 'a'))+"."+p[1];
|
||||
}
|
||||
|
||||
private void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
private void setDest(String dest) {
|
||||
this.dest = dest;
|
||||
}
|
||||
|
||||
private void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ public class VSACImporter extends OIDBasedValueSetImporter {
|
|||
CSVReader csv = new CSVReader(new FileInputStream(source));
|
||||
csv.readHeaders();
|
||||
|
||||
FHIRToolingClient fhirToolingClient = new FHIRToolingClient("https://cts.nlm.nih.gov/fhir");
|
||||
FHIRToolingClient fhirToolingClient = new FHIRToolingClient("https://cts.nlm.nih.gov/fhir", "fhir/vsac");
|
||||
fhirToolingClient.setUsername(username);
|
||||
fhirToolingClient.setPassword(password);
|
||||
|
||||
|
|
|
@ -39,42 +39,42 @@ import java.net.URISyntaxException;
|
|||
|
||||
public class TerminologyClientFactory {
|
||||
|
||||
public static TerminologyClient makeClient(String url, FhirPublication v) throws URISyntaxException {
|
||||
public static TerminologyClient makeClient(String url, String userAgent, FhirPublication v) throws URISyntaxException {
|
||||
if (v == null)
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url));
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent);
|
||||
switch (v) {
|
||||
case DSTU2016May:
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url)); // r3 is the least worst match
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent); // r3 is the least worst match
|
||||
case DSTU1:
|
||||
throw new Error("The version " + v + " is not currently supported");
|
||||
case DSTU2:
|
||||
return new TerminologyClientR2(checkEndsWith("/r2", url));
|
||||
return new TerminologyClientR2(checkEndsWith("/r2", url), userAgent);
|
||||
case R4:
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url));
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent);
|
||||
case R5:
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url)); // r4 for now, since the terminology is currently the same
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); // r4 for now, since the terminology is currently the same
|
||||
case STU3:
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url));
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent);
|
||||
default:
|
||||
throw new Error("The version " + v + " is not currently supported");
|
||||
}
|
||||
}
|
||||
|
||||
public static TerminologyClient makeClient(String url, String v) throws URISyntaxException {
|
||||
public static TerminologyClient makeClient(String url, String userAgent, String v) throws URISyntaxException {
|
||||
if (v == null)
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url));
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent);
|
||||
v = VersionUtilities.getMajMin(v);
|
||||
switch (v) {
|
||||
case "1.0":
|
||||
return new TerminologyClientR2(checkEndsWith("/r2", url));
|
||||
return new TerminologyClientR2(checkEndsWith("/r2", url), userAgent);
|
||||
case "1.4":
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url)); // r3 is the least worst match
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent); // r3 is the least worst match
|
||||
case "3.0":
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url));
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent);
|
||||
case "4.0":
|
||||
return new TerminologyClientR4(checkEndsWith("/r4", url));
|
||||
return new TerminologyClientR4(checkEndsWith("/r4", url), userAgent);
|
||||
case "4.5":
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url)); // r4 for now, since the terminology is currently the same
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); // r4 for now, since the terminology is currently the same
|
||||
default:
|
||||
throw new Error("The version " + v + " is not currently supported");
|
||||
}
|
||||
|
|
|
@ -48,8 +48,8 @@ public class TerminologyClientR2 implements TerminologyClient {
|
|||
|
||||
private final FHIRToolingClient client; // todo: use the R2 client
|
||||
|
||||
public TerminologyClientR2(String address) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR2(String address, String userAgent) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address, userAgent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -153,4 +153,10 @@ public class TerminologyClientR2 implements TerminologyClient {
|
|||
public TerminologyClient setClientHeaders(ClientHeaders clientHeaders) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminologyClient setUserAgent(String userAgent) {
|
||||
client.setUserAgent(userAgent);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -49,13 +49,13 @@ public class TerminologyClientR3 implements TerminologyClient {
|
|||
private final FHIRToolingClient client; // todo: use the R2 client
|
||||
private ClientHeaders clientHeaders;
|
||||
|
||||
public TerminologyClientR3(String address) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR3(String address, String userAgent) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address, userAgent);
|
||||
setClientHeaders(new ClientHeaders());
|
||||
}
|
||||
|
||||
public TerminologyClientR3(String address, ClientHeaders clientHeaders) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR3(String address, String userAgent, ClientHeaders clientHeaders) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address, userAgent);
|
||||
setClientHeaders(clientHeaders);
|
||||
}
|
||||
|
||||
|
@ -162,4 +162,10 @@ public class TerminologyClientR3 implements TerminologyClient {
|
|||
this.client.setClientHeaders(this.clientHeaders.headers());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminologyClient setUserAgent(String userAgent) {
|
||||
client.setUserAgent(userAgent);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -49,13 +49,13 @@ public class TerminologyClientR4 implements TerminologyClient {
|
|||
private final FHIRToolingClient client; // todo: use the R2 client
|
||||
private ClientHeaders clientHeaders;
|
||||
|
||||
public TerminologyClientR4(String address) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR4(String address, String userAgent) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address, userAgent);
|
||||
setClientHeaders(new ClientHeaders());
|
||||
}
|
||||
|
||||
public TerminologyClientR4(String address, ClientHeaders clientHeaders) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR4(String address, String userAgent, ClientHeaders clientHeaders) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address, userAgent);
|
||||
setClientHeaders(clientHeaders);
|
||||
}
|
||||
|
||||
|
@ -162,4 +162,10 @@ public class TerminologyClientR4 implements TerminologyClient {
|
|||
this.client.setClientHeaders(this.clientHeaders.headers());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminologyClient setUserAgent(String userAgent) {
|
||||
client.setUserAgent(userAgent);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -46,13 +46,13 @@ public class TerminologyClientR5 implements TerminologyClient {
|
|||
private final FHIRToolingClient client;
|
||||
private ClientHeaders clientHeaders;
|
||||
|
||||
public TerminologyClientR5(String address) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR5(String address, String userAgent) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address, userAgent);
|
||||
setClientHeaders(new ClientHeaders());
|
||||
}
|
||||
|
||||
public TerminologyClientR5(String address, ClientHeaders clientHeaders) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR5(String address, String userAgent, ClientHeaders clientHeaders) throws URISyntaxException {
|
||||
this.client = new FHIRToolingClient(address, userAgent);
|
||||
setClientHeaders(clientHeaders);
|
||||
}
|
||||
|
||||
|
@ -148,4 +148,10 @@ public class TerminologyClientR5 implements TerminologyClient {
|
|||
this.client.setClientHeaders(this.clientHeaders.headers());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminologyClient setUserAgent(String userAgent) {
|
||||
client.setUserAgent(userAgent);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -117,7 +117,7 @@ public class BatchLoader {
|
|||
|
||||
private static int loadBundle(String server, Bundle b, int size, int start, int end) throws URISyntaxException {
|
||||
System.out.println("Post to "+server+". size = "+Integer.toString(size)+", start = "+Integer.toString(start)+", total = "+Integer.toString(b.getEntry().size()));
|
||||
FHIRToolingClient client = new FHIRToolingClient(server);
|
||||
FHIRToolingClient client = new FHIRToolingClient(server, "fhir/batch-loader");
|
||||
int c = start;
|
||||
if (end == -1)
|
||||
end = b.getEntry().size();
|
||||
|
|
|
@ -111,8 +111,8 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
|||
return res;
|
||||
}
|
||||
|
||||
public void connectToTSServer(String url) throws URISyntaxException {
|
||||
txServer = new FHIRToolingClient(url);
|
||||
public void connectToTSServer(String url, String userAgent) throws URISyntaxException {
|
||||
txServer = new FHIRToolingClient(url, userAgent);
|
||||
}
|
||||
|
||||
private void loadFromFile(InputStream stream, String name) throws IOException, FHIRException {
|
||||
|
|
|
@ -105,6 +105,7 @@ public class ClientUtils {
|
|||
private String password;
|
||||
private ToolingClientLogger logger;
|
||||
private int retryCount;
|
||||
private String userAgent;
|
||||
|
||||
public HttpHost getProxy() {
|
||||
return proxy;
|
||||
|
@ -258,7 +259,9 @@ public class ClientUtils {
|
|||
* @param request
|
||||
*/
|
||||
protected void configureFhirRequest(HttpRequest request, String format, List<Header> headers) {
|
||||
request.addHeader("User-Agent", "Java FHIR Client for FHIR");
|
||||
if (!Utilities.noString(userAgent)) {
|
||||
request.addHeader("User-Agent", userAgent);
|
||||
}
|
||||
|
||||
if (format != null) {
|
||||
request.addHeader("Accept",format);
|
||||
|
@ -663,5 +666,13 @@ public class ClientUtils {
|
|||
this.retryCount = retryCount;
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -100,14 +100,16 @@ public class FHIRToolingClient {
|
|||
private ClientUtils utils = new ClientUtils();
|
||||
|
||||
//Pass enpoint for client - URI
|
||||
public FHIRToolingClient(String baseServiceUrl) throws URISyntaxException {
|
||||
public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException {
|
||||
preferredResourceFormat = ResourceFormat.RESOURCE_XML;
|
||||
utils.setUserAgent(userAgent);
|
||||
detectProxy();
|
||||
initialize(baseServiceUrl);
|
||||
}
|
||||
|
||||
public FHIRToolingClient(String baseServiceUrl, String username, String password) throws URISyntaxException {
|
||||
public FHIRToolingClient(String baseServiceUrl, String userAgent, String username, String password) throws URISyntaxException {
|
||||
preferredResourceFormat = ResourceFormat.RESOURCE_XML;
|
||||
utils.setUserAgent(userAgent);
|
||||
utils.setUsername(username);
|
||||
utils.setPassword(password);
|
||||
detectProxy();
|
||||
|
@ -857,5 +859,11 @@ public class FHIRToolingClient {
|
|||
utils.setRetryCount(retryCount);
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return utils.getUserAgent();
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
utils.setUserAgent(userAgent);
|
||||
}
|
||||
}
|
|
@ -218,8 +218,8 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
|||
loadBytes(name, stream);
|
||||
}
|
||||
|
||||
public String connectToTSServer(String url) throws URISyntaxException {
|
||||
txServer = new FHIRToolingClient(url);
|
||||
public String connectToTSServer(String url, String userAgent) throws URISyntaxException {
|
||||
txServer = new FHIRToolingClient(url, userAgent);
|
||||
txServer.setTimeout(30000);
|
||||
return txServer.getCapabilitiesStatementQuick().getSoftware().getVersion();
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class BatchLoader {
|
|||
|
||||
private static void LoadDirectory(String server, String folder, int size) throws IOException, Exception {
|
||||
System.out.print("Connecting to "+server+".. ");
|
||||
FHIRToolingClient client = new FHIRToolingClient(server);
|
||||
FHIRToolingClient client = new FHIRToolingClient(server, "fhir/batch-loader");
|
||||
System.out.println("Done");
|
||||
|
||||
IniFile ini = new IniFile(Utilities.path(folder, "batch-load-progress.ini"));
|
||||
|
|
|
@ -66,10 +66,12 @@ public class FHIRToolingClient {
|
|||
private ArrayList<Header> headers = new ArrayList<>();
|
||||
private String username;
|
||||
private String password;
|
||||
private String userAgent;
|
||||
|
||||
//Pass endpoint for client - URI
|
||||
public FHIRToolingClient(String baseServiceUrl) throws URISyntaxException {
|
||||
public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException {
|
||||
preferredResourceFormat = ResourceFormat.RESOURCE_XML;
|
||||
this.userAgent = userAgent;
|
||||
initialize(baseServiceUrl);
|
||||
}
|
||||
|
||||
|
@ -280,7 +282,7 @@ public class FHIRToolingClient {
|
|||
if (client.getLogger() != null) {
|
||||
client.getLogger().logRequest("POST", url.toString(), null, body);
|
||||
}
|
||||
result = client.issuePostRequest(url, body, getPreferredResourceFormat(),
|
||||
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
|
||||
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
||||
} else {
|
||||
if (client.getLogger() != null) {
|
||||
|
@ -555,6 +557,9 @@ public class FHIRToolingClient {
|
|||
if(this.headers != null) {
|
||||
this.headers.forEach(header -> builder.add(header.toString()));
|
||||
}
|
||||
if (!Utilities.noString(userAgent)) {
|
||||
builder.add("User-Agent: "+userAgent);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -567,5 +572,13 @@ public class FHIRToolingClient {
|
|||
String base64usernamePassword = Base64.getEncoder().encodeToString(usernamePassword.getBytes());
|
||||
return new Header("Authorization", "Basic " + base64usernamePassword);
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public class FhirRequestBuilder {
|
|||
* @param headers Any additional {@link Headers} to add to the request.
|
||||
*/
|
||||
protected static void formatHeaders(Request.Builder request, String format, Headers headers) {
|
||||
addDefaultHeaders(request);
|
||||
addDefaultHeaders(request, headers);
|
||||
if (format != null) addResourceFormatHeaders(request, format);
|
||||
if (headers != null) addHeaders(request, headers);
|
||||
}
|
||||
|
@ -75,8 +75,10 @@ public class FhirRequestBuilder {
|
|||
*
|
||||
* @param request {@link Request.Builder} to add default headers to.
|
||||
*/
|
||||
protected static void addDefaultHeaders(Request.Builder request) {
|
||||
request.addHeader("User-Agent", "hapi-fhir-tooling-client");
|
||||
protected static void addDefaultHeaders(Request.Builder request, Headers headers) {
|
||||
if (headers == null || !headers.names().contains("User-Agent")) {
|
||||
request.addHeader("User-Agent", "hapi-fhir-tooling-client");
|
||||
}
|
||||
request.addHeader("Accept-Charset", DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
|
@ -203,7 +205,7 @@ public class FhirRequestBuilder {
|
|||
}
|
||||
|
||||
public <T extends Resource> ResourceRequest<T> execute() throws IOException {
|
||||
formatHeaders(httpRequest, resourceFormat, null);
|
||||
formatHeaders(httpRequest, resourceFormat, headers);
|
||||
Response response = getHttpClient().newCall(httpRequest.build()).execute();
|
||||
T resource = unmarshalReference(response, resourceFormat);
|
||||
return new ResourceRequest<T>(resource, response.code(), getLocationHeader(response.headers()));
|
||||
|
|
|
@ -46,8 +46,8 @@ public class TerminologyClientR4 implements TerminologyClient {
|
|||
|
||||
private FHIRToolingClient client;
|
||||
|
||||
public TerminologyClientR4(String address) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address);
|
||||
public TerminologyClientR4(String address, String userAgent) throws URISyntaxException {
|
||||
client = new FHIRToolingClient(address, userAgent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,7 +80,7 @@ public class BatchLoader {
|
|||
|
||||
private static void LoadDirectory(String server, String folder, int size) throws IOException, Exception {
|
||||
System.out.print("Connecting to "+server+".. ");
|
||||
FHIRToolingClient client = new FHIRToolingClient(server);
|
||||
FHIRToolingClient client = new FHIRToolingClient(server, "fhir/batch-loader");
|
||||
System.out.println("Done");
|
||||
|
||||
IniFile ini = new IniFile(Utilities.path(folder, "batch-load-progress.ini"));
|
||||
|
|
|
@ -63,10 +63,12 @@ public class FHIRToolingClient {
|
|||
private ArrayList<Header> headers = new ArrayList<>();
|
||||
private String username;
|
||||
private String password;
|
||||
private String userAgent;
|
||||
|
||||
//Pass endpoint for client - URI
|
||||
public FHIRToolingClient(String baseServiceUrl) throws URISyntaxException {
|
||||
public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException {
|
||||
preferredResourceFormat = ResourceFormat.RESOURCE_XML;
|
||||
this.userAgent = userAgent;
|
||||
initialize(baseServiceUrl);
|
||||
}
|
||||
|
||||
|
@ -277,7 +279,7 @@ public class FHIRToolingClient {
|
|||
if (client.getLogger() != null) {
|
||||
client.getLogger().logRequest("POST", url.toString(), null, body);
|
||||
}
|
||||
result = client.issuePostRequest(url, body, getPreferredResourceFormat(),
|
||||
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
|
||||
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
||||
} else {
|
||||
if (client.getLogger() != null) {
|
||||
|
@ -528,6 +530,9 @@ public class FHIRToolingClient {
|
|||
if(this.headers != null) {
|
||||
this.headers.forEach(header -> builder.add(header.toString()));
|
||||
}
|
||||
if (!Utilities.noString(userAgent)) {
|
||||
builder.add("User-Agent: "+userAgent);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -540,5 +545,13 @@ public class FHIRToolingClient {
|
|||
String base64usernamePassword = Base64.getEncoder().encodeToString(usernamePassword.getBytes());
|
||||
return new Header("Authorization", "Basic " + base64usernamePassword);
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public class FhirRequestBuilder {
|
|||
* @param headers Any additional {@link Headers} to add to the request.
|
||||
*/
|
||||
protected static void formatHeaders(Request.Builder request, String format, Headers headers) {
|
||||
addDefaultHeaders(request);
|
||||
addDefaultHeaders(request, headers);
|
||||
if (format != null) addResourceFormatHeaders(request, format);
|
||||
if (headers != null) addHeaders(request, headers);
|
||||
}
|
||||
|
@ -75,8 +75,10 @@ public class FhirRequestBuilder {
|
|||
*
|
||||
* @param request {@link Request.Builder} to add default headers to.
|
||||
*/
|
||||
protected static void addDefaultHeaders(Request.Builder request) {
|
||||
request.addHeader("User-Agent", "hapi-fhir-tooling-client");
|
||||
protected static void addDefaultHeaders(Request.Builder request, Headers headers) {
|
||||
if (headers == null || !headers.names().contains("User-Agent")) {
|
||||
request.addHeader("User-Agent", "hapi-fhir-tooling-client");
|
||||
}
|
||||
request.addHeader("Accept-Charset", DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
|
@ -203,7 +205,7 @@ public class FhirRequestBuilder {
|
|||
}
|
||||
|
||||
public <T extends Resource> ResourceRequest<T> execute() throws IOException {
|
||||
formatHeaders(httpRequest, resourceFormat, null);
|
||||
formatHeaders(httpRequest, resourceFormat, headers);
|
||||
Response response = getHttpClient().newCall(httpRequest.build()).execute();
|
||||
T resource = unmarshalReference(response, resourceFormat);
|
||||
return new ResourceRequest<T>(resource, response.code(), getLocationHeader(response.headers()));
|
||||
|
|
|
@ -394,7 +394,7 @@ public class ValueSetComparer extends CanonicalResourceComparer {
|
|||
|
||||
private void compareExpansions(ValueSet left, ValueSet right, ValueSetComparison res) {
|
||||
ValueSet expL = left.hasExpansion() ? left : expand(left, res, "left", session.getContextLeft());
|
||||
ValueSet expR = left.hasExpansion() ? left : expand(right, res, "right", session.getContextRight());
|
||||
ValueSet expR = right.hasExpansion() ? right : expand(right, res, "right", session.getContextRight());
|
||||
if (expL != null && expR != null) {
|
||||
// ignore the parameters for now
|
||||
compareConcepts(expL.getExpansion().getContains(), expR.getExpansion().getContains(), res.forceExpansion(), res.getUnion().getExpansion().getContains(), res.getIntersection().getExpansion().getContains(), "ValueSet.expansion.contains", res);
|
||||
|
|
|
@ -2452,19 +2452,19 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
if (webUrl != null) {
|
||||
// also, must touch up the markdown
|
||||
if (element.hasDefinition())
|
||||
element.setDefinition(processRelativeUrls(element.getDefinition(), webUrl, baseSpecUrl()));
|
||||
element.setDefinition(processRelativeUrls(element.getDefinition(), webUrl, baseSpecUrl(), context.getResourceNames()));
|
||||
if (element.hasComment())
|
||||
element.setComment(processRelativeUrls(element.getComment(), webUrl, baseSpecUrl()));
|
||||
element.setComment(processRelativeUrls(element.getComment(), webUrl, baseSpecUrl(), context.getResourceNames()));
|
||||
if (element.hasRequirements())
|
||||
element.setRequirements(processRelativeUrls(element.getRequirements(), webUrl, baseSpecUrl()));
|
||||
element.setRequirements(processRelativeUrls(element.getRequirements(), webUrl, baseSpecUrl(), context.getResourceNames()));
|
||||
if (element.hasMeaningWhenMissing())
|
||||
element.setMeaningWhenMissing(processRelativeUrls(element.getMeaningWhenMissing(), webUrl, baseSpecUrl()));
|
||||
element.setMeaningWhenMissing(processRelativeUrls(element.getMeaningWhenMissing(), webUrl, baseSpecUrl(), context.getResourceNames()));
|
||||
}
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
public static String processRelativeUrls(String markdown, String webUrl, String basePath) {
|
||||
public static String processRelativeUrls(String markdown, String webUrl, String basePath, List<String> resourceNames) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
int i = 0;
|
||||
while (i < markdown.length()) {
|
||||
|
@ -2485,7 +2485,7 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
// This code is trying to guess which relative references are actually to the
|
||||
// base specification.
|
||||
//
|
||||
if (isLikelySourceURLReference(url)) {
|
||||
if (isLikelySourceURLReference(url, resourceNames)) {
|
||||
b.append("](");
|
||||
b.append(basePath);
|
||||
i = i + 1;
|
||||
|
@ -2507,14 +2507,36 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
}
|
||||
|
||||
|
||||
public static boolean isLikelySourceURLReference(String url) {
|
||||
public static boolean isLikelySourceURLReference(String url, List<String> resourceNames) {
|
||||
if (resourceNames != null) {
|
||||
for (String n : resourceNames) {
|
||||
if (url.startsWith(n.toLowerCase()+".html")) {
|
||||
return true;
|
||||
}
|
||||
if (url.startsWith(n.toLowerCase()+"-definitions.html")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
url.startsWith("extensibility.html") ||
|
||||
url.startsWith("terminologies.html") ||
|
||||
url.startsWith("observation.html") ||
|
||||
url.startsWith("codesystem.html") ||
|
||||
url.startsWith("fhirpath.html") ||
|
||||
url.startsWith("datatypes.html") ||
|
||||
url.startsWith("operations.html") ||
|
||||
url.startsWith("resource.html") ||
|
||||
url.startsWith("elementdefinition.html") ||
|
||||
url.startsWith("element-definitions.html") ||
|
||||
url.startsWith("snomedct.html") ||
|
||||
url.startsWith("loinc.html") ||
|
||||
url.startsWith("http.html") ||
|
||||
url.startsWith("references") ||
|
||||
url.startsWith("narrative.html") ||
|
||||
(url.startsWith("extension-") || url.contains(".html")) ||
|
||||
url.startsWith("search.html") ||
|
||||
url.startsWith("patient-operation-match.html") ||
|
||||
(url.startsWith("extension-") && url.contains(".html")) ||
|
||||
url.startsWith("resource-definitions.html");
|
||||
}
|
||||
|
||||
|
|
|
@ -207,6 +207,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
|||
protected TimeTracker clock;
|
||||
private boolean tlogging = true;
|
||||
private ICanonicalResourceLocator locator;
|
||||
protected String userAgent;
|
||||
|
||||
public BaseWorkerContext() throws FileNotFoundException, IOException, FHIRException {
|
||||
txCache = new TerminologyCache(lock, null);
|
||||
|
@ -2100,4 +2101,14 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
|||
this.locator = locator;
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
if (txClient != null)
|
||||
txClient.setUserAgent(userAgent);
|
||||
}
|
||||
|
||||
}
|
|
@ -296,6 +296,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
|||
txLog = new HTMLClientLogger(log);
|
||||
}
|
||||
txClient.setLogger(txLog);
|
||||
txClient.setUserAgent(userAgent);
|
||||
CapabilityStatement cps = txClient.getCapabilitiesStatementQuick();
|
||||
setTxCaps(txClient.getTerminologyCapabilities());
|
||||
return cps.getSoftware().getVersion();
|
||||
|
|
|
@ -54,4 +54,5 @@ public interface TerminologyClient {
|
|||
CanonicalResource read(String type, String id);
|
||||
ClientHeaders getClientHeaders();
|
||||
TerminologyClient setClientHeaders(ClientHeaders clientHeaders);
|
||||
TerminologyClient setUserAgent(String userAgent);
|
||||
}
|
|
@ -117,7 +117,7 @@ public class BatchLoader {
|
|||
|
||||
private static int loadBundle(String server, Bundle b, int size, int start, int end) throws URISyntaxException {
|
||||
System.out.println("Post to "+server+". size = "+Integer.toString(size)+", start = "+Integer.toString(start)+", total = "+Integer.toString(b.getEntry().size()));
|
||||
FHIRToolingClient client = new FHIRToolingClient(server);
|
||||
FHIRToolingClient client = new FHIRToolingClient(server, "fhir/batch-loader");
|
||||
int c = start;
|
||||
if (end == -1)
|
||||
end = b.getEntry().size();
|
||||
|
|
|
@ -95,10 +95,12 @@ public class FHIRToolingClient {
|
|||
private ArrayList<Header> headers = new ArrayList<>();
|
||||
private String username;
|
||||
private String password;
|
||||
private String userAgent;
|
||||
|
||||
//Pass endpoint for client - URI
|
||||
public FHIRToolingClient(String baseServiceUrl) throws URISyntaxException {
|
||||
public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException {
|
||||
preferredResourceFormat = ResourceFormat.RESOURCE_XML;
|
||||
this.userAgent = userAgent;
|
||||
initialize(baseServiceUrl);
|
||||
}
|
||||
|
||||
|
@ -309,7 +311,7 @@ public class FHIRToolingClient {
|
|||
if (client.getLogger() != null) {
|
||||
client.getLogger().logRequest("POST", url.toString(), null, body);
|
||||
}
|
||||
result = client.issuePostRequest(url, body, getPreferredResourceFormat(),
|
||||
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
|
||||
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
||||
} else {
|
||||
if (client.getLogger() != null) {
|
||||
|
@ -336,7 +338,9 @@ public class FHIRToolingClient {
|
|||
public Bundle transaction(Bundle batch) {
|
||||
Bundle transactionResult = null;
|
||||
try {
|
||||
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), "transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size()));
|
||||
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
|
||||
generateHeaders(),
|
||||
"transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size()));
|
||||
} catch (Exception e) {
|
||||
handleException("An error occurred trying to process this transaction request", e);
|
||||
}
|
||||
|
@ -560,6 +564,9 @@ public class FHIRToolingClient {
|
|||
if(this.headers != null) {
|
||||
this.headers.forEach(header -> builder.add(header.toString()));
|
||||
}
|
||||
if (!Utilities.noString(userAgent)) {
|
||||
builder.add("User-Agent: "+userAgent);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -572,5 +579,15 @@ public class FHIRToolingClient {
|
|||
String base64usernamePassword = Base64.getEncoder().encodeToString(usernamePassword.getBytes());
|
||||
return new Header("Authorization", "Basic " + base64usernamePassword);
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ public class Client {
|
|||
public Bundle postBatchRequest(URI resourceUri,
|
||||
byte[] payload,
|
||||
String resourceFormat,
|
||||
Headers headers,
|
||||
String message,
|
||||
int timeout) throws IOException {
|
||||
if (payload == null) throw new EFhirClientException("POST requests require a non-null payload");
|
||||
|
@ -157,7 +158,7 @@ public class Client {
|
|||
.url(resourceUri.toURL())
|
||||
.post(body);
|
||||
|
||||
return executeBundleRequest(request, resourceFormat, new Headers.Builder().build(), message, retryCount, timeout);
|
||||
return executeBundleRequest(request, resourceFormat, headers, message, retryCount, timeout);
|
||||
}
|
||||
|
||||
public <T extends Resource> Bundle executeBundleRequest(Request.Builder request,
|
||||
|
|
|
@ -63,7 +63,7 @@ public class FhirRequestBuilder {
|
|||
* @param headers Any additional {@link Headers} to add to the request.
|
||||
*/
|
||||
protected static void formatHeaders(Request.Builder request, String format, Headers headers) {
|
||||
addDefaultHeaders(request);
|
||||
addDefaultHeaders(request, headers);
|
||||
if (format != null) addResourceFormatHeaders(request, format);
|
||||
if (headers != null) addHeaders(request, headers);
|
||||
}
|
||||
|
@ -75,8 +75,10 @@ public class FhirRequestBuilder {
|
|||
*
|
||||
* @param request {@link Request.Builder} to add default headers to.
|
||||
*/
|
||||
protected static void addDefaultHeaders(Request.Builder request) {
|
||||
request.addHeader("User-Agent", "hapi-fhir-tooling-client");
|
||||
protected static void addDefaultHeaders(Request.Builder request, Headers headers) {
|
||||
if (headers == null || !headers.names().contains("User-Agent")) {
|
||||
request.addHeader("User-Agent", "hapi-fhir-tooling-client");
|
||||
}
|
||||
request.addHeader("Accept-Charset", DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
|
@ -203,7 +205,7 @@ public class FhirRequestBuilder {
|
|||
}
|
||||
|
||||
public <T extends Resource> ResourceRequest<T> execute() throws IOException {
|
||||
formatHeaders(httpRequest, resourceFormat, null);
|
||||
formatHeaders(httpRequest, resourceFormat, headers);
|
||||
Response response = getHttpClient().newCall(httpRequest.build()).execute();
|
||||
T resource = unmarshalReference(response, resourceFormat);
|
||||
return new ResourceRequest<T>(resource, response.code(), getLocationHeader(response.headers()));
|
||||
|
|
|
@ -65,7 +65,7 @@ class FHIRToolingClientTest {
|
|||
Mockito.when(mockClient.executeBundleRequest(Mockito.any(Request.Builder.class), Mockito.anyString(),
|
||||
Mockito.any(Headers.class), Mockito.anyString(), Mockito.anyInt(), Mockito.anyLong()))
|
||||
.thenReturn(generateBundle());
|
||||
toolingClient = new FHIRToolingClient(TX_ADDR);
|
||||
toolingClient = new FHIRToolingClient(TX_ADDR, "fhir/test-cases");
|
||||
toolingClient.setClient(mockClient);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class FhirRequestBuilderTest {
|
|||
@DisplayName("Test default headers are added correctly.")
|
||||
void addDefaultHeaders() {
|
||||
Request.Builder request = new Request.Builder().url("http://www.google.com");
|
||||
FhirRequestBuilder.addDefaultHeaders(request);
|
||||
FhirRequestBuilder.addDefaultHeaders(request, null);
|
||||
|
||||
Map<String, List<String>> headersMap = request.build().headers().toMultimap();
|
||||
Assertions.assertNotNull(headersMap.get("User-Agent"), "User-Agent header null.");
|
||||
|
|
|
@ -121,19 +121,23 @@ public class ZipGenerator {
|
|||
File f = new CSFile(actualDir);
|
||||
|
||||
String files[] = f.list();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
if ( new CSFile(actualDir + files[i]).isFile() && ((ext == null || files[i].endsWith(ext)) && (noExt == null || !files[i].endsWith(noExt)))) {
|
||||
FileInputStream fi = new FileInputStream(actualDir + files[i]);
|
||||
BufferedInputStream origin = new BufferedInputStream(fi, BUFFER);
|
||||
ZipEntry entry = new ZipEntry(statedDir + files[i]);
|
||||
names.add(statedDir + files[i]);
|
||||
out.putNextEntry(entry);
|
||||
int count;
|
||||
while ((count = origin.read(data, 0, BUFFER)) != -1) {
|
||||
out.write(data, 0, count);
|
||||
}
|
||||
origin.close();
|
||||
}
|
||||
if (files == null) {
|
||||
System.out.println("no files found in "+f.getName());
|
||||
} else {
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
if ( new CSFile(actualDir + files[i]).isFile() && ((ext == null || files[i].endsWith(ext)) && (noExt == null || !files[i].endsWith(noExt)))) {
|
||||
FileInputStream fi = new FileInputStream(actualDir + files[i]);
|
||||
BufferedInputStream origin = new BufferedInputStream(fi, BUFFER);
|
||||
ZipEntry entry = new ZipEntry(statedDir + files[i]);
|
||||
names.add(statedDir + files[i]);
|
||||
out.putNextEntry(entry);
|
||||
int count;
|
||||
while ((count = origin.read(data, 0, BUFFER)) != -1) {
|
||||
out.write(data, 0, count);
|
||||
}
|
||||
origin.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -510,7 +510,7 @@ public class I18nConstants {
|
|||
public static final String TYPE_SPECIFIC_CHECKS_DT_CANONICAL_TYPE = "TYPE_SPECIFIC_CHECKS_DT_CANONICAL_TYPE";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_CANONICAL_RESOLVE = "TYPE_SPECIFIC_CHECKS_DT_CANONICAL_RESOLVE";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_UUID_STRAT = "Type_Specific_Checks_DT_UUID_Strat";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_UUID_VAID = "Type_Specific_Checks_DT_UUID_Vaid";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_UUID_VALID = "Type_Specific_Checks_DT_UUID_Valid";
|
||||
public static final String UNABLE_TO_CONNECT_TO_TERMINOLOGY_SERVER = "Unable_to_connect_to_terminology_server";
|
||||
public static final String UNABLE_TO_CONNECT_TO_TERMINOLOGY_SERVER_USE_PARAMETER_TX_NA_TUN_RUN_WITHOUT_USING_TERMINOLOGY_SERVICES_TO_VALIDATE_LOINC_SNOMED_ICDX_ETC_ERROR__ = "Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__";
|
||||
public static final String UNABLE_TO_FIND_BASE_DEFINITION_FOR_LOGICAL_MODEL__FROM_ = "Unable_to_find_base_definition_for_logical_model__from_";
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.io.InputStream;
|
|||
import java.math.BigDecimal;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
|
@ -674,6 +675,16 @@ public class JsonTrackingParser {
|
|||
return gson.toJson(json);
|
||||
}
|
||||
|
||||
public static byte[] writeBytes(JsonObject json, boolean pretty) {
|
||||
if (pretty) {
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
return gson.toJson(json).getBytes(StandardCharsets.UTF_8);
|
||||
} else {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
return gson.toJson(json).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
|
||||
public static JsonObject fetchJson(String source) throws IOException {
|
||||
URL url = new URL(source+"?nocache=" + System.currentTimeMillis());
|
||||
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
||||
|
|
|
@ -64,6 +64,7 @@ import org.hl7.fhir.utilities.TextFile;
|
|||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.json.JSONUtil;
|
||||
import org.hl7.fhir.utilities.json.JsonTrackingParser;
|
||||
import org.hl7.fhir.utilities.npm.NpmPackage.ITransformingLoader;
|
||||
import org.hl7.fhir.utilities.npm.NpmPackage.PackageResourceInformationSorter;
|
||||
import org.hl7.fhir.utilities.npm.PackageGenerator.PackageType;
|
||||
|
||||
|
@ -84,6 +85,12 @@ import com.google.gson.JsonObject;
|
|||
*/
|
||||
public class NpmPackage {
|
||||
|
||||
public interface ITransformingLoader {
|
||||
|
||||
byte[] load(File f);
|
||||
|
||||
}
|
||||
|
||||
public class PackageResourceInformationSorter implements Comparator<PackageResourceInformation> {
|
||||
@Override
|
||||
public int compare(PackageResourceInformation o1, PackageResourceInformation o2) {
|
||||
|
@ -1054,6 +1061,18 @@ public class NpmPackage {
|
|||
}
|
||||
}
|
||||
|
||||
public void loadAllFiles(ITransformingLoader loader) throws IOException {
|
||||
for (String folder : folders.keySet()) {
|
||||
NpmPackageFolder pf = folders.get(folder);
|
||||
String p = folder.contains("$") ? path : Utilities.path(path, folder);
|
||||
for (File f : new File(p).listFiles()) {
|
||||
if (!f.isDirectory() && !isInternalExemptFile(f)) {
|
||||
pf.getContent().put(f.getName(), loader.load(f));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isChangedByLoader() {
|
||||
return changedByLoader;
|
||||
}
|
||||
|
|
|
@ -598,7 +598,7 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
|
|||
TableModel model = new TableModel(id, isActive);
|
||||
|
||||
model.setAlternating(alternating);
|
||||
model.setDocoImg(prefix+"help16.png");
|
||||
model.setDocoImg(Utilities.pathURL(prefix, "help16.png"));
|
||||
model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table"));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Flags"), translate("sd.hint", "Information about the use of the element"), null, 0));
|
||||
|
@ -615,7 +615,7 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
|
|||
TableModel model = new TableModel(id, true);
|
||||
|
||||
model.setAlternating(true);
|
||||
model.setDocoImg(prefix+"help16.png");
|
||||
model.setDocoImg(Utilities.pathURL(prefix, "help16.png"));
|
||||
model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table"));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Flags"), translate("sd.hint", "Information about the use of the element - Left Structure"), null, 0).setStyle("border-left: 1px grey solid"));
|
||||
|
|
|
@ -208,7 +208,7 @@ Type_Specific_Checks_DT_URI_UUID = URI values cannot start with uuid:
|
|||
Type_Specific_Checks_DT_URI_WS = URI values cannot have whitespace(''{0}'')
|
||||
Type_Specific_Checks_DT_URL_Resolve = URL value ''{0}'' does not resolve
|
||||
Type_Specific_Checks_DT_UUID_Strat = UUIDs must start with urn:uuid:
|
||||
Type_Specific_Checks_DT_UUID_Vaid = UUIDs must be valid
|
||||
Type_Specific_Checks_DT_UUID_Valid = UUIDs must be valid (and lowercase)
|
||||
Validation_BUNDLE_Message = The first entry in a message must be a MessageHeader
|
||||
Validation_VAL_Content_Unknown = Unrecognised Content {0}
|
||||
Validation_VAL_NoType = Unknown type {0}
|
||||
|
|
|
@ -189,23 +189,26 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
|
|||
igLoader = new IgLoader(getPcm(), getContext(), getVersion(), isDebug());
|
||||
}
|
||||
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, boolean canRunWithoutTerminologyServer, String vString) throws FHIRException, IOException, URISyntaxException {
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, boolean canRunWithoutTerminologyServer, String vString, String userAgent) throws FHIRException, IOException, URISyntaxException {
|
||||
loadCoreDefinitions(src, false, null);
|
||||
getContext().setUserAgent(userAgent);
|
||||
getContext().setCanRunWithoutTerminology(canRunWithoutTerminologyServer);
|
||||
setTerminologyServer(txsrvr, txLog, version);
|
||||
setVersion(vString);
|
||||
igLoader = new IgLoader(getPcm(), getContext(), getVersion(), isDebug());
|
||||
}
|
||||
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, String vString) throws FHIRException, IOException, URISyntaxException {
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, String vString, String userAgent) throws FHIRException, IOException, URISyntaxException {
|
||||
loadCoreDefinitions(src, false, null);
|
||||
getContext().setUserAgent(userAgent);
|
||||
setTerminologyServer(txsrvr, txLog, version);
|
||||
setVersion(vString);
|
||||
igLoader = new IgLoader(getPcm(), getContext(), getVersion(), isDebug());
|
||||
}
|
||||
|
||||
public ValidationEngine(String src, String vString, TimeTracker tt) throws FHIRException, IOException, URISyntaxException {
|
||||
public ValidationEngine(String src, String vString, TimeTracker tt, String userAgent) throws FHIRException, IOException, URISyntaxException {
|
||||
loadCoreDefinitions(src, false, tt);
|
||||
getContext().setUserAgent(userAgent);
|
||||
setVersion(vString);
|
||||
igLoader = new IgLoader(getPcm(), getContext(), getVersion(), isDebug());
|
||||
}
|
||||
|
@ -271,7 +274,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
|
|||
return "n/a: No Terminology Server";
|
||||
} else {
|
||||
try {
|
||||
return context.connectToTSServer(TerminologyClientFactory.makeClient(url, version), log);
|
||||
return context.connectToTSServer(TerminologyClientFactory.makeClient(url, context.getUserAgent(), version), log);
|
||||
} catch (Exception e) {
|
||||
if (context.isCanRunWithoutTerminology()) {
|
||||
return "n/a: Running without Terminology Server (error: " + e.getMessage() + ")";
|
||||
|
|
|
@ -231,7 +231,7 @@ public class StandAloneValidatorFetcher implements IValidatorResourceFetcher, IC
|
|||
String root = getRoot(p, url);
|
||||
if (root != null) {
|
||||
TerminologyClient c;
|
||||
c = TerminologyClientFactory.makeClient(root, context.getVersion());
|
||||
c = TerminologyClientFactory.makeClient(root, "fhir/validator", context.getVersion());
|
||||
return c.read(p[p.length - 2], p[p.length - 1]);
|
||||
} else {
|
||||
throw new FHIRException("The URL '" + url + "' is not known to the FHIR validator, and has not been provided as part of the setup / parameters");
|
||||
|
|
|
@ -265,7 +265,7 @@ public class ValidationService {
|
|||
System.out.println("No such cached session exists for session id " + sessionId + ", re-instantiating validator.");
|
||||
}
|
||||
System.out.print(" Load FHIR v" + cliContext.getSv() + " from " + definitions);
|
||||
ValidationEngine validator = new ValidationEngine(definitions, cliContext.getSv(), tt);
|
||||
ValidationEngine validator = new ValidationEngine(definitions, cliContext.getSv(), tt, "fhir/validator");
|
||||
sessionId = sessionCache.cacheSession(validator);
|
||||
|
||||
FhirPublication ver = FhirPublication.fromCode(cliContext.getSv());
|
||||
|
|
|
@ -87,7 +87,7 @@ public class Common {
|
|||
|
||||
public static ValidationEngine getValidationEngine(String version, String txServer, String definitions, String txLog, TimeTracker tt) throws Exception {
|
||||
System.out.println("Loading (v = " + version + ", tx server -> " + txServer + ")");
|
||||
ValidationEngine ve = new ValidationEngine(definitions, version, tt);
|
||||
ValidationEngine ve = new ValidationEngine(definitions, version, tt, "fhir/validator");
|
||||
ve.connectToTSServer(txServer, txLog, FhirPublication.fromCode(version));
|
||||
return ve;
|
||||
}
|
||||
|
|
|
@ -2035,7 +2035,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
}
|
||||
|
||||
if (url != null && url.startsWith("urn:uuid:")) {
|
||||
rule(errors, IssueType.INVALID, e.line(), e.col(), path, Utilities.isValidUUID(url.substring(9)), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_UUID_VAID);
|
||||
rule(errors, IssueType.INVALID, e.line(), e.col(), path, Utilities.isValidUUID(url.substring(9)), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_UUID_VALID);
|
||||
}
|
||||
if (url != null && url.startsWith("urn:oid:")) {
|
||||
rule(errors, IssueType.INVALID, e.line(), e.col(), path, Utilities.isOid(url.substring(8)), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_OID_VALID);
|
||||
|
|
|
@ -17,8 +17,8 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
public class ValidationEngineTests {
|
||||
|
||||
private static final String DEF_TX = "http://tx.fhir.org";
|
||||
private static final String DBG_TX = "http://local.fhir.org:960";
|
||||
public static final String DEF_TX = "http://tx.fhir.org";
|
||||
// public static final String DEF_TX = "http://local.fhir.org:960";
|
||||
|
||||
public static boolean inbuild;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class ValidationEngineTests {
|
|||
public void testCurrentXml() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("TestCurrentXml: Validate patient-example.xml in Current version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1", "fhir/test-cases");
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient-example.xml"), null);
|
||||
int e = errors(op);
|
||||
int w = warnings(op);
|
||||
|
@ -46,7 +46,7 @@ public class ValidationEngineTests {
|
|||
public void testCurrentJson() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("TestCurrentJson: Validate patient-example.json in Current version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1", "fhir/test-cases");
|
||||
OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "patient-example.json"), null);
|
||||
int e = errors(op);
|
||||
int w = warnings(op);
|
||||
|
@ -66,8 +66,8 @@ public class ValidationEngineTests {
|
|||
}
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Test140: Validate patient-example.xml in v1.4.0 version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, null, FhirPublication.DSTU2016May, "1.4.0");
|
||||
ve.setNoInvariantChecks(true);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, null, FhirPublication.DSTU2016May, "1.4.0", "fhir/test-cases");
|
||||
ve.getContext().setUserAgent("fhir/test-cases");
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient140.xml"), null);
|
||||
if (!TestUtilities.silent)
|
||||
for (OperationOutcomeIssueComponent iss : op.getIssue()) {
|
||||
|
@ -91,7 +91,7 @@ public class ValidationEngineTests {
|
|||
}
|
||||
if (!org.hl7.fhir.validation.tests.utilities.TestUtilities.silent)
|
||||
System.out.println("Test102: Validate patient-example.xml in v1.0.2 version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2", "fhir/test-cases");
|
||||
ve.setNoInvariantChecks(true);
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient102.xml"), null);
|
||||
if (!TestUtilities.silent)
|
||||
|
@ -116,7 +116,7 @@ public class ValidationEngineTests {
|
|||
}
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("TestObs102: Validate patient-example.xml in v1.0.2 version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2", "fhir/test-cases");
|
||||
ve.setNoInvariantChecks(true);
|
||||
OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "observation102.json"), null);
|
||||
if (!TestUtilities.silent)
|
||||
|
@ -138,7 +138,7 @@ public class ValidationEngineTests {
|
|||
public void test301() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Test301: Validate observation301.xml against Core");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2", "fhir/test-cases");
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println(" .. load USCore");
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "observation301.xml"), null);
|
||||
|
@ -157,7 +157,7 @@ public class ValidationEngineTests {
|
|||
public void test301USCore() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Test301USCore: Validate patient300.xml against US-Core");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2", "fhir/test-cases");
|
||||
IgLoader igLoader = new IgLoader(ve.getPcm(), ve.getContext(), ve.getVersion(), true);
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println(" .. load USCore");
|
||||
|
|
|
@ -110,8 +110,6 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
|
|||
private String version;
|
||||
private String name;
|
||||
|
||||
private static final String DEF_TX = "http://tx.fhir.org";
|
||||
// private static final String DEF_TX = "http://local.fhir.org:960";
|
||||
private static Map<String, ValidationEngine> ve = new HashMap<>();
|
||||
private static ValidationEngine vCurr;
|
||||
private static IgLoader igLoader;
|
||||
|
@ -142,19 +140,20 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
|
|||
version = VersionUtilities.getMajMin(version);
|
||||
if (!ve.containsKey(version)) {
|
||||
if (version.startsWith("5.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r5.core#4.5.0", DEF_TX, txLog, FhirPublication.R5, true, "4.5.0"));
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r5.core#4.5.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R5, true, "4.5.0", "fhir/test-cases"));
|
||||
else if (version.startsWith("3.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2"));
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r3.core#3.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2", "fhir/test-cases"));
|
||||
else if (version.startsWith("4.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, txLog, FhirPublication.R4, true, "4.0.1"));
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r4.core#4.0.1", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R4, true, "4.0.1", "fhir/test-cases"));
|
||||
else if (version.startsWith("1.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, txLog, FhirPublication.DSTU2, true, "1.0.2"));
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r2.core#1.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2, true, "1.0.2", "fhir/test-cases"));
|
||||
else if (version.startsWith("1.4"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, txLog, FhirPublication.DSTU2016May, true, "1.4.0"));
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r2b.core#1.4.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2016May, true, "1.4.0", "fhir/test-cases"));
|
||||
else
|
||||
throw new Exception("unknown version " + version);
|
||||
}
|
||||
vCurr = ve.get(version);
|
||||
vCurr.getContext().setUserAgent("fhir/test-cases");
|
||||
igLoader = new IgLoader(vCurr.getPcm(), vCurr.getContext(), vCurr.getVersion(), true);
|
||||
if (TestingUtilities.fcontexts == null) {
|
||||
TestingUtilities.fcontexts = new HashMap<>();
|
||||
|
|
Loading…
Reference in New Issue