adding option to set tx server to null for api calls: (#316)

This commit is contained in:
Mark Iantorno 2020-08-25 11:18:14 -04:00 committed by GitHub
parent 3ff241bcf8
commit 8505fcf580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import org.hl7.fhir.validation.ValidationEngine;
public class Common {
public static final String DEFAULT_TX_SERVER = "http://tx.fhir.org";
public static String getVersion(String[] args) {
String v = Params.getParam(args, "-version");
if (v == null) {
@ -75,9 +77,16 @@ public class Common {
}
}
/**
* Default validation engine will point to "http://tx.fhir.org" terminology server.
*/
public static ValidationEngine getValidationEngine(String version, String definitions, String txLog) throws Exception {
System.out.println("Loading (v = " + version + ", tx server http://tx.fhir.org)");
return new ValidationEngine(definitions, "http://tx.fhir.org", txLog, FhirPublication.fromCode(version), version);
return getValidationEngine(version, DEFAULT_TX_SERVER, definitions, txLog);
}
public static ValidationEngine getValidationEngine(String version, String txServer, String definitions, String txLog) throws Exception {
System.out.println("Loading (v = " + version + ", tx server -> " + txServer + ")");
return new ValidationEngine(definitions, txServer, txLog, FhirPublication.fromCode(version), version);
}
}