# PatientAdmin VisitQuery

This data model allows you to stay up-to-date on documented patient demographics, insurance, and the patient identifier used by the EHR system (usually an MRN). `PatientAdmin` relies on an admission, discharge, and transfer (ADT) feed from a provider.

`PatientAdmin` data can vary, but there are two main categories of data:

- <u>Patient-level</u>: Information about the patient that persists over time (e.g., name, address, gender, DOB, email address, primary care provider) that isn't tied to a particular encounter.
- <u>Visit-level</u>: Information pertaining to the patient's visit (e.g., the current location within the hospital, referring provider, admitting provider, care team, or discharge date/time).

This data model has event types that allow you to:

- receive a notification about patient appointments or records; 
- query for and receive a list of admitted patients; or
- query for and receive patient visit information. 

> **PatientAdmin vs. PatientSearch data models**
>
> `PatientAdmin` is a webhook-based feed that communicates changes to patient information, usually through a push notification generated from an ADT HL7v2 interface. 
>
> `PatientSearch` allows you to query for patient updates as you need them.

> **Fun fact**
>
> `PatientAdmin` is our most popular data model. Fun fact: Over 90% of Redox implementations use it in some form! 
>
> If you're a vendor that persists patient data in your application, we recommend using this data model.

Query for more in-depth patient demographics and visit information after receiving other `PatientAdmin` event types. Results are returned in `PatientAdmin.VisitQueryReponse`.

Status: Developer preview, Data on demand

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Meta` | object | Yes |  |
| `Meta.DataModel` | string | Yes | PatientAdmin |
| `Meta.EventType` | string | Yes | VisitQuery |
| `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.* |
| `PatientClasses` | Array of string | No | Specify one or more classes of encounters to return (e.g., inpatient, outpatient, emergency). Any encounters with an unknown patient class won't be returned if this parameter is defined in a query. |
| `Departments` | Array of string | No | Specify one or more departments to filter the census results. If multiple departments are specified, the results will include all patient visits with any of the specified departments. |
| `Facilities` | Array of string | No | Specify one or more facilities to filter the census results. If multiple facilities are included, the results will contain all patient visits in any of the specified facilities. *If both facility and department are specified, the results will only include patient visits that match both the facility and the department.* |
| `VisitStatuses` | Array of string | No | One or more statuses of visits to query. *Arrived, Cancelled, Finished, Planned, Unknown* |
| `Patients` | Array of object | No | Array of patients to filter visits on. *If multiple patients are provided, visits 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 of the Patient |
| `Patients[].Identifiers[].IDType` | string or null | No | ID Type for the corresponding ID of this patient (ie. MRN, EHRID) |
| `VisitNumbers` | Array of string | No | One or more identifiers for the visit. *If multiple are provided, multiple visits may be returned.* |
| `VisitStartDateTime` | string or null | No | Start of the time range to search for the visit. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |

## Example

```json
{
  "Meta": {
    "DataModel": "PatientAdmin",
    "EventType": "VisitQuery",
    "EventDateTime": "2026-11-13T22:05:58.042Z",
    "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
  },
  "PatientClasses": [],
  "Departments": [
    "3N"
  ],
  "Facilities": [
    "RES General Hospital"
  ],
  "VisitStatuses": [
    "Arrived"
  ],
  "Patients": [
    {
      "Identifiers": [
        {
          "ID": "0000000001",
          "IDType": "MR"
        },
        {
          "ID": "e167267c-16c9-4fe3-96ae-9cff5703e90a",
          "IDType": "EHRID"
        },
        {
          "ID": "a1d4ee8aba494ca",
          "IDType": "NIST"
        }
      ]
    }
  ],
  "VisitNumbers": [
    "1234",
    "5678"
  ],
  "VisitStartDateTime": "2026-11-13T22:05:58.203Z"
}
```
