SmartFhirClient class

Base Smart FHIR Client used for SMART on FHIR Launches

Inheritance
Implementers

Constructors

SmartFhirClient({required FhirUri fhirUri, required String? clientId, required FhirUri? redirectUri, String? customUriScheme, List<String>? scopes, FhirUri? authorizeUrl, FhirUri? tokenUrl, String? launch, String? secret, bool isDemo = false})
Constructor
SmartFhirClient.fromLaunchParameters(Uri base, Map<String, String> queryParameters, {FhirUri? fhirUri, String? clientId, FhirUri? redirectUri, String? customUriScheme, List<String>? scopes, String? authorizeUrl, String? tokenUrl, String? launch, String? secret, String redirectPath = '/redirect.html'})
Constructor to assist in building a client from Launch parameters that may be present in the launch URL
factory

Properties

authClient BaseAuthentication
The smart auth client, version is based on if this is a web or mobile app
getter/setter pair
authHeaders Map<String, String>?
authHeaders that can be stored while in use for a client not using an oauth2 flow but has security headers
getter/setter pairinherited
authorizeUrl ↔ FhirUri?
authorizeUrl - url used for authorization
getter/setter pair
client ↔ Client?
The actual oauth2 client that
getter/setter pair
clientId String?
clientId for the application
getter/setter pairinherited
customUriScheme String?
customUriScheme
getter/setter pair
displayName String?
DisplayName for the fhirUser
getter/setter pair
email String?
Email for fhirUser
getter/setter pair
encounterId String?
String value with an encounter id, indicating that the app was launched in the context of FHIR Encounter 123.
getter/setter pair
fhirContext List<String>?
Array of relative resource References to any resource type other than “Patient” or “Encounter”. It is not prohibited to have more than one Reference to a given type of resource.
getter/setter pair
fhirUri ↔ FhirUri
Base fhirUri
getter/setter pairinherited
fhirUser String?
Local reference for the fhirUser
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
intent String?
String value describing the intent of the application launch (see notes below)
getter/setter pair
isDemo bool
simple boolean to tell us if this is a demo or not
getter/setter pair
launch String?
String for launch context
getter/setter pairinherited
needPatientBanner bool?
Boolean value indicating whether the app was launched in a UX context where a patient banner is required (when true) or not required (when false). An app receiving a value of false should not take up screen real estate displaying a patient banner.
getter/setter pair
patientId String?
https://build.fhir.org/ig/HL7/smart-app-launch/scopes-and-launch-context.html#launch-context-arrives-with-your-access_token Once an app is authorized, the token response will include any context data the app requested and any (potentially) unsolicited context data the EHR may decide to communicate. For example, EHRs may use launch context to communicate UX and UI expectations to the app (see need_patient_banner below).
getter/setter pair
practitionerId String?
String value with an encounter id, indicating that the app was launched in the context of FHIR Encounter 123.
getter/setter pair
profile String?
Profile (which is generally the same as the fhirUser reference)
getter/setter pair
redirectUri ↔ FhirUri?
redirectUri is required for most oAuth2 flows
getter/setter pairinherited
responseUrl Uri?
responseUrl
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes List<String>?
Scopes which aren't required for this base class but are used for any that involve authentication & permissions
getter/setter pairinherited
secret String?
Secret string, which isn't a good idea, because most of Flutter is web or mobile, so you really shouldn't be using a secret
getter/setter pairinherited
smartStyleUrl String?
String URL where the EHR’s style parameters can be retrieved (for apps that support styling)
getter/setter pair
tenant String?
String conveying an opaque identifier for the healthcare organization that is launching the app. This parameter is intended primarily to support EHR Launch scenarios.
getter/setter pair
tokenUrl ↔ FhirUri?
tokenUrl = url used for obtaining tokens
getter/setter pair

Methods

close() → void
Not so important for the generic client
inherited
delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) Future<Response>
Sends an HTTP DELETE request with the given headers to the given URL. It checks first to see if there is a client, if there is it uses the client assuming it has authorization information, otherwise it calls the newHeaders method to obtain headers and makes the request
override
get(Uri url, {Map<String, String>? headers}) Future<Response>
Sends an HTTP GET request with the given headers to the given URL. It checks first to see if there is a client, if there is it uses the client assuming it has authorization information, otherwise it calls the newHeaders method to obtain headers and makes the request
override
Sends an HTTP HEAD request with the given headers to the given URL.
inherited
isLoggedIn() Future<bool>
Checks if client isLoggedIn (same as isSignedIn), maintained because some clients use one and some prefer the other
override
isSignedIn() Future<bool>
Checks if client isSignedIn (same as isLoggedIn), maintained because some clients use one and some prefer the other
override
login() Future<void>
Method to login the client, it does attempt to parse out any of the above values that may be passed from the server
override
logout() Future<void>
Logs the client out and deletes any security information that shouldn't be stored
override
newHeaders(Map<String, String>? headers) Future<Map<String, String>>
Adds authorization headers to the client if needed. All methods check if there is a Client as part of the class or if it's null. If it's null it calls this method to check for headers, otherwise it assumes that any authorization information is within the client object
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) Future<Response>
Sends an HTTP PATCH request with the given headers to the given URL. It checks first to see if there is a client, if there is it uses the client assuming it has authorization information, otherwise it calls the newHeaders method to obtain headers and makes the request
override
post(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) Future<Response>
Sends an HTTP POST request with the given headers to the given URL. It checks first to see if there is a client, if there is it uses the client assuming it has authorization information, otherwise it calls the newHeaders method to obtain headers and makes the request
override
put(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) Future<Response>
Sends an HTTP PUT request with the given headers to the given URL. It checks first to see if there is a client, if there is it uses the client assuming it has authorization information, otherwise it calls the newHeaders method to obtain headers and makes the request
override
read(Uri url, {Map<String, String>? headers}) Future<String>
Sends an HTTP GET request with the given headers to the given URL and returns a Future that completes to the body of the response as a String.
inherited
readBytes(Uri url, {Map<String, String>? headers}) Future<Uint8List>
Sends an HTTP GET request with the given headers to the given URL and returns a Future that completes to the body of the response as a list of bytes.
inherited
send(BaseRequest request) Future<StreamedResponse>
Sends an HTTP request and asynchronously returns the response.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited