---
title: "Retrieve Patient Identifier and Demographics From Trial Team"
canonical: "https://wiki.patientsknowbest.com/space/api/4734287904/Retrieve%20Patient%20Identifier%20and%20Demographics%20From%20Trial%20Team"
format: markdown
---
> Macro (toc)

# Requirements

This is required so the CRO knows which patients have consented to their PKB clinical trial teams.  This query is per PKB clinical trial team, and each trial team has its own HL7 team-level credentials.

You'll use an **HL7 A19 Query** with a **timestamp filter** to retrieve patient records. **You should dynamically update the timestamp** to match the last time you checked. This ensures that each query only returns **patients added since the last request**, preventing duplicate data and ensuring completeness.

# **Helpful Links**

- [HL7 Connectivity information](https://wiki.patientsknowbest.com/space/api/4348313769/HL7+API+-+Network+Connectivity), including endpoint options per environment.
- General [HL7 Integration guidance](https://wiki.patientsknowbest.com/space/api/3365012127/HL7+Integration)

# QRY A19

> Macro (excerpt-include)



> Macro (excerpt-include)



# Example

> Macro (excerpt-include)



> Macro (excerpt-include)



# Example

> Macro (excerpt-include)