Create a Composition resource with status=final, type coded with LOINC 60591-5 (Patient Summary Document), and subject referencing the Patient
Add the required IPS sections: Medication Summary (LOINC 10160-0), Allergies and Intolerances (LOINC 48765-2), and Problem List (LOINC 11450-4); each section requires at minimum a code and an entry array or an emptyReason if no data
Populate each section's entry array with references to the appropriate resources already in the server or bundle: MedicationStatement or MedicationRequest, AllergyIntolerance, and Condition respectively
Set Composition.author to the authoring Practitioner or Device and Composition.date to the document creation time
Assemble a document Bundle with type=document; the first entry must be the Composition, followed by all referenced resources with consistent fullUrl values
POST the Bundle to [base] or use $validate to check conformance against the IPS Composition profile before storing
Known gotchas
Required sections must be present even when empty; use section.emptyReason with an appropriate code (e.g., unavailable) rather than omitting the section element
All resources referenced in section.entry must be present in the same document Bundle; dangling references will fail IPS profile validation
The IPS profile requires specific terminology bindings (e.g., SNOMED CT for problem codes, ATC for medications in some jurisdictions); generic or missing codings will fail validation
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