@@ -340,7 +340,7 @@ protected <S> FhirResponse<S> runWithInterceptors(QueryingCallback<S> callback,
340340 } finally {
341341 client .notInUse ();
342342 }
343- return new FhirResponse <>(result , tracker .getResponseStatusCode (), tracker .getResponseStatusInfo ());
343+ return new FhirResponse <>(result , tracker .getResponseStatusCode (), tracker .getResponseStatusInfo (), tracker . getResponseBody () );
344344 }
345345
346346 public boolean hasCacheHeaderInterceptor (List <IClientInterceptor > interceptors ) {
@@ -394,7 +394,7 @@ public U execute(FhirClientWrapper client) {
394394 }
395395 }, client );
396396 if (resourceBundle .getResult () == null ) {
397- return new FhirResponse <>(null , resourceBundle .getResponseStatusCode (), resourceBundle .getResponseStatusInfo ());
397+ return new FhirResponse <>(null , resourceBundle .getResponseStatusCode (), resourceBundle .getResponseStatusInfo (), resourceBundle . getResponseBody () );
398398 }
399399 return resourceBundle ;
400400 }
@@ -482,18 +482,20 @@ private FhirResponse<IBaseResource> getResourceList(String resourceType, String
482482 if (usePath ) {
483483 FhirResponse <IBaseResource > resp = fetchServer (resourceType , resourceQuery );
484484 List <IBaseResource > result = resp == null || resp .getResult () == null ? null : Arrays .asList (resp .getResult ());
485- resourceList = new FhirResponse <List <IBaseResource >>(result , resp .getResponseStatusCode (), resp .getResponseStatusInfo ());
485+ resourceList = new FhirResponse <List <IBaseResource >>(result , resp .getResponseStatusCode (), resp .getResponseStatusInfo (), resp . getResponseBody () );
486486 } else {
487487 resourceList = queryServer (resourceQuery , qb );
488488 }
489489 }
490490 if (resourceList != null ) {
491491 if (resourceList .getResult () != null && resourceList .getResult ().size ()==1 ) {
492492 return new FhirResponse <>(resourceList .getResult ().get (0 ),
493- resourceList .getResponseStatusCode (), resourceList .getResponseStatusInfo ());
493+ resourceList .getResponseStatusCode (), resourceList .getResponseStatusInfo (),
494+ resourceList .getResponseBody ());
494495 } else {
495496 return new FhirResponse <>(null , resourceList .getResponseStatusCode (),
496- resourceList .getResponseStatusInfo ());
497+ resourceList .getResponseStatusInfo (),
498+ resourceList .getResponseBody ());
497499 }
498500 } else {
499501 return new FhirResponse <>(null , HttpStatus .SC_INTERNAL_SERVER_ERROR , "Unable to get resources" );
@@ -632,7 +634,7 @@ protected FhirResponse<IBaseBundle> queryPageByLink(String url, boolean useCache
632634 return null ;
633635 }
634636 FhirResponse <IBaseResource > res = fetchServer ("Bundle" , url );
635- return new FhirResponse <>((IBaseBundle ) res .getResult (), res .getResponseStatusCode (), res .getResponseStatusInfo ());
637+ return new FhirResponse <>((IBaseBundle ) res .getResult (), res .getResponseStatusCode (), res .getResponseStatusInfo (), res . getResponseBody () );
636638 } catch (Exception e ) {
637639 log .error ( ERROR_MSG + e .getMessage () + ". [" + e .getClass ().getName () + "]" );
638640 } finally {
0 commit comments