HL7 SPQ_Q08 Stored Procedure Request
SPQ_Q08 sends a stored procedure request in an SPR segment. The query name and parameters are not self-describing enough by themselves; the sender and receiver need a shared contract for what the procedure does and what every parameter means.
This is a legacy query pattern. It can be effective inside a controlled private interface, but it is not a good open-ended integration style.
A small SPQ Q08 example
What systems do with it
The requester asks the responder to run a named procedure and return data in an agreed format. Optional RDF can describe the row definition expected in a tabular response. DSC can support continuation.
In real systems, the stored procedure name is often a stable logical name rather than a literal database procedure. That is safer and gives the responder room to change implementation without breaking the interface.
How to read the structure
MSH identifies SPQ^Q08^SPQ_Q08. SPR carries the query tag, response format, stored procedure name, and input parameter list. RDF can describe columns expected in a tabular response.
Implementation traps
Do not expose arbitrary procedure execution. Map incoming names to an allowlist, validate every parameter, and audit who asked for what.
Also version the parameter list. Positional parameters are brittle; one added field can make every old sender subtly wrong.
Reference notes
HL7 v2.3.1 event Q08 is the stored procedure request. See the HL7 Q08 event page.