Question
· May 29

Obtaining a payload from a FHIR response of type HS.FHIRServer.Interop.Response

I created a FHIR Client to execute a GET response from an external FHIR server. I set everything up according to this post: https://community.intersystems.com/post/create-fhir-rest-client#comment-...

I was able to send a GET request and got a response of type HS.FHIRServer.Interop.Response.

But in the visual trace, I do not see the actual json response payload.  I opened the response object in terminal and saw it has a QuickStreamId, which I used with the HS.SDA3.QuickStream class to open the quickstream object. But how do I get the payload from this quickstream object? 

Product version: IRIS 2020.1
Discussion (2)2
Log in or sign up to continue

if (($P(tResponse.Response.Status," ",1)>199) && ($P(tResponse.Response.Status," ",1)<399))
{
Set tResponseQuickStream = ##class(HS.SDA3.QuickStream).%OpenId(tResponse.QuickStreamId)
Set tSC = $$$ERROR($$$GeneralError, tResponseQuickStream.Read())
Set BundleObject=##class(HS.FHIR.DTL.vR4.Model.Resource.Bundle).FromJSON(tResponseQuickStream,"vR4")
Quit BundleObject
}

You can use the line similar to below instead of Bundle if you are unsure of the payload as well

BundleObject=##class(%DynamicObject).%FromJSON(tResponseQuickStream)