Skip to main content

HS.BulkFHIR.Fetch.Util.RestClient

class HS.BulkFHIR.Fetch.Util.RestClient extends HS.FHIRServer.RestClient.HTTP

Property Inventory

Method Inventory

Parameters

parameter TokenRetryLimit = 2;
Maximum number of retries for obtaining an OAuth token during $export when obtain fails.

Properties

property BaseURL as %String [ Calculated ];
Property methods: BaseURLDisplayToLogical(), BaseURLIsValid(), BaseURLLogicalToDisplay(), BaseURLLogicalToOdbc(), BaseURLNormalize()

Methods

method BaseURLGet() as %String
classmethod EnsureFetchToken(pOAuthClientName As %String, ByRef pTokenSessionId As %String, pFetchTokenInfo As %DynamicObject, pGrantType As %String, pEndpointURL As %String, pHTTPCredentialsConfig As %String) as %Status
@API
Use an IRIS OAuth API call to verify that a token exists and is active for the specified OAuth client name and SessionId. If not found or not active, then obtain a new token.

@Input pOAuthClientName OAuth client name.
@Input pTokenSessionId OAuth token 'SessionId" value to use for storing and retrieving an access token. This is not the same item as the BFC sessionId.
@Input pFetchTokenInfo %DynamicObject of information about the access token on the request to the BFC.
@Input pGrantType OAuth token grant type to use when requesting the token.
@Input pEndpointURL Resource server endpoint URL to use in the aud claim.
@Input pHTTPCredentialsConfig Interoperability credentials config ID to use for password grant.
method ExecuteRequest(pPath As %String) as HS.FHIRServer.API.Data.RestClient.Response
@API
Sends an HTTP GET request to the endpoint configured for this REST client.
@Input path path to send an HTTP request to, eg. "Patient" or "metadata"
classmethod GetClientId(pClientName) as %String
Return the OAuth client id for a given OAuth client name.
classmethod GetNewFetchTokenSessionId() as %String
@API
Return a new unique SessionId to use for OAuth token request, retrieve and revoke.
classmethod GetScopesForToken(pFetchTokenInfo As %DynamicObject) as %String
Derive the OAuth scopes string to use for the access token for resource server interactions. The return value is a space-delimited string of scopes.
classmethod GetTokenForFetch(pOAuthClientName As %String, pTokenSessionId As %String, pFetchTokenInfo As %DynamicObject, pGrantType As %String, pEndpointURL As %String, pHTTPCredentialsConfig As %String)
@API
Obtain an access token for interactions with the resource server. If successful, the token is stored in a structure from which it can be retrieved, given the OAuth client name and a session id.

@Input pOAuthClientName OAuth client name.
@Input pTokenSessionId OAuth token 'SessionId" value to use for storing and retrieving an access token. This is not the same item as the BFC sessionId.
@Input pFetchTokenInfo %DynamicObject of information about the access token on the request to the BFC.
@Input pGrantType OAuth token grant type to use when requesting the token.
@Input pEndpointURL Resource server endpoint URL to use in the aud claim.
@Input pHTTPCredentialsConfig Interoperability credentials config ID to use for password grant.
method InvokeRequest(pRequest As %RegisteredObject, pRequestMethod As %String, pRequestPath As %String, pQueryString As %String) as %RegisteredObject
Override HS.FHIRServer.RestClient.HTTP to use the full path provided if pRequestPath is a full URL instead of using the service base URL InvokeRequest takes the Private %HttpRequest object - passed in as pRequest here - and invokes the request. The HTTP response is stored as the HttpResponse property of the HTTP request object. This method returns a reference to that property.
@Input pRequest %Net.HttpRequest object.
@Input pRequestMethod HTTP verb.
@Input pRequestPath Request path, as derived by the invoked interaction-specific method.
@Input pQueryString Query string, as derived by the invoked interaction-specific method.
method Revoke()
Revoke an access token that might be in use by this RestClient instance.
Input:
@Input pOAuthClientName OAuth client name.
@Input pTokenSessionId OAuth token 'SessionId" value to use for revoking the access token. This is not the same item as the BFC sessionId.
classmethod RevokeAccessToken(pOAuthClientName As %String, pTokenSessionId As %String)
classmethod getInstance(pServiceEntryName As %String, pMaxRequestsPerSecond As %Integer, pTokenObj As HS.BulkFHIR.Fetch.Util.AccessToken = "", pSessionId As %String = "", ByRef pHeaders) as HS.BulkFHIR.Fetch.Util.RestClient
@API
Returns a configured instance of this class, which can be used as a rest client for fetching content out of the configured FHIR endpoint.
@Input pServiceEntryName Entry in the Service Registry that points to a FHIR endpoint
@Input pMaxRequestsPerSecond Imposes rate limiting on requests using this client object
@Input pTokenObj Object that holds information about the new token to request.
@Input pSessionId BFC sessionId.
@Input pHeaders Custom HTTP headers to add to requests.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab