For a full list of available versions, see the Directory of published versions
This interaction is a standard FHIR RESTful search performed against the Bundle resource. The IR responds with a FHIR Bundle of type=document. The first entry in the bundle will always be a Composition resource conforming to the EHR Composition Document profile, which links together all relevant Immunization, Patient, PractitionerRole, and Location resources into a single cohesive document.
Interaction: SEARCH
Resource: Bundle
HTTP Request: GET [base]/Bundle?patient.identifier=[system]|[value]&type=document
Actor: Client Application
Role: Requests an immunization document bundle from the IR Solution based on specified search criteria.
Actor: IR Solution
Role: Receives, authenticates, validates, and stores incoming immunization document bundles from the Client Application.
The following search parameters are supported for this interaction.
| Name | Optionality | Type | Description | Usage Note | Example |
|---|---|---|---|---|---|
| composition.patient.identifier | Mandatory | token | This parameter specifies an identifier associated with the patient who is the subject of this immunization document. | Ontario Health Card Number (HCN), Medical Record Number (MRN), Ontario Immunization ID (OIID) MRN used by Panorama, or ECID (Enterprise Client Identifier) are allowed as a Patient ID parameter. Health Number Version is not supported. The IR utilizes the Provincial Client Registry (PCR) to validate and resolve these patient identifiers. | composition.patient.identifier=https://fhir.infoway-inforoute.ca/NamingSystem/ca-on-patient-hcn|1234567890composition.patient.identifier=urn:oid:2.16.840.1.113883.3.239.18.151|OIID12345composition.patient.identifier=http://ehealthontario.ca/fhir/NamingSystem/id-pcr-eid|987654321 |
| composition.patient.gender | Conditional | token | This parameter specifies the gender of the patient associated with the immunization document. | This parameter contains the administrative gender used during the client matching orchestration flow against the Provincial Client Registry (PCR) to prevent data duplication and overlay issues. | composition.patient.gender=female |
| composition.patient.birthdate | Conditional | date | This parameter specifies the birth date of the patient who is the subject of this immunization document. | This parameter should contain the Date of Birth of the patient as recorded in the registry. Note: This parameter SHALL be provided as part of data quality matching checks when the patient identifier is HCN or MRN to align with PCR validation rules. It is not required for queries where the patient identifier is the ECID. |
composition.patient.birthdate=1971-11-28 |
| composition.type | Mandatory | token | This parameter specifies the type of document bundle being retrieved. | This parameter is fixed to the canonical LOINC or jurisdictional document code representing an immunization summary or history of immunization document. | composition.type=http://loinc.org|11369-6 (History of Immunization Summary) |
| composition.immunization.occurrence | Optional | date | This parameter filters the document bundle content based on the specific vaccine administration date. | Filters records matching the Immunization.occurrence[x] attribute. The following standard FHIR prefixes can be used for the date parameter: gt, lt, ge, and le. If no prefix is present, the prefix eq is assumed. If no date boundary is provided, the server defaults to returning the full immunization history. |
composition.immunization.date=gt2023-02-24composition.immunization.date=ge2024-01-01&composition.immunization.date=le2026-05-01 |
| _sort | Optional | string | Sort order criteria for the returned immunization document entries within the bundle. | If not explicitly indicated in the search request, the default sort order is by the immunization occurrence (date) descending. |
_sort=date (ascending)_sort=-date (descending) |
| _count | Optional | integer | Size limit for response pagination and paging controls. | If there is no _count in the search request, the server will use the default configuration value of 50 records per page. Requests exceeding the maximal allowed configuration limit are automatically truncated to the provincial ceiling configuration limit. | _count=10 |
| _format | Optional | string | Specifies the serialization format of the returned FHIR response bundle payload. | Supports standard web architecture definitions for JSON (default) or XML. | _format=application/fhir+json |
The server provides paging for the results of a search interaction, and conforms to method adapted from RFC 5005 (Feed Paging and Archiving) for sending continuation links to the client when returning a Bundle.
If no page size is specified in the search query, the default page size will be 50 records. The maximum number of records returned in a page is 100. (_count)
This example shows the third page of a search result:
<Bundle xmlns="http://hl7.org/fhir">
<!-- snip metadata -->
<!-- This Search url starts with base search, and adds the effective
parameters, and additional parameters for search state. All searches
SHALL return this value.
In this case, the search continuation method is that the server
maintains a state, with page references into the stateful list.
-->
<link>
<relation value="self">
<url value="[base-search]/Bundle?composition.type=http://loinc.org|29550-1&composition.patient.identifier=[id-system-global-base]/ca-on-patient-hcn|12345678&composition.patient.birthdate=1971-11-28&composition.medicationdispense.whenprepared=ge2019-02-24&composition.medicationdispense.whenprepared=le2019-02-26&_sort=-whenprepared&_count=10"/>
</link>
<link>
<relation value="next"/>
<url value="[base-search]/Bundle?composition.type=http://loinc.org|29550-1&composition.patient.identifier=[id-system-global-base]/ca-on-patient-hcn|12345678&composition.patient.birthdate=1971-11-28&composition.medicationdispense.whenprepared=ge2019-02-24&composition.medicationdispense.whenprepared=le2019-02-26&_sort=-whenprepared&_count=10&_&[url will be provided by server]"/>
</link>
<!-- then the search results... -->
</Bundle>
The Bundle will only contain the first page of results. The URL marked next provides a link to fetch the next page of results. This allows client applications to fetch data in manageable amounts, which improves performance in many cases.
In order to allow the client to be confident about what search parameters were used as criteria by the server, the server will return the parameters that were actually used to process the search. Applications processing search results SHALL check these returned values where necessary. For example, if the server did not support some of the filters specified in the search, a client might manually apply those filters to the retrieved result set, display a warning message to the user or take some other action. In the case of a RESTful search, these parameters are encoded in the self link in the bundle that is returned:
<link>
<relation value="self"/>
<url value="[base-search]/Bundle?composition.type=http://loinc.org|29550-1&composition.patient.identifier=[id-system-global-base]/ca-on-patient-hcn|12345678&composition.patient.birthdate=1971-11-28"/>
</link>
In other respects, servers have considerable discretion with regards to supporting search:
The client can indicate which order to return the results by using the parameter _sort, which can have a value of one of the search parameters. The _sort parameter can repeat to indicate sort order, with the repeats indicating a lower sort priority sequentially. In the current release, only sorting by occurrence (administration date) is supported. Each item in the comma separated list is a search parameter, optionally with a '-' prefix. The prefix indicates decreasing order; in its absence, the parameter is applied in increasing order. E.g.: sort=-date
Note:
In order to keep the load on clients, server and the network minimized, the server may choose to return the results in a series of pages. The search result set contains the URLs that the client uses to request additional pages from the search set. Page links are contained in the returned bundle as links.
Server will provide its own parameters in the links that it uses to manage the state of the search as pages are retrieved. These parameters do not need to be understood or processed by the client.
The parameter _count is defined as a hint to the server regarding how many resources should be returned in a single page. Server will not return more resources than requested, but is allowed to return less than the client requested. The server might define a configurable default and maximal values for count in the future release. The server will repeat the original _count parameter in its returned page links so that subsequent paging requests honor the original _count.
The maximum number of records returned in a page is 100. (_count)
Note: The combination of _sort and _count can be used to return only the latest resource that meets a particular criteria - set the criteria, and then sort by date in descending order, with _count=1. This way, the last matching resource will be returned.
Example 1: Basic Search by Patient Health Card Number
Retrieve all immunization records for a patient using their Ontario Health Card Number (HCN).
GET [base]/Bundle?patient.identifier=https://fhir.infoway-inforoute.ca/NamingSystem/ca-on-patient-hcn|1234567890&type=document
Example 2: Search with date Filter
Retrieve immunization records for a patient that were administered on or after January 1, 2023.
GET [base]/Bundle?patient.identifier=https://fhir.infoway-inforoute.ca/NamingSystem/ca-on-patient-hcn|1234567890&type=document&date=ge2023-01-01
Example 3: Search by Ontario Immunization ID (OIID)
Retrieve immunization records using the unique provincial identifier used by Panorama.
GET [base]/Bundle?patient.identifier=http://ehealthontario.ca/fhir/NamingSystem/id-panorama-mrn|OIID12345&type=document
Example 4: Search by Pharmacy Medical Record Number (MRN)
Retrieve immunization records using the unique pharmacy-specific unique identifier.
GET [base]/Bundle?patient.identifier=http://ehealthontario.ca/fhir/NamingSystem/id-pharmacy-mrn|1234P98765ABCD0123&type=document
The following table details the comprehensive list of expected HTTP Response Codes and corresponding OperationOutcome details for various scenarios, including both clinical business rules and gateway-level access controls:
| Operation | Scenario Description | HTTP Response Code | OpOutcome Code | OpOutcome Severity | OperationOutcome.details.text / diagnostics |
|---|---|---|---|---|---|
| Bundle Search | Success - Return resources | 200 | |||
| Bundle Search | No matches | 200 | not-found | information | Not found: Immunization Document matching search parameters |
| Bundle Search | Patient has temporarily unblocked access | 200 | information | information | Patient has temporarily unblocked access to view and use immunization information. OperationOutcome diagnostics CONSENT_TEMP_UNBLOCK |
| Bundle Search | Immunization Record is blocked by consent directive | 200 | suppressed | warning | Access to Immunization Information has been blocked by the Patient. OperationOutcome diagnostics CONSENT_EXISTS |
| Bundle Search | HTTP (Gateway) request authorization header is missing | 400 | required | error | HTTP (Gateway) request authorization header is missing |
| Bundle Search | Gateway header content is invalid | 400 | structure | error | Gateway authorization header content is invalid |
| Bundle Search | Gateway context header is missing transaction identifier | 400 | required | error | HTTP (Gateway) request transaction identifier header is missing |
| Bundle Search | Gateway context header is missing UAO identifier | 400 | required | error | Gateway authorization header is missing UAO identifier |
| Bundle Search | Gateway context header is missing UAO identifier type | 400 | required | error | Gateway authorization header is missing UAO identifier type |
| Bundle Search | Gateway context header is missing NAME identifier | 400 | required | error | Gateway authorization header is missing SUB identifier |
| Bundle Search | Missing patient identifier | 400 | required | error | Missing mandatory search parameter: patient identifier |
| Bundle Search | Invalid patient identifier | 400 | value | error | Invalid search parameter: patient identifier |
| Bundle Search | Invalid patient identifier type | 400 | value | error | Invalid search parameter: patient identifier type |
| Bundle Search | Invalid date parameter | 400 | value | error | Invalid search parameter: date |
| Bundle Search | Invalid patient's date of birth | 400 | value | error | Invalid search parameter: patient's date of birth |
| Bundle Search | Invalid patient's gender | 400 | value | error | Invalid search parameter: patient's gender |
| Bundle Search | Invalid composition type | 400 | value | error | Invalid search parameter: composition type |
| Bundle Search | X-GtwyOriginalRequestUriMasked missing | 400 | required | error | HTTP (Gateway) request Original Request Uri Masked is missing |
| Bundle Search | Gateway authorization header is missing ISS | 400 | required | error | Gateway authorization header is missing ISS identifier |
| Bundle Search | Invalid query parameters | 400 | value | error | Invalid or missing query parameters |
| Bundle Search | Missing authentication credentials | 401 | value | error | Could not find Onboard Status in Client Config |
| Bundle Search | Missing required code | 403 | processing | error | Required LOINC code not found in Composition type, could not authorize request |
| Bundle Search | HCN is not found in PCR | 404 | not-found | error | Not found: ECID for requested Patient ID |
| Bundle Search | Validation error: Did not return 200 OK | 422 | required | error | $Validate did not return 200 OK |
| Bundle Search | Content is invalid: Missing MRN | 422 | required | error | No MRN identifier found on submission, unable to process data |
| Bundle Search | Content is invalid: Missing practitioner family name | 422 | required | error | Submitted practitioner does not have a family name |
| Bundle Search | Content is invalid: PPR practitioner missing family name | 422 | required | error | Practitioner found in PPR does not have a family name |
| Bundle Search | Content is invalid: PPR practitioner missing given name | 422 | required | error | Practitioner found in PPR does not have a given name |
| Bundle Search | Content is invalid: Validation failed internally | 422 | required | error | $Validate returned 500 Internal Server Error |
| Bundle Search | Rate Limit Exceeded | 429 | exception | error | Too Many Requests |
| Bundle Search | Unhandled Exception | 500 | exception | fatal | Internal Error |
| Bundle Search | Unhandled Exception: Terminology mapping | 500 | exception | fatal | Could not find %s Property for Terminology Code |
| Bundle Search | Connection error | 500 | exception | fatal | Error connecting to Terminology Endpoint |
| Bundle Search | Invalid or Unparsable response | 502 | processing | error | Received non-OK status from downstream endpoint |
| Bundle Search | Endpoint Timeout | 504 | exception | fatal | Downstream route endpoint timeout |
_count parameter and Bundle.link elements is supported for payloads that exceed the maximum bundle size limits.