Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What is a launch context?

...

...

Code Block
titleLaunch Context
{"client_id":"bilirubin_chart","parameters":{"patient":"BILIBABY","need_patient_banner":false}}
  • Note, at this time, client_id is not required.  Only 'parameters' is required, and at minimum, an empty object.

  • Code Block
    titleMinimum Launch Context
    {"parameters":{}}


Step 2: Registering the launch context

The launch context is registered with the HSPC Reference API server by sending an HTTP POST to the /_services/smart/Launch endpoint.  The request must contain an access token for the HSPC Reference API server.  The launching system should obtain this token as part of the preconditions, for example, through a SMART on FHIR launch flow.

Code Block
titleRegistering launch context
HTTP POST
Authorization:Bearer ...
Payload: {"client_id":"bilirubin_chart","parameters":{"patient":"BILIBABY","need_patient_banner":false}}

Step 3: Launch context is synchronized

The launch context is enriched with a launch_id that is the key to the launch context given to the downstream app.  The launch context must be synchronized between the HSPC Reference API server and the HSPC Reference Auth server.  This synchronization allows both servers to check the launch context for various APIs.  For example, the HSPC Reference Auth server can determine if a patient context has been established when issueing a patient-scope access token, and the HSPC Reference API server can remove results from a query that are not for the patient in context.

Step 4: Launch context is returned

Code Block
titleHTTP Response Body
{"launch_id":"GNpcsR","created_at":"Mon Nov 06 23:31:53 UTC 2017","created_by":"...","parameters":{"patient":"BILIBABY","need_patient_banner":false},"username":"none"}

...