# Results Query

This data model allows you to exchange discrete clinical data—usually as a result of an order—with an EHR system. 

Results data can be written as discrete data (e.g., lab values), text (e.g., pathology report), or other complex formats (e.g., PDF, JPEG, Word) to the EHR system, depending on their respective capability. If you're writing back a file, [**see tips for sending files**](https://docs.redoxengine.com/permalink/P64iPMZngDZE2ggTAL1kC).

This data model has event types that allow you to:

- receive a notification when new results are added; or
- query for and receive result data. 

> **Typical use cases**
>
> You can save one-off values to a patient's chart with `Results`, like any of these: 
>
> **Lab results**
>
> - general lab (discrete lab values)
> - microbiology (discrete, structured lab data pertaining to antibiotic sensitivities) 
> - pathology (result reports after reviewing pathologic images)
>
> **Diagnostic imaging**
>
> - radiology (result reports after reviewing radiologic images)
> - cardiology (result reports and/or discrete data after reviewing cardiology images)
> - urology (urination tests)
> - pulmonology (lung function test)
> - neurology (EEGs and result reports)
> - obstetrics (fetal echos and result reports)

> **Device vs. Flowsheets vs. Results data models**
>
> There’s some overlap among these data models, but here’s what to expect for each: 
>
> - Device data is continuous. The `Device` data model requires a <u>device ID</u> to match results to a patient's chart. 
> - Flowsheet data is continuous. The `Flowsheet` data model requires a <u>patient ID</u> to match results to a patient's chart. 
> - Results data is discrete data that's usually a one-time outcome of an order. The `Results` data model requires a <u>patient ID</u> to match results to a patient's chart. 

Query for results based on the search criteria you define. If you specify multiple criteria, the result(s) must match all the provided criteria to be returned. Results are returned in `Result.QueryReponse`.

> **Required query parameters and populated response**
>
> The required elements and populated response vary depending on the EHR system you're integrating with. Work with your connection to understand which query parameters they require and what to expect in the response during implementation testing.

