Implement a FHIR-based care coordination workflow using Task resources to assign, track, and complete referral tasks between a referring provider and a specialist, with ServiceRequest linking the clinical order to the task
Create a ServiceRequest resource representing the referral order with requester (referring provider), performer (specialist or specialty), subject (patient), and code (procedure or service requested) populated according to the US Core ServiceRequest profile
Create a Task resource with Task.focus referencing the ServiceRequest, Task.intent=order, Task.status=requested, Task.requester (referring provider), and Task.owner (specialist organization or practitioner) to represent the referral workflow item
Implement a Task status lifecycle: the specialist system updates Task.status from requested to accepted (or rejected with Task.statusReason), then to in-progress when work begins, and finally to completed with Task.output referencing the resulting DiagnosticReport or DocumentReference
Subscribe to Task changes using FHIR Subscriptions or poll Task resources filtered by owner and status to allow the referring provider's system to track referral progress without manual follow-up
Link all related resources (ServiceRequest, Task, DiagnosticReport, Appointment) using provenance and reference chains so the complete referral lifecycle is traceable from a single patient-centric query
Known gotchas
FHIR Task status transitions are not enforced by the server; the workflow engine in the client application must validate that status transitions are logically valid (e.g., a completed Task cannot go back to in-progress) to maintain workflow integrity
Task.owner refers to the party responsible for performing the task, which may be an organization rather than a specific practitioner; referral routing logic must handle both individual and organizational task owners and implement appropriate notification routing
When Task represents a referral to an external organization that does not share the same FHIR server, the Task.owner reference cannot be resolved locally; implement cross-organizational task exchange using Direct Secure Messaging or FHIR messaging alongside the Task resource
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