version notes
This commit is contained in:
commit
a6df87b0a4
|
@ -1,8 +1,14 @@
|
|||
Validator Changes:
|
||||
* no effective changes
|
||||
* fix issue for content references in versions before R3
|
||||
* Add on the fly retrieval of profiles in the validator
|
||||
* Fix bug where validator reported 'not done yet' for invalid contained references
|
||||
* Fix for wrong reference to Any in cross version extensions
|
||||
|
||||
Other Code Changes:
|
||||
* fix bug converting type mode in Structure Map
|
||||
* fix bug converting Timing.when (issue 383)
|
||||
* fix bug doing date time comparisons with seconds in FHIRPath
|
||||
* Add support for instance-name and instance-description extensions
|
||||
* Fix for bundle renderer trying to render resources from the wrong version
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.hl7.fhir.r5.utils.client.network.ResourceRequest;
|
|||
import org.hl7.fhir.utilities.ToolingClientLogger;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
@ -234,7 +235,7 @@ public class FHIRToolingClient {
|
|||
try {
|
||||
result = client.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
|
||||
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
|
||||
getPreferredResourceFormat(),"Update " + resource.fhirType() + "/" + id, TIMEOUT_OPERATION);
|
||||
getPreferredResourceFormat(), "Update " + resource.fhirType() + "/" + id, TIMEOUT_OPERATION);
|
||||
if (result.isUnsuccessfulRequest()) {
|
||||
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
||||
}
|
||||
|
@ -360,7 +361,7 @@ public class FHIRToolingClient {
|
|||
if (result.isUnsuccessfulRequest()) {
|
||||
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result == null ? null : (ValueSet) result.getPayload();
|
||||
|
@ -371,7 +372,7 @@ public class FHIRToolingClient {
|
|||
org.hl7.fhir.r5.utils.client.network.ResourceRequest<Resource> result = null;
|
||||
try {
|
||||
result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params), getPreferredResourceFormat(), "CodeSystem/$lookup", TIMEOUT_NORMAL);
|
||||
} catch (MalformedURLException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (result.isUnsuccessfulRequest()) {
|
||||
|
@ -393,7 +394,7 @@ public class FHIRToolingClient {
|
|||
if (result.isUnsuccessfulRequest()) {
|
||||
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result == null ? null : (ValueSet) result.getPayload();
|
||||
|
@ -413,7 +414,7 @@ public class FHIRToolingClient {
|
|||
if (result.isUnsuccessfulRequest()) {
|
||||
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result == null ? null : (ConceptMap) result.getPayload();
|
||||
|
@ -430,7 +431,7 @@ public class FHIRToolingClient {
|
|||
if (result.isUnsuccessfulRequest()) {
|
||||
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result == null ? null : (ConceptMap) result.getPayload();
|
||||
|
|
|
@ -74,7 +74,7 @@ public class Client {
|
|||
public <T extends Resource> ResourceRequest<T> issueOptionsRequest(URI optionsUri,
|
||||
String resourceFormat,
|
||||
String message,
|
||||
long timeout) throws MalformedURLException {
|
||||
long timeout) throws IOException {
|
||||
Request.Builder request = new Request.Builder()
|
||||
.method("OPTIONS", null)
|
||||
.url(optionsUri.toURL());
|
||||
|
@ -85,7 +85,7 @@ public class Client {
|
|||
public <T extends Resource> ResourceRequest<T> issueGetResourceRequest(URI resourceUri,
|
||||
String resourceFormat,
|
||||
String message,
|
||||
long timeout) throws MalformedURLException {
|
||||
long timeout) throws IOException {
|
||||
Request.Builder request = new Request.Builder()
|
||||
.url(resourceUri.toURL());
|
||||
|
||||
|
@ -96,7 +96,7 @@ public class Client {
|
|||
byte[] payload,
|
||||
String resourceFormat,
|
||||
String message,
|
||||
long timeout) throws MalformedURLException {
|
||||
long timeout) throws IOException {
|
||||
return issuePutRequest(resourceUri, payload, resourceFormat, null, message, timeout);
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public class Client {
|
|||
String resourceFormat,
|
||||
Headers headers,
|
||||
String message,
|
||||
long timeout) throws MalformedURLException {
|
||||
long timeout) throws IOException {
|
||||
if (payload == null) throw new EFhirClientException("PUT requests require a non-null payload");
|
||||
RequestBody body = RequestBody.create(payload);
|
||||
Request.Builder request = new Request.Builder()
|
||||
|
@ -119,7 +119,7 @@ public class Client {
|
|||
byte[] payload,
|
||||
String resourceFormat,
|
||||
String message,
|
||||
long timeout) throws MalformedURLException {
|
||||
long timeout) throws IOException {
|
||||
return issuePostRequest(resourceUri, payload, resourceFormat, null, message, timeout);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ public class Client {
|
|||
String resourceFormat,
|
||||
Headers headers,
|
||||
String message,
|
||||
long timeout) throws MalformedURLException {
|
||||
long timeout) throws IOException {
|
||||
if (payload == null) throw new EFhirClientException("POST requests require a non-null payload");
|
||||
RequestBody body = RequestBody.create(MediaType.parse(resourceFormat + ";charset=" + DEFAULT_CHARSET), payload);
|
||||
Request.Builder request = new Request.Builder()
|
||||
|
@ -138,14 +138,14 @@ public class Client {
|
|||
return executeFhirRequest(request, resourceFormat, headers, message, retryCount, timeout);
|
||||
}
|
||||
|
||||
public boolean issueDeleteRequest(URI resourceUri) throws MalformedURLException {
|
||||
public boolean issueDeleteRequest(URI resourceUri) throws IOException {
|
||||
Request.Builder request = new Request.Builder()
|
||||
.url(resourceUri.toURL())
|
||||
.delete();
|
||||
return executeFhirRequest(request, null, null, null, retryCount, timeout).isSuccessfulRequest();
|
||||
}
|
||||
|
||||
public Bundle issueGetFeedRequest(URI resourceUri, String resourceFormat) throws MalformedURLException {
|
||||
public Bundle issueGetFeedRequest(URI resourceUri, String resourceFormat) throws IOException {
|
||||
Request.Builder request = new Request.Builder()
|
||||
.url(resourceUri.toURL());
|
||||
|
||||
|
@ -171,7 +171,7 @@ public class Client {
|
|||
byte[] payload,
|
||||
String resourceFormat,
|
||||
String message,
|
||||
int timeout) throws MalformedURLException {
|
||||
int timeout) throws IOException {
|
||||
if (payload == null) throw new EFhirClientException("POST requests require a non-null payload");
|
||||
RequestBody body = RequestBody.create(MediaType.parse(resourceFormat + ";charset=" + DEFAULT_CHARSET), payload);
|
||||
Request.Builder request = new Request.Builder()
|
||||
|
@ -186,7 +186,7 @@ public class Client {
|
|||
Headers headers,
|
||||
String message,
|
||||
int retryCount,
|
||||
long timeout) {
|
||||
long timeout) throws IOException {
|
||||
return new FhirRequestBuilder(request)
|
||||
.withLogger(logger)
|
||||
.withResourceFormat(resourceFormat)
|
||||
|
@ -202,7 +202,7 @@ public class Client {
|
|||
Headers headers,
|
||||
String message,
|
||||
int retryCount,
|
||||
long timeout) {
|
||||
long timeout) throws IOException {
|
||||
return new FhirRequestBuilder(request)
|
||||
.withLogger(logger)
|
||||
.withResourceFormat(resourceFormat)
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package org.hl7.fhir.r5.utils.client.network;
|
||||
|
||||
import kotlin.Pair;
|
||||
import okhttp3.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.formats.IParser;
|
||||
import org.hl7.fhir.r5.formats.JsonParser;
|
||||
import org.hl7.fhir.r5.formats.XmlParser;
|
||||
|
@ -16,7 +14,10 @@ import org.hl7.fhir.r5.utils.client.ResourceFormat;
|
|||
import org.hl7.fhir.utilities.ToolingClientLogger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class FhirRequestBuilder {
|
||||
|
@ -201,31 +202,17 @@ public class FhirRequestBuilder {
|
|||
return httpRequest.build();
|
||||
}
|
||||
|
||||
public <T extends Resource> ResourceRequest<T> execute() {
|
||||
public <T extends Resource> ResourceRequest<T> execute() throws IOException {
|
||||
formatHeaders(httpRequest, resourceFormat, null);
|
||||
|
||||
try {
|
||||
Response response = getHttpClient().newCall(httpRequest.build()).execute();
|
||||
T resource = unmarshalReference(response, resourceFormat);
|
||||
return new ResourceRequest<T>(resource, response.code(), getLocationHeader(response.headers()));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new FHIRException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Bundle executeAsBatch() {
|
||||
public Bundle executeAsBatch() throws IOException {
|
||||
formatHeaders(httpRequest, resourceFormat, null);
|
||||
|
||||
try {
|
||||
Response response = getHttpClient().newCall(httpRequest.build()).execute();
|
||||
return unmarshalFeed(response, resourceFormat);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.2.2-SNAPSHOT</version>
|
||||
<version>5.2.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
Loading…
Reference in New Issue