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.

  • Constructor Details

    • LaunchContext

      public LaunchContext(String patientId, String encounterId, String idToken, String scope, Long expiresInSeconds, List<LaunchContext.FhirContextEntry> fhirContext)
      Creates an instance of a LaunchContext record class.
      Parameters:
      patientId - the value for the patientId record component
      encounterId - the value for the encounterId record component
      idToken - the value for the idToken record component
      scope - the value for the scope record component
      expiresInSeconds - the value for the expiresInSeconds record component
      fhirContext - the value for the fhirContext record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • patientId

      public String patientId()
      Returns the value of the patientId record component.
      Returns:
      the value of the patientId record component
    • encounterId

      public String encounterId()
      Returns the value of the encounterId record component.
      Returns:
      the value of the encounterId record component
    • idToken

      public String idToken()
      Returns the value of the idToken record component.
      Returns:
      the value of the idToken record component
    • scope

      public String scope()
      Returns the value of the scope record component.
      Returns:
      the value of the scope record component
    • expiresInSeconds

      public Long expiresInSeconds()
      Returns the value of the expiresInSeconds record component.
      Returns:
      the value of the expiresInSeconds record component
    • fhirContext

      public List<LaunchContext.FhirContextEntry> fhirContext()
      Returns the value of the fhirContext record component.
      Returns:
      the value of the fhirContext record component