HS.BulkFHIR.Fetch.Util.RestClient
class HS.BulkFHIR.Fetch.Util.RestClient extends HS.FHIRServer.RestClient.HTTP
Property Inventory
Method Inventory
- BaseURLGet()
- EnsureFetchToken()
- ExecuteRequest()
- Get()
- GetClientId()
- GetNewFetchTokenSessionId()
- GetScopesForToken()
- GetTokenForFetch()
- InvokeRequest()
- IsStatusCodeNon200()
- RefreshToken()
- Revoke()
- RevokeAccessToken()
- getInstance()
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, pPermitSystemScope As %Boolean = 0, pAdditionalAudienceUrl 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. @Input pPermitSystemScope whether to permit system scopes @Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
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. @Input pPermitSystemScope whether to permit system scopes @Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
method ExecuteRequest(pPath As %String) as HS.FHIRServer.API.Data.RestClient.Response
method Get(path 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"
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.
Return a new unique SessionId to use for OAuth token request, retrieve and revoke.
classmethod GetScopesForToken(pFetchTokenInfo As %DynamicObject, pPermitSystemScope As %Boolean = 0) 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.
@Input pPermitSystemScope if falsey (default) all system scopes will be converted to user scopes
classmethod GetTokenForFetch(pOAuthClientName As %String, pTokenSessionId As %String, pFetchTokenInfo As %DynamicObject, pGrantType As %String, pEndpointURL As %String, pHTTPCredentialsConfig As %String, pPermitSystemScope As %Boolean = 0, pAdditionalAudienceUrl 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. @Input pPermitSystemScope Whether to permit system scopes @Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
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. @Input pPermitSystemScope Whether to permit system scopes @Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
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.
@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.
classmethod IsStatusCodeNon200(pStatusCode As %String)
method RefreshToken()
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.
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 getInstance(pServiceEntryName As %String, pMaxRequestsPerSecond As %Integer, pTokenObj As HS.BulkFHIR.Fetch.Util.AccessToken = "", pSessionId As %String = "", ByRef pHeaders, pAdditionalAudienceUrl As %String = "") 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.
@Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
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.
@Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
Inherited Members
Inherited Properties
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()
- Batch()
- ClearOtherRequestHeaders()
- ConditionalCreate()
- ConditionalDelete()
- ConditionalPatch()
- ConditionalRead()
- ConditionalUpdate()
- Create()
- CreateInstance()
- Delete()
- GetOtherRequestHeader()
- History()
- MakeClientResponseFromResponse()
- Metadata()
- OAuthClientNameGet()
- OAuthSendTypeGet()
- OAuthTokenGet()
- Operation()
- Patch()
- PreferGet()
- Read()
- RequestFormatGet()
- ResponseFormatGet()
- Search()
- ServiceNameGet()
- SessionIdGet()
- SetOtherRequestHeaders()
- SetRequestFormat()
- SetResponseFormat()
- Update()
- VRead()