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

# Report

> Returns the lab result as a FHIR R4 `DiagnosticReport`, enriched with the portal report status and all issues.

**Identifier — barcode or sampleId, auto-detected.** `{id}` accepts the accession/barcode returned by `POST /orders` or a numeric `sampleId`; the API resolves it as a barcode first and falls back to sampleId only for an all-digits value that is definitively not a barcode. Query aliases also work: `GET /report/fhir?barcode={barcode}` or `?sampleId={sampleId}` (if both are sent, `sampleId` wins; neither → `400`).

**Four outcomes — always `200` unless access is denied:**
- **Report ready and unblocked** (including `preliminary`) → full result content: observations, PDF `presentedForm` link, plus status + issues.
- **Nothing finished yet** → a status shell: report status + per-report counts + issues, including a synthetic **`No Finished Test`** report-blocking issue. No result content.
- **Report-blocking issue** (e.g. a billing issue) → status, counts and issue extensions returned; Observations, `result` references and PDF `presentedForm` links are withheld until the issue resolves. Status can remain `preliminary` or `final`; `conclusion` says why. Read the blocking flags rather than inferring content access from status alone.
- **Cancelled order** → `status: cancelled`, cancellation details and `conclusion`, with no result content or PDF. This top-level status is terminal; stop waiting for or polling results regardless of per-report progress details. You do not need to query Get orders to confirm cancellation.

There is no bare "not-ready" `404` to poll — read `status` (and the `urn:vibrant:*` extensions) instead. Sample-level status, per-report progress counts (e.g. 2/3), and both issue lists ride in FHIR extensions; see the schema.

Returns the lab result as a FHIR R4 `DiagnosticReport`, enriched with the portal **report status**
and all **issues**. The identifier is the **accession/barcode** from
[Place an order](https://developers.vibrant-wellness.com/api-reference/orders/place.md) **or a numeric `sampleId`** — auto-detected. Query
aliases work too: `GET /report/fhir?barcode={barcode}` or `?sampleId={sampleId}`.

Unless you're denied access, this always returns `200`. Four outcomes:

* **Report ready** — including `preliminary` — full result content (observations, PDF link) plus
  status and issues.
* **Nothing finished yet** — a status shell with per-report progress counts and a synthetic
  **`No Finished Test`** blocking issue; no result content.
* **Report-blocking issue** (e.g. billing) — status + issues returned, result content **withheld**
  until resolved; `conclusion` says why.
* **Cancelled order** — `status: cancelled`, a cancellation explanation in `conclusion`, and no
  result content or PDF. Stop polling this order.

The `urn:vibrant:order-canceled` extension carries `order_canceled` and `order_cancel_time`.
Cancellation is terminal. Status changes can propagate asynchronously after a cancellation request.

So there's **no bare "not-ready" 404 to poll** — read `status` and the `urn:vibrant:*` extensions
instead. See [Reports](https://developers.vibrant-wellness.com/concepts/reports.md).

> [!NOTE]
>
> A `404` means the identifier isn't within your account's access **or** is unknown — both look the
> same so sample existence isn't leaked. It never means "still processing".


## OpenAPI

````yaml GET /report/fhir/{id}
openapi: 3.1.0
info:
  title: Vibrant Wellness Portal API
  version: 2026-07-01-draft
  description: >-
    Order lab tests and retrieve results programmatically. Authenticate once
    with OAuth2 client credentials, browse the catalog, quote and
    eligibility-check an order, create patients, place orders, and pull results
    with their report status and issues.


    This reference documents the target external contract (v1).
  contact:
    name: Vibrant Wellness Developer Support
    email: portal-api@vibrant-wellness.com
    url: https://developers.vibrant-wellness.com
  license:
    name: Proprietary
servers:
  - url: https://api.vibrant-america.com/v1
    description: Production
  - url: https://api-sandbox.vibrant-america.com/v1
    description: Staging (sandbox)
security:
  - oauth2: []
tags:
  - name: Catalog
    description: Browse orderable tests and panels.
  - name: Pricing
    description: Get an authoritative price and eligibility check before ordering.
  - name: Patients
    description: Create patients.
  - name: Orders
    description: Place lab orders.
  - name: Reports
    description: Retrieve results, report status, and issues.
paths:
  /report/fhir/{id}:
    get:
      tags:
        - Reports
      summary: Get a report
      description: >-
        Returns the lab result as a FHIR R4 `DiagnosticReport`, enriched with
        the portal report status and all issues.


        **Identifier — barcode or sampleId, auto-detected.** `{id}` accepts the
        accession/barcode returned by `POST /orders` or a numeric `sampleId`;
        the API resolves it as a barcode first and falls back to sampleId only
        for an all-digits value that is definitively not a barcode. Query
        aliases also work: `GET /report/fhir?barcode={barcode}` or
        `?sampleId={sampleId}` (if both are sent, `sampleId` wins; neither →
        `400`).


        **Four outcomes — always `200` unless access is denied:**

        - **Report ready and unblocked** (including `preliminary`) → full result
        content: observations, PDF `presentedForm` link, plus status + issues.

        - **Nothing finished yet** → a status shell: report status + per-report
        counts + issues, including a synthetic **`No Finished Test`**
        report-blocking issue. No result content.

        - **Report-blocking issue** (e.g. a billing issue) → status, counts and
        issue extensions returned; Observations, `result` references and PDF
        `presentedForm` links are withheld until the issue resolves. Status can
        remain `preliminary` or `final`; `conclusion` says why. Read the
        blocking flags rather than inferring content access from status alone.

        - **Cancelled order** → `status: cancelled`, cancellation details and
        `conclusion`, with no result content or PDF. This top-level status is
        terminal; stop waiting for or polling results regardless of per-report
        progress details. You do not need to query Get orders to confirm
        cancellation.


        There is no bare "not-ready" `404` to poll — read `status` (and the
        `urn:vibrant:*` extensions) instead. Sample-level status, per-report
        progress counts (e.g. 2/3), and both issue lists ride in FHIR
        extensions; see the schema.
      operationId: getReport
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: >-
            Accession/barcode from `POST /orders` (e.g. `2508088888`) **or** a
            numeric `sampleId` — auto-detected.
      responses:
        '200':
          description: >-
            A FHIR R4 DiagnosticReport (result content present, or withheld with
            status + issues).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiagnosticReport'
              examples:
                ready:
                  summary: Report ready (incl. preliminary)
                  value:
                    resourceType: DiagnosticReport
                    status: final
                    code:
                      text: Gut Zoomer
                    issued: '2026-06-20T14:03:00Z'
                    identifier:
                      - system: urn:vibrant:accession
                        value: '2508088888'
                    extension:
                      - url: urn:vibrant:sample-level-report-status
                        extension:
                          - url: report_status
                            valueString: Final Report Available
                          - url: total_report_count
                            valueInteger: 3
                          - url: total_generated_report_count
                            valueInteger: 3
                    presentedForm:
                      - contentType: application/pdf
                        url: >-
                          https://api.vibrant-america.com/v1/report/fhir/2508088888/pdf
                shell:
                  summary: Nothing finished yet (status shell)
                  value:
                    resourceType: DiagnosticReport
                    status: registered
                    code:
                      text: Laboratory Report
                    identifier:
                      - system: urn:vibrant:accession
                        value: '2508088888'
                    extension:
                      - url: urn:vibrant:sample-level-report-status
                        extension:
                          - url: report_status
                            valueString: Awaiting Samples
                          - url: total_report_count
                            valueInteger: 2
                          - url: total_generated_report_count
                            valueInteger: 0
                      - url: urn:vibrant:sample-level-report-blocking-issue
                        extension:
                          - url: issue_name
                            valueString: No Finished Test
                          - url: blocks_report
                            valueBoolean: true
                withheld:
                  summary: Withheld (report-blocking issue)
                  value:
                    resourceType: DiagnosticReport
                    status: final
                    conclusion: >-
                      Report and result data are withheld because this sample
                      has unresolved report-blocking issue(s): Billing Issue.
                    identifier:
                      - system: urn:vibrant:accession
                        value: '2508088888'
                    extension:
                      - url: urn:vibrant:sample-level-report-status
                        extension:
                          - url: report_status
                            valueString: Final Report Available
                          - url: total_report_count
                            valueInteger: 3
                          - url: total_generated_report_count
                            valueInteger: 3
                      - url: urn:vibrant:sample-level-report-blocking-issue
                        extension:
                          - url: issue_name
                            valueString: Billing Issue
                          - url: blocks_report
                            valueBoolean: true
                cancelled:
                  summary: Cancelled order — terminal, no results
                  value:
                    resourceType: DiagnosticReport
                    status: cancelled
                    conclusion: >-
                      The order for this sample has been cancelled. Result
                      content is withheld; stop polling for results on this
                      order.
                    code:
                      text: Laboratory Report
                    identifier:
                      - system: urn:vibrant:accession
                        value: '2508088888'
                    extension:
                      - url: urn:vibrant:order-canceled
                        extension:
                          - url: order_canceled
                            valueBoolean: true
                          - url: order_cancel_time
                            valueDateTime: '2026-06-12T10:00:00Z'
        '400':
          description: >-
            Query form with neither `sampleId` nor `barcode`, or a non-numeric
            `sampleId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_request
                  message: Provide sampleId or barcode.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            Access denied — the identifier isn't within your account's access,
            **or** the identifier is unknown. Both return the same `404` so
            sample existence isn't leaked. Not-ready is NOT a 404 (see the three
            outcomes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Report not accessible.
        '429':
          description: >-
            Rate limit exceeded — **30 requests/minute per client**. Retry with
            backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Too many requests.
        '503':
          description: >-
            Path-param form only: the barcode resolver hit a transient error —
            retry. The API never silently falls back to reading a different
            sample.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: temporarily_unavailable
                  message: Identifier resolution failed, retry.
      security:
        - oauth2:
            - result
            - report
components:
  schemas:
    DiagnosticReport:
      type: object
      description: >-
        A FHIR R4 DiagnosticReport (abridged). Result content (contained
        Patient/Specimen/Observations, `result` references, PDF `presentedForm`
        link — never embedded base64) is present for ready reports, including
        preliminary, unless a report-blocking issue withholds access. A blocking
        issue can leave status as preliminary or final while Observations,
        result references and PDF links are omitted; status, counts and issue
        extensions remain available. Portal report status, per-report progress
        counts, and all issues ride in `urn:vibrant:*` extensions.
      properties:
        resourceType:
          type: string
          enum:
            - DiagnosticReport
        status:
          type: string
          enum:
            - registered
            - preliminary
            - final
            - cancelled
            - unknown
          description: >-
            Mapped from the portal report status: Final Report Available →
            `final`; Preliminary Report Available → `preliminary` (content is
            returned unless blocked); Analyzing/Awaiting Samples, No Reports →
            `registered`; status unavailable → `unknown` (fail-closed, result
            withheld). A cancelled order reports `cancelled` with a cancellation
            conclusion and urn:vibrant:order-canceled details, and no result
            content or PDF. This top-level cancelled status is terminal: stop
            waiting for or polling results regardless of per-report progress
            details. You do not need to query Get orders to confirm
            cancellation. Status describes report progress, not content-access
            permission: unresolved report-blocking issues can withhold results
            and PDF links while status remains preliminary or final. Check the
            structured blocking-issue extensions and conclusion.
        conclusion:
          type: string
          description: >-
            Present when the result content is withheld — explains why (blocking
            issue, not ready, or fail-closed).
        code:
          type: object
          properties:
            text:
              type: string
        issued:
          type: string
          format: date-time
        identifier:
          type: array
          items:
            type: object
            properties:
              system:
                type: string
              value:
                type: string
        presentedForm:
          type: array
          items:
            type: object
            properties:
              contentType:
                type: string
              url:
                type: string
          description: >-
            Link to the report PDF (present only when result content is
            released).
        extension:
          type: array
          description: >-
            FHIR complex extensions carrying the portal detail:
            `urn:vibrant:sample-level-report-status` (portal `report_status`
            string + `total_report_count`/`total_generated_report_count` —
            per-report progress like 2/3);
            `urn:vibrant:sample-level-report-blocking-issue` and
            `urn:vibrant:sample-level-issue` (repeated, one per issue:
            `issue_name`, `issue_type_id`, `issue_id`, `issue_comment`,
            `blocks_report`); per-report buckets (`urn:vibrant:pending-report`,
            `awaiting-samples-report`, `analyzing-samples-report`,
            `processing-report`, `finished-report`); and
            `urn:vibrant:report-status-list-v2` (`valueString` = the full
            status+issues JSON — issue arrays always present, `[]` when empty).
            Cancelled reports also include `urn:vibrant:order-canceled` with
            `order_canceled` (boolean) and `order_cancel_time` (date-time).
          items:
            type: object
            additionalProperties: true
    Error:
      type: object
      description: >-
        🚧 Working in progress — this envelope is the contract; not yet returned
        by every endpoint.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
            requestId:
              type: string
              description: >-
                Identifier for this request. Include it when contacting support.
                Also returned on every response as the X-Request-Id header.
              example: req_01JQ8ZC5X9K2MN
            details:
              type: array
              items:
                type: object
                additionalProperties: true
              description: Optional structured context.
          required:
            - code
            - message
            - requestId
  responses:
    Unauthorized:
      description: Not authenticated. See Authentication.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Not authenticated.
              requestId: req_01JQ8ZC5X9K2MN
    Forbidden:
      description: Authenticated, but not permitted for this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: Not permitted for this resource.
              requestId: req_01JQ8ZC5X9K2MN
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 client credentials. Generate a client ID and client secret in the
        Portal, exchange them for an access token, then send `Authorization:
        Bearer <access_token>`. Request the `result` and `report` scopes to read
        results.
      flows:
        clientCredentials:
          tokenUrl: https://api.vibrant-america.com/v1/oauth2/token
          scopes:
            result: Read finalized lab results
            report: Read report status and issues

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.