Skip to content

This page shows a practical way to use Google’s Open Health Stack (OHS) example apps to connect to an existing SMART‑on‑FHIR server. It uses the OHS FHIR App Examples demo/ app together with the FHIR Info Gateway as a reverse proxy in front of your FHIR base URL.
References are included inline for each step.

Why this example?

Architecture at a Glance

Android FHIR SDK (demo app)
|
v
FHIR Info Gateway  --->  Existing SMART-on-FHIR Authorization Server
|
v
Your FHIR Server (SMART-enabled)

Prerequisites

Step‑by‑Step

1) Clone and build the OHS demo app

git clone https://github.com/google/fhir-app-examples.git
cd fhir-app-examples/demo
# Open in Android Studio; build & run on an emulator/device

2) Deploy/configure FHIR Info Gateway

You can deploy the Gateway alongside your server and set it to forward to your SMART FHIR base URL.

Minimal conceptual config (pseudo‑YAML):

gateway:
  target_fhir_base: "https://your-smart-fhir.example.com/fhir"   # your existing FHIR base (iss)
  auth:
    # integrate with your SMART authorization server
    smart:
      discovery: "https://your-smart-fhir.example.com/.well-known/smart-configuration"
      required_scopes:
        - "openid"
        - "fhirUser"
        - "launch"
        - "patient/*.read"
    # optional: add policy to restrict compartments or worker access
  cors:
    allowed_origins:
      - "https://your-android-app-origin-or-debug"
  • As a proxy, the Gateway can be placed in front of any app and supports SMART apps; use it to enforce organizational policies on access to FHIR resources.
    Source: OHS use‑cases (Gateway + SMART).
    developers.google.com/open-health-stack/use-cases

3) Point the demo app at the Gateway

In the demo app configuration (e.g., buildConfig/settings or an environment file used by the app), set:

const val FHIR_BASE_URL = "https://your-gateway.example.com/fhir"
  • The demo’s synchronization and reads will go through the Gateway to your SMART FHIR server.
    Source: fhir-app-examples demo description.
    github.com/google/fhir-app-examples

4) Ensure SMART discovery & flows work

5) Register your client with the authorization server


Testing Tips


Notes & Considerations

  • The Android FHIR Engine Demo App (separate from fhir-app-examples) defaults to a public HAPI server for sync; it’s useful for offline/sync patterns, but it is not a SMART launch sample by itself—prefer the demo app + Gateway for SMART scenarios.
    Source: OHS examples page.
    developers.google.com/open-health-stack/resources/examples

  • If you need a web client reference (instead of Android), see a modern React EHR‑launch sample that implements PKCE and the SMART EHR launch flow.
    Source: Provider EHR Launch sample (React).
    github.com/cfu288/smart-provider-ehr-launch-app


Reference Links (curated)


What to share for a tailored config

If you want me to produce exact config snippets:

  • Your FHIR base (iss) and whether you want EHR Launch or Standalone Launch.
  • The scopes you plan to grant (e.g., patient/*.read, user/*.read, launch, openid, fhirUser).
  • Whether your client is public (PKCE) or confidential.

I’ll then provide a ready‑to‑paste gateway config and the app‑side settings (audience aud, redirect_uri, and launch handling) based on your server.