> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haau3.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a SMART Health Link

> Generate a SMART Health Link or QR code from a patient record, then test how a receiving system ingests it.

This guide walks through generating a SMART Health Link (SHL) from a patient record. It uses an
active **patient context** created during onboarding and lets you select which data to include
before generating the SHL or QR code. This is the flow to use when self-service testing the
full share experience against your own receiver.

<Note>
  This flow requires a signed-in haau3 account with at least one onboarded patient. If you
  haven't done that yet, complete [Account setup](/app/getting-started/account-setup) first.
</Note>

<Steps>
  <Step title="Confirm the active patient">
    haau3 supports managing care for multiple individuals. Before generating a share, confirm
    that the correct patient tab is selected. The active tab determines whose information is
    shared. If the wrong person is selected, switch tabs before continuing.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/patient-tabs.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=9097facbb8de2b1d622f57fa23bc9752" alt="Patient context tabs showing multiple patients" width="269" height="103" data-path="images/app/generate-shl/patient-tabs.png" />
    </Frame>
  </Step>

  <Step title="Open the Share activity">
    With the correct patient context confirmed, open the **Share** activity from the patient
    navigation on the top left. The Share activity is where SMART Health Links and QR codes are
    generated for the active patient, and where you select which patient data to include.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/share-activity-navigation.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=8d13d9ee3c21f2fd4754ce3bda0139e1" alt="Patient navigation with Share activity selected" width="308" height="322" data-path="images/app/generate-shl/share-activity-navigation.png" />
    </Frame>
  </Step>

  <Step title="Create the share">
    In the Share activity, review the settings and create the SMART Health Link for the active
    patient.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/authenticated-share-create.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=322d1a7f7a0d57edd0712345114856cd" alt="Share creation form" width="970" height="618" data-path="images/app/generate-shl/authenticated-share-create.png" />
    </Frame>

    1. Optionally update the auto-generated **share label** so the link is easier to identify later.
    2. Review the **health information to share**. These options are pre-selected by default; remove any categories you do not want to include.
    3. Choose a **link expiration** time. The default is 15 minutes.
    4. Click **Create share link** to generate the QR code and SMART Health Link.

    <Note>
      The default sharing mode generates a **U-flag** SMART Health Link (a direct file
      request). An advanced **manifest** mode is also available for testing. The two retrieval
      patterns are described in
      [Provider & EHR integration](/app/provider-integration/retrieve-smart-health-link).
    </Note>
  </Step>

  <Step title="Use or save the generated share">
    After you click **Create share link**, haau3 displays a modal with the generated QR code and
    a button to copy the secure link.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/authenticated-share-ready.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=cc5a977cfeca0c69b0669252870967a2" alt="Generated share link modal with QR code and copy secure link button" width="632" height="753" data-path="images/app/generate-shl/authenticated-share-ready.png" />
    </Frame>

    From here you can use the share in two ways:

    * **In person:** show the QR code to the receiving system to scan at the point of care. This
      is the primary workflow.
    * **Ahead-of-time check-in:** copy the SHLink URL and paste it into a provider's check-in
      experience before the appointment, where the receiver supports it. See the optional
      workflow below.

    <Note>
      Use or copy the share before closing the modal.
    </Note>
  </Step>

  <Step title="Test with a receiver or third-party tool">
    Validate the generated share in one of three ways:

    * Use your own EHR, intake, or check-in receiver workflow.
    * Use Flexpa's SMART Health Links Test Harness.
    * Use the CMS Kill the Clipboard developer scanner.

    <CardGroup cols={2}>
      <Card title="SMART Health Links Test Harness" icon="vial" href="https://pshd-shl.exe.xyz/">
        Generate and scan SMART Health Links for testing (sender + receiver).
      </Card>

      <Card title="Kill the Clipboard Scanner" icon="qrcode" href="https://killtheclipboard.fly.dev/">
        Scan a SMART Health Link as a simulated healthcare organization.
      </Card>
    </CardGroup>
  </Step>

  <Step title="Review active share links and access history">
    After generating a share, haau3 keeps a list of active share links for the current patient
    context, so you can review links that are still available and inspect their activity.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/authenticated-share-links-list.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=509493c66548b7cd886f12fcdb5255ab" alt="Active share links list" width="510" height="379" data-path="images/app/generate-shl/authenticated-share-links-list.png" />
    </Frame>

    Select the info button for a share link to view additional details about that share.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/authenticated-share-link-details.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=96d4729f54f9e723dcb474c8bb03ee73" alt="Share link details including metadata and access history" width="518" height="689" data-path="images/app/generate-shl/authenticated-share-link-details.png" />
    </Frame>
  </Step>

  <Step title="Review expired share links and audit history">
    haau3 also keeps a historical record of previously generated share links. Expired or
    inactive shares appear under the **Previous and expired share links** section for the
    current patient context.

    <Frame>
      <img src="https://mintcdn.com/haau3/upvBcXEW4AcogDKH/images/app/generate-shl/authenticated-expired-share-links.png?fit=max&auto=format&n=upvBcXEW4AcogDKH&q=85&s=76f94cd6513b5068dc341e153e9ce42d" alt="Expired and historical share links" width="1454" height="437" data-path="images/app/generate-shl/authenticated-expired-share-links.png" />
    </Frame>

    This section is an audit trail of prior shares. It shows when they were created, whether
    they were accessed, and how many views occurred before expiration. Even after a link
    expires, its metadata stays visible so you can review previous sharing activity for the
    patient:

    * Expired share status
    * View counts
    * Access metadata
    * Historical share labels and dates
  </Step>
</Steps>

## Ahead-of-time check-in (optional)

The KTC specification defines an optional
[ahead-of-time check-in workflow](https://ktc-spec.github.io/#workflow). A receiver may accept
the same SHLink a patient would otherwise present as a QR code in person. The patient generates
the share here, copies the SHLink URL, and pastes it into the provider's check-in experience
before the visit.

Receivers that support this resolve and process the submitted SHLink immediately, using the same
SHLink constraints, retrieval protocol, decryption, validation, persistence, provenance, and
security requirements as the in-person flow. Because a link may expire, be single-use, or
otherwise become unavailable, receivers should not rely on it remaining resolvable after
submission.

This workflow is optional and does not change the primary in-person QR workflow. It does not
define how the provider's check-in experience passes request context to the app; the patient
independently chooses what to share when creating the SHLink.

## Related

<CardGroup cols={2}>
  <Card title="Account setup" icon="user-plus" href="/app/getting-started/account-setup">
    Create an account and onboard a patient (prerequisite for this flow).
  </Card>

  <Card title="Kill the Clipboard" icon="circle-info" href="/app/kill-the-clipboard/kill-the-clipboard">
    The use case and app/receiving-system responsibilities.
  </Card>
</CardGroup>
