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
{
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
Thank you!!
This is what I needed (minus this line: Set tSC = $$$ERROR($$$GeneralError, tResponseQuickStream.Read()))