< Back

Discharge Summaries

Discharge summaries are among the most frequently retrieved document types in clinical interoperability workflows, particularly for transitions of care and value-based-care (VBC) programs. Health Gorilla does not provide a dedicated discharge-summary API endpoint. These documents are retrieved like any other clinical document through the FHIR DocumentReference resource.

Discharge summaries can be queried, downloaded, or monitored using the same FHIR retrieval and event-driven methods that apply to other document types, such as consult notes, operative reports, and imaging results.

Retrieval Formats and Methods

Discharge summaries are available in structured and unstructured formats. Your organization can use the following methods to retrieve and monitor them.

  • FHIR subscriptions (recommended): Use event-driven notifications to receive new discharge summaries as they become available.
  • Polling: Query for new or updated discharge summaries on a defined schedule if event-driven notifications aren’t feasible.
  • Structured summaries: Retrieve discharge summaries through the FHIR DocumentReference resource, filtered using LOINC 18842-5 or SNOMED 371531000000108.
  • Unstructured summaries: Retrieve discharge summaries through DocumentReference.content.attachment and downloaded as files using the FHIR Binary resource.
  • Related encounters: Retrieve associated hospitalization details through FHIR Encounter resources linked to each discharge summary.

Querying Discharge Summaries

Discharge summaries are represented as FHIR DocumentReference resources categorized by standard clinical codes. The same approach applies to any other document type by substituting the appropriate LOINC or SNOMED value, such as 11506-3 for consult notes.

Filtering by Document Type

  • LOINC code: 18842-5 — Discharge Summary
  • SNOMED code: 371531000000108 — Discharge Summary Report

Filtering by document type is preferred for structured documents and removes the need for post-retrieval filtering.

Example: Query by LOINC Code

GET /fhir/R4/DocumentReference?patient=12345&type=18842-5
Authorization: Bearer {access_token}
Accept: application/fhir+json

Example: Query by SNOMED Code

GET /fhir/R4/DocumentReference?patient=12345&type=371531000000108
Authorization: Bearer {access_token}
Accept: application/fhir+json

FHIR Subscriptions

FHIR subscriptions allow your system to receive event-driven notifications when new DocumentReference resources matching specific filters become available. Support for this feature depends on configuration and should be verified in your environment.

Example: Create FHIR Subscription

POST /fhir/R4/Subscription
Authorization: Bearer {access_token}
Content-Type: application/json

{
  "resourceType": "Subscription",
  "status": "active",
  "criteria": "DocumentReference?type=18842-5",
  "channel": {
    "type": "rest-hook",
    "endpoint": "https://yourapp.com/webhook",
    "payload": "application/fhir+json"
  }
}

Example: Subscription Notification

{
  "resourceType": "Bundle",
  "entry": [
    {
      "resource": {
        "resourceType": "DocumentReference",
        "id": "67890",
        "type": {
          "coding": [{"system": "http://loinc.org", "code": "18842-5"}]
        }
      }
    }
  ]
}

Example: Retrieve Document After Notification

GET /fhir/R4/DocumentReference/67890
Authorization: Bearer {access_token}
Accept: application/fhir+json

Polling

If FHIR subscriptions can’t be used, your system can query for new or updated discharge summaries on a defined schedule.

Typical polling intervals:

  • Every 24 hours to track hospitalized patients
  • Every 6 hours for near-real-time monitoring

Example: Poll for New Discharge Summarie

GET /fhir/R4/DocumentReference?patient=12345&type=18842-5
Authorization: Bearer {access_token}
Accept: application/fhir+json

Combined Implementation

The following example demonstrates a basic implementation for retrieving discharge summaries using either FHIR subscriptions or scheduled polling.

import requests

def fetch_discharge_summaries():
  url = "https://sandbox.healthgorilla.com/fhir/R4/DocumentReference?patient=12345&type=18842-5"
  headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN", "Accept": "application/fhir+json"}
  response = requests.get(url, headers=headers)
  return response.json()

def process_subscription(data):
  for entry in data["entry"]:
    doc_id = entry["resource"]["id"]
    print(f"New discharge summary available: {doc_id}")

This implementation supports event-driven notifications through FHIR subscriptions, with polling as a fallback method.

Structured Summaries

When you query by LOINC or SNOMED code, the response returns a FHIR Bundle containing one or more DocumentReference resources. Each entry represents a discharge summary document linked to a specific patient and encounter. The resource includes metadata such as document type, creation date, and attachment URL for downloading the file through the FHIR Binary resource.

Example: FHIR Response

{
  "resourceType": "Bundle",
  "type": "searchset",
  "entry": [
    {
      "resource": {
        "resourceType": "DocumentReference",
        "id": "67890",
        "status": "current",
        "type": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "18842-5",
              "display": "Discharge Summary"
            }
          ]
        },
        "subject": { "reference": "Patient/12345" },
        "date": "2024-02-10T10:30:00Z",
        "content": [
          {
            "attachment": {
              "contentType": "application/pdf",
              "url": "https://sandbox.healthgorilla.com/fhir/R4/Binary/abcdef123456",
              "title": "Discharge Summary - 2024-02-10"
            }
          }
        ]
      }
    }
  ]
}

Each DocumentReference entry contains the metadata needed to identify and retrieve the discharge summary. The attachment.url value points to the downloadable file, which can be accessed through the FHIR Binary resource.

Key Details

  • DocumentReference.id: 67890
  • LOINC code: 18842-5 (Discharge Summary)
  • Creation date: 2024-02-10T10:30:00Z
  • Attachment URL: Downloadable PDF file

Unstructured Summaries

Some clinical documents, including discharge summaries, may exist only in unstructured formats such as PDF, TXT, or PNG. The same retrieval process applies to all unstructured document types.

  1. Query DocumentReference to obtain content.attachment.url.
  2. Use the FHIR Binary resource to download the file.

Example: Retrieve Unstructured Document

GET /fhir/R4/Binary/abcdef123456
Authorization: Bearer {access_token}
Accept: application/pdf

The response returns the raw file in its original format.

Each discharge summary is typically linked to a FHIR Encounter resource that provides hospitalization details. Retrieving related encounters establishes context such as admission and discharge dates or disposition.

Example: Query Encounter Data

GET /fhir/R4/Encounter?patient=12345&status=finished
Authorization: Bearer {access_token}
Accept: application/fhir+json

Example: Encounter Response

{
  "resourceType": "Encounter",
  "id": "enc-67890",
  "status": "finished",
  "class": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
        "code": "IMP",
        "display": "Inpatient"
      }
    ]
  },
  "subject": {
    "reference": "Patient/12345"
  },
  "period": {
    "start": "2024-02-05T12:00:00Z",
    "end": "2024-02-10T10:00:00Z"
  },
  "hospitalization": {
    "dischargeDisposition": {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/discharge-disposition",
          "code": "home",
          "display": "Discharged to home"
        }
      ]
    }
  }
}

Key Details

  • Hospitalization period: February 5 → February 10
  • Discharge disposition: Discharged to home

Summary

Discharge summaries are retrieved through the standard FHIR DocumentReference resource. They are emphasized because they represent a common query pattern used in post-discharge coordination, transitions-of-care workflows, and VBC reporting. The same retrieval, monitoring, and filtering methods apply to any coded clinical document type supported in the Health Gorilla network.