Add support for JSON in tx client batch handling

This commit is contained in:
Grahame Grieve 2023-04-29 08:41:05 +10:00
parent 718cd5e369
commit 34f149f0c8
3 changed files with 3 additions and 3 deletions

View File

@ -281,7 +281,7 @@ public class FhirRequestBuilder {
log(response.code(), response.headers(), body); log(response.code(), response.headers(), body);
String contentType = response.header("Content-Type"); String contentType = response.header("Content-Type");
if (body != null) { if (body != null) {
if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains("text/xml+fhir")) { if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains(ResourceFormat.RESOURCE_JSON.getHeader()) || contentType.contains("text/xml+fhir")) {
Resource rf = getParser(format).parse(body); Resource rf = getParser(format).parse(body);
if (rf instanceof Bundle) if (rf instanceof Bundle)
feed = (Bundle) rf; feed = (Bundle) rf;

View File

@ -276,7 +276,7 @@ public class FhirRequestBuilder {
byte[] body = response.body().bytes(); byte[] body = response.body().bytes();
String contentType = response.header("Content-Type"); String contentType = response.header("Content-Type");
if (body != null) { if (body != null) {
if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains("text/xml+fhir")) { if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains(ResourceFormat.RESOURCE_JSON.getHeader()) || contentType.contains("text/xml+fhir")) {
Resource rf = getParser(format).parse(body); Resource rf = getParser(format).parse(body);
if (rf instanceof Bundle) if (rf instanceof Bundle)
feed = (Bundle) rf; feed = (Bundle) rf;

View File

@ -270,7 +270,7 @@ public class FhirRequestBuilder {
byte[] body = response.body().bytes(); byte[] body = response.body().bytes();
String contentType = response.header("Content-Type"); String contentType = response.header("Content-Type");
if (body != null) { if (body != null) {
if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains("text/xml+fhir")) { if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains(ResourceFormat.RESOURCE_JSON.getHeader()) || contentType.contains("text/xml+fhir")) {
Resource rf = getParser(format).parse(body); Resource rf = getParser(format).parse(body);
if (rf instanceof Bundle) if (rf instanceof Bundle)
feed = (Bundle) rf; feed = (Bundle) rf;