> **Data on demand enabled**
>
> This event type is available with data on demand. [Learn more about data on demand.](https://docs.redoxengine.com/permalink/4TD76U5kQESdKsZvzDHfx5)

Status: Beta, Data on demand

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Meta` | object | Yes |  |
| `Meta.DataModel` | string | Yes | Results |
| `Meta.EventType` | string | Yes | Query |
| `Meta.EventDateTime` | string or null | No | Displays the UTC date and time that an outgoing request is delivered or an incoming request is received. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `Meta.Test` | boolean or null | No | Indicates whether the request is a test or not. |
| `Meta.Source` | object | No | Contains the information for the system initiating the message, including the source ID and name. *Included in messages from Redox* |
| `Meta.Source.ID` | string or null | No | Identifies the system initiating the message. If you have multiple OAuth API keys per environment type, this value is required. If you have only one OAuth API key per environment type, or you're using legacy API keys, this value is optional. *UUID* |
| `Meta.Source.Name` | string or null | No | Displays the name of the system initiating the message. |
| `Meta.Destinations` | Array of object | No | Contains the information for the endpoint(s) receiving the request. A request must contain at least one destination, but asynchronous requests can have more than one destination. Synchronous requests like queries can only support one destination. *Required when sending data to Redox.* |
| `Meta.Destinations[].ID` | string or null | No | Identifies the endpoint that the request is directed to. *UUID* |
| `Meta.Destinations[].Name` | string or null | No | Displays the name of the endpoint that the request is directed to. |
| `Meta.Logs` | Array of object | No | Contains the log identifier(s) for the request. |
| `Meta.Logs[].ID` | string or null | No | Identifies the request log(s) that correspond to this request. You can use this value to locate the relevant log in the Redox dashboard for support and reference. *UUID* |
| `Meta.Logs[].AttemptID` | string or null | No | Identifies the request log attempt value, which is useful when retries are possible. *UUID* |
| `Meta.FacilityCode` | string or null | No | Code for the facility related to the message. *Only use this field if a health system indicates you should. The code is specific to the health system's EHR and might not be unique across health systems. In general, the facility fields within the data models (e.g. OrderingFacility) are more reliable and informative.* |
| `Patients` | Array of object | No | Array of patients to filter results on. *If multiple patients are provided, all results associated with any of the patients will be returned.* |
| `Patients[].Identifiers` | Array of object | No | List of IDs and ID types that identify the patient. *If multiple identifiers are provided, only patients with all identifiers will be considered.* |
| `Patients[].Identifiers[].ID` | string or null | No | ID for the patient |
| `Patients[].Identifiers[].IDType` | string or null | No | Type of ID. *E.g. MRN, EPI* |
| `Completion` | object | No | Time range to search for results. The query will be over the DateTime at which the individual results were composed into a report and released. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `Completion.StartDateTime` | string or null | No | Start of the time range to search for results. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `Completion.EndDateTime` | string or null | No | End of the time range to search for results. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `ResultStatuses` | Array of string | No | Array of result statuses to filter queries by. *If multiple result status values are provided, all results with any of the statuses will be returned.* Value set a0a5c1db-b4c5-4e44-944e-db9f65da1e11: Preliminary, Incomplete, Corrected, Final, Unavailable, None Specified, Canceled, Deleted, Specimen in lab, In Process |
| `OrderIDs` | Array of string | No | Array of order IDs assigned by the ordering system to filter queries by. *If multiple orders are provided, all results associated with any of the orders will be returned.* |
| `RelatedGroupIDs` | Array of string | No | Array of related group IDs assigned by the ordering system to filter queries by. *If multiple related group IDs are provided, all results associated with any of the group IDs will be returned.* |
| `Procedures` | Array of object | No | Array of procedures to query for related results. *All results associated with any of the procedure codes provided will be returned.* |
| `Procedures[].Code` | string or null | No | Code for the procedure |
| `Procedures[].Codeset` | string or null | No | Code set used to identify the procedure. *If no code set is specified, a health system specific identifier is being used.* Value set b442f8b8-b0b5-4af5-83a6-0cbd4c87204a: NPI, LOINC, ICD-10, NDC, CVX, SSN, SNOMED CT, RxNorm, CPT-4, ICD-9, HCPCS, Unknown, ICD-10-CA |
| `Location` | object | No |  |
| `Location.Department` | string or null | No | ID corresponding to the department from which to retrieved the patient chart. *This field is required for some EHRs.* |
| `LastUpdated` | object | No | An alternative time range to search for results. Instead of querying over a clinically relevant timestamp like Completion, this searches over database update timestamps. *Timestamps are in [ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `LastUpdated.StartDateTime` | string or null | No | Allows for searching on updated time of results. This is the start of the time range to search in. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `LastUpdated.EndDateTime` | string or null | No | Allows for searching on updated time of results. This is the end of the time range to search in. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |

## Example

```json
{
  "Meta": {
    "DataModel": "Results",
    "EventType": "Query",
    "EventDateTime": "2026-11-16T23:16:06.930Z",
    "Test": true,
    "Source": {
      "ID": "7ce6f387-c33c-417d-8682-81e83628cbd9",
      "Name": "Redox Dev Tools"
    },
    "Destinations": [
      {
        "ID": "af394f14-b34a-464f-8d24-895f370af4c9",
        "Name": "Redox EMR"
      }
    ],
    "Logs": [
      {
        "ID": "d9f5d293-7110-461e-a875-3beb089e79f3",
        "AttemptID": "925d1617-2fe0-468c-a14c-f8c04b572c54"
      }
    ],
    "FacilityCode": null
  },
  "Patients": [
    {
      "Identifiers": [
        {
          "ID": "000000001",
          "IDType": "MRN"
        }
      ]
    }
  ],
  "Completion": {
    "StartDateTime": "2015-05-06T06:00:00.000Z",
    "EndDateTime": "2015-05-06T07:00:00.000Z"
  },
  "ResultStatuses": [
    "Final"
  ],
  "OrderIDs": [
    "123",
    "456",
    "789"
  ],
  "RelatedGroupIDs": [],
  "Procedures": [],
  "Location": {
    "Department": null
  },
  "LastUpdated": {
    "StartDateTime": null,
    "EndDateTime": null
  }
}
```
