Construct an AdhocQueryRequest SOAP message targeting stored query ID urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d (FindDocuments)
Supply the required $XDSDocumentEntryPatientId slot in CX format and optionally scope by $XDSDocumentEntryStatus (Approved), $XDSDocumentEntryClassCode, or $XDSDocumentEntryCreationTimeFrom/To
Send the request to the XDS.b Document Registry endpoint over SOAP/HTTP and receive the AdhocQueryResponse
Parse the returned ExtrinsicObject elements from the RegistryObjectList to extract documentUniqueId, repositoryUniqueId, mimeType, and human-readable display name
Use the retrieved uniqueId and repositoryUniqueId to issue a RetrieveDocumentSet-b (ITI-43) request to the appropriate repository
Known gotchas
Multi-value slot parameters such as $XDSDocumentEntryClassCode must encode each value as a separate Value element within the Slot; placing multiple codes in a single Value string is a common syntax error that returns zero results
The FindDocuments query only returns Approved documents by default — if you need deprecated documents you must explicitly include urn:oasis:names:tc:ebxml-regrep:StatusType:Deprecated in the status slot
Registry implementations vary in whether they support all optional query parameters; always consult the registry's conformance statement before relying on optional filtering slots
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp