Read the IHE MHD Implementation Guide mapping table that defines equivalences between FHIR DocumentReference elements and XDS ebXML RIM attributes
Map DocumentReference.masterIdentifier to XDS ExtrinsicObject uniqueId, DocumentReference.identifier to entryUUID, and DocumentReference.subject to patientId in CX format
Map DocumentReference.type to XDS typeCode (a coded concept), DocumentReference.category to classCode, DocumentReference.securityLabel to confidentialityCode, and DocumentReference.context.facilityType to healthcareFacilityTypeCode
Translate DocumentReference.content[0].attachment.url to the XDS repository document reference, and DocumentReference.content[0].attachment.contentType to mimeType
Validate the translated ExtrinsicObject against the XDS.b metadata schema and confirm all required coded values exist in the target registry's configured value sets
Known gotchas
Several XDS metadata fields (sourcePatientInfo, legalAuthenticator, intendedRecipient) have no direct FHIR DocumentReference equivalent and must be sourced from related FHIR resources (Patient, Practitioner) or omitted if the registry does not require them
XDS classCode and typeCode values must be drawn from the registry's configured code system, which is often locally defined — FHIR DocumentReference.category codes from LOINC may not match the registry's expected OIDs
The MHD profile defines Minimal Metadata and Comprehensive Metadata options — Comprehensive Metadata maps more fully to XDS but requires additional DocumentReference elements that many FHIR clients do not populate
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