find value sets on tx server if not tx.fhir.org

This commit is contained in:
Grahame Grieve 2024-06-06 19:41:18 +10:00
parent 0250f3ce34
commit 765b4da292
1 changed files with 24 additions and 20 deletions

View File

@ -439,15 +439,18 @@ public class TerminologyClientManager {
} }
public SourcedValueSet findValueSetOnServer(String canonical) { public SourcedValueSet findValueSetOnServer(String canonical) {
if (IGNORE_TX_REGISTRY || getMasterClient() == null || !useEcosystem) { if (IGNORE_TX_REGISTRY || getMasterClient() == null) {
return null; return null;
} }
String request = Utilities.pathURL(monitorServiceURL, "resolve?fhirVersion="+factory.getVersion()+"&valueSet="+Utilities.URLEncode(canonical)); String request = Utilities.pathURL(monitorServiceURL, "resolve?fhirVersion="+factory.getVersion()+"&valueSet="+Utilities.URLEncode(canonical));
String server = null;
try {
if (!useEcosystem) {
server = getMasterClient().getAddress();
} else {
if (usage != null) { if (usage != null) {
request = request + "&usage="+usage; request = request + "&usage="+usage;
} }
String server = null;
try {
JsonObject json = JsonParser.parseObjectFromUrl(request); JsonObject json = JsonParser.parseObjectFromUrl(request);
for (JsonObject item : json.getJsonObjects("authoritative")) { for (JsonObject item : json.getJsonObjects("authoritative")) {
if (server == null) { if (server == null) {
@ -468,6 +471,7 @@ public class TerminologyClientManager {
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
} }
} }
}
TerminologyClientContext client = serverMap.get(server); TerminologyClientContext client = serverMap.get(server);
if (client == null) { if (client == null) {
try { try {