Skip to main content

HS.FHIRServer.RestClient.Interop

class HS.FHIRServer.RestClient.Interop extends HS.FHIRServer.RestClient.Base

This class provides API methods for creating and submitting FHIR REST API calls to an Interoperability business operation.

HS.FHIRServer.RestClient.Base holds the primary implementation of all of the interaction-specific instance methods and properties.

Behavior specific to this class:
- The %ServiceName property refers to the name of a Service Registry HTTP entry.
- The %TargetConfigName property is specific to this class.
- The %HostObject property is specific to this class.
- All input content body (payloads) must be stream or string, already formatted in the desired format.
- If %HostObject has a value, then that host is used for sending the request message to %TargetConfigName. Otherwise, requests are invoked via HS.HC.Util.BusinessService, which sends it to %TargetConfigName.

Production setup:
- Add an instance of HS.FHIRServer.Interop.HTTPOperation (or a class extended from it) to your local production. Specify that production item name in the pTargetConfigName parameter when you call CreateInstance() for this class.
- If you intend to invoke the client object without having provided a business host object to it (pHostObj parameter on CreateInstance()), add business service HS.HC.Util.BusinessService to your local production.

Example usage from standalone IRIS application:
Set clientObj = ##class(HS.FHIRServer.RestClient.Interop).CreateInstance("MyFHIR.HTTP.Service", , , , , , , "HS.FHIRServer.Interop.HTTPOperation")
Do clientObj.SetResponseFormat("JSON")
Set clientResponseObj = clientObj.Read("GET", "Patient", "123")

Example usage from within business host:
Set clientObj = ##class(HS.FHIRServer.RestClient.Interop).CreateInstance("MyFHIR.HTTP.Service", , , , , , , "HS.FHIRServer.Interop.HTTPOperation", $this)
Do clientObj.SetResponseFormat("JSON")
Set clientResponseObj = clientObj.Read("GET", "Patient", "123")

Method Inventory

Methods

classmethod CreateInstance(pServiceName As %String, pPrefer As %String = "", pSessionId As %String = "", pOAuthClientName As %String = "", pOAuthToken="", pOAuthSendType As %String = "header", pTargetConfigName As %String, pHostObj As Ens.Host = "") as HS.FHIRServer.RestClient.Interop
@API
Create and return an object instance of this class. All of the input values constitute inputs/parameters that will be constant for all interactions invoked by the returned object instance.
@Input pServiceName (required) Name of a FHIRServer Service, which is the URL end point of the Service.
@Input pPrefer Prefer header value.
@Input pSessionId Typically a CSP session id. Used in conjunction with pOAuthClientName for retrieving an established OAuth 2.0 access token to add to a request.
@Input pOAuthClientName Used in conjunction with SessionId for retrieving an OAuth 2.0 access token to add to a request.
@Input pOAuthToken OAuth 2.0 access token, provided directly as opposed to retrieving via SessionId+OAuthClientName.
@Input pTargetConfigName (required) Name of business operation to handle the outgoing request. @Input pHostObj Instance of business host object to use for sending request to pTargetConfigName.
method HostObjectGet() as Ens.Host
method InvokeRequest(pRequest As %RegisteredObject, pRequestMethod As %String, pRequestPath As %String, pQueryString As %String) as %RegisteredObject
@API.Overridable
InvokeRequest takes the HS.FHIRServer.Interop.Request object - passed in as pRequest here - sends the request to %TargetConfigName, either via HS.HC.Util.BusinessService or via ..%HostObject. It then returns the HS.FHIRServer.Interop.Response object that was returned.
@Input pRequest HS.FHIRServer.Interop.Request.
@Input pRequestMethod (not used)
@Input pRequestPath (not used)
@Input pQueryString (not used)
method MakeClientResponseFromResponse(pResponse As %RegisteredObject) as HS.FHIRServer.API.Data.RestClient.Response
@API.Overridable
MakeClientResponseFromResponse takes the HS.FHIRServer.Interop.Response response object, creates a HS.FHIRServer.API.Data.RestClient.Response object from it, and returns that object.
The content payload of the client response, when present, will always be a stream in the Payload property.
@Input pResponse HS.FHIRServer.Interop.Response.
method MakeRequest(pRequestMethod As %String, pPayload, pRequestPath As %String, pQueryString As %String, ByRef pHeaders) as %RegisteredObject
@API.Overridable
MakeRequest creates a HS.FHIRServer.Interop.Request object from the user input that was derived from the interaction-specific method that received it, and returns that object.
@Input pRequestMethod HTTP verb.
@Input pPayload Input payload content, can be stream or string, already formatted in the desired format.
@Input pRequestPath Request path, as derived by the invoked interaction-specific method.
@Input pQueryString Query string, as derived by the invoked interaction-specific method.
@Input pHeaders Headers multidimensional, as derived from specific input parameters of the invoked interaction-specific method.
method OAuthSendTypeGet() as %String
method QuickStreamIdGet() as %String
method SetRequestFormat(pFHIRFormatCode As %String = "")
@API
Set the RequestFormatCode value for the request.
@Input pFHIRFormatCode Code indicating the requested mime type. Valid values are blank, JSON, XML, Form, JPatch, and XPatch.
method SetResponseFormat(pFHIRFormatCode As %String = "")
@API
Set the ResponseFormatCode value for the request.
@Input pFHIRFormatCode Code indicating the requested mime type. Valid values are blank, JSON, and XML.
method TargetConfigNameGet() as Ens.DataType.ConfigName

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab