SMART on FHIR

Searching for Data

Note: Opala’s publicly documented APIs are read-only. The guidance and examples on this page describe standard FHIR behavior on a Firely-based server for reference. Write operations and administrative server behaviors are not available on public endpoints.

FHIR Search Extensions

In addition to implementing most of the FHIR Search specification, Opala implements the following extensions:

_source

An additional search parameter called _source can be used to search for resources based on information about the system or request that created the resource. See Storing Source Information.

Searching by a resource’s meta.source is supported via the _source search parameter. Matching is performed against the resource’s meta.source URI (URL-escape special characters as needed).

Examples:

GET https://{baseurl}/Patient?_source=https://somesystem.example.org/foo
GET https://{baseurl}/Observation?_source=https%3A%2F%2Fpartner.example.com%2Fapp%2Fingest

Notes:

  • _source filters on a single URI value (meta.source). Do not append request IDs (e.g., with #…).

  • If you need to filter by request/transaction IDs or richer provenance, record those details in Provenance and query Provenance, then follow Provenance.target to the affected resources. (See the Provenance note below.)

Provenance

While Firely supports the standard Provenance resource and related searches, Opala’s public Patient Access APIs do not expose Provenance. The examples below are provided for general Firely-based servers and managed/private environments.

Examples (reference-only):

  • Find provenance for a specific resource:
    GET https://{baseurl}/Provenance?target=Patient/123
  • Filter by when the action was recorded:
    GET https://{baseurl}/Provenance?recorded=ge2025-01-01T00:00:00
  • Filter by agent (who performed the action):
    GET https://{baseurl}/Provenance?agent=urn:system|value
  • (If enabled) reverse chaining with _has:
    GET https://{baseurl}/Patient?_has:Provenance:target:recorded=ge2025-01-01

Check the server’s CapabilityStatement to confirm Provenance and _has support.

Macros

Opala does not support server-side date macros like %now and %today in search values. Use absolute timestamps computed by your client.

For example:

GET https://{baseurl}/Procedure?date=ge2025-01-12T15:30:00

If your environment has the FHIRPath _filter parameter enabled, you may alternatively use FHIRPath functions such as now() or today() in _filter. Check the server’s CapabilityStatement before using _filter.

Unsupported Search Parameters

Opala does not currently support the _containedType search parameter or the _contained=both directive.

Limitations

Type modifiers on chained parameters do not traverse contained resources; this is a general FHIR search limitation, not specific to Opala.

For example:

https://{baseurl}/Observation?subject:Patient.organization.name=HealthOrg

If Observation/A references Device/B which references Organization/C named “HealthOrg”, Observation/A is not returned because subject is restricted to Patient. If Observation/D uses a contained device (#contained-device) that refers to Organization/C, it may appear because type restrictions don’t apply through contained resources.