Construct a SOAP-based ProvideAndRegisterDocumentSet-b (ITI-41) request message containing a SubmissionSet metadata object, one or more Document objects, and optional Folder associations using ebXML RIM objects
Populate required SubmissionSet metadata including uniqueId, sourceId, submissionTime, patientId (in CX format), contentTypeCode, and intendedRecipient
Attach each document as a MTOM/XOP binary part in the SOAP message, referencing each part from its corresponding ExtrinsicObject in the metadata
Send the MTOM-encoded SOAP request to the XDS.b Document Repository endpoint and capture the RegistryResponse
Check the RegistryResponse status for urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success and parse any RegistryErrorList for partial failures
Store the returned document uniqueId and repositoryUniqueId for subsequent retrieval via RetrieveDocumentSet-b
Known gotchas
Patient identifiers must use the CX HL7 data type format (id^^^&assigningAuthorityOID&ISO) — a plain MRN without the assigning authority OID will cause a XDSPatientIdDoesNotMatchDocument error
MTOM Content-Type headers must specify the correct boundary parameter and each binary part must declare application/octet-stream or the appropriate MIME type; mismatched boundaries cause the repository to reject the entire submission
XDS.b repositories typically enforce that the patientId in the SubmissionSet exactly matches all included Document ExtrinsicObject patientId values — any mismatch results in XDSPatientIdDoesNotMatchDocument even if each value is individually valid
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