Package org.fhirfrog.frog.smart
Record Class LaunchContext
java.lang.Object
java.lang.Record
org.fhirfrog.frog.smart.LaunchContext
public record LaunchContext(String patientId, String encounterId, String idToken, String scope, Long expiresInSeconds, List<LaunchContext.FhirContextEntry> fhirContext)
extends Record
The SMART launch context decoded from a token-endpoint JSON response: the
patient/encounter identifiers, id_token, granted scope,
token lifetime, and any fhirContext entries (SMART App Launch's mechanism for the
EHR to hand the launched app a set of relevant resources up front - e.g. launching
straight into a pre-selected Questionnaire).
Unlike FormLoginPkceProvider, which scrapes a single flat access_token
field with a regex, fhirContext is a JSON array of objects - not reasonably
scrapeable with one regex - so this class is Jackson-backed. See
fhir-frog-smart/pom.xml for why that costs nothing new to resolve:
jackson-databind is already pinned in the root pom.xml's dependency management
and already transitively on the classpath via hapi-fhir-base.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne entry of a SMARTfhirContextlaunch-context array - see the SMART App Launch spec's "fhirContext" launch parameter. -
Constructor Summary
ConstructorsConstructorDescriptionLaunchContext(String patientId, String encounterId, String idToken, String scope, Long expiresInSeconds, List<LaunchContext.FhirContextEntry> fhirContext) Creates an instance of aLaunchContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theencounterIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresInSecondsrecord component.Returns the value of thefhirContextrecord component.final inthashCode()Returns a hash code value for this object.idToken()Returns the value of theidTokenrecord component.Returns the value of thepatientIdrecord component.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LaunchContext
public LaunchContext(String patientId, String encounterId, String idToken, String scope, Long expiresInSeconds, List<LaunchContext.FhirContextEntry> fhirContext) Creates an instance of aLaunchContextrecord class.- Parameters:
patientId- the value for thepatientIdrecord componentencounterId- the value for theencounterIdrecord componentidToken- the value for theidTokenrecord componentscope- the value for thescoperecord componentexpiresInSeconds- the value for theexpiresInSecondsrecord componentfhirContext- the value for thefhirContextrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
patientId
Returns the value of thepatientIdrecord component.- Returns:
- the value of the
patientIdrecord component
-
encounterId
Returns the value of theencounterIdrecord component.- Returns:
- the value of the
encounterIdrecord component
-
idToken
Returns the value of theidTokenrecord component.- Returns:
- the value of the
idTokenrecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
expiresInSeconds
Returns the value of theexpiresInSecondsrecord component.- Returns:
- the value of the
expiresInSecondsrecord component
-
fhirContext
Returns the value of thefhirContextrecord component.- Returns:
- the value of the
fhirContextrecord component
-