Create a ServiceRequest conforming to the Gravity SDOH ServiceRequest profile with ServiceRequest.category set to the SDOH domain code, ServiceRequest.code from the Gravity SDOH ServiceRequest value set (e.g., referral for food pantry services), and ServiceRequest.reasonReference pointing to the SDOH Condition
Create a Task conforming to the SDOH Task profile with Task.focus referencing the ServiceRequest, Task.intent set to order, Task.status set to requested, and Task.requester and Task.owner set to the referring and receiving organizations respectively
Transmit the Task to the receiving community-based organization (CBO) either by POSTing it to their FHIR endpoint or by a FHIR messaging pattern, depending on the referral network's exchange model
Poll or subscribe to Task status updates as the CBO progresses the referral (Task.status transitions: requested → accepted → in-progress → completed or rejected or failed)
On Task completion, check Task.output for a Procedure resource reference documenting the services actually delivered, and update the originating SDOH Condition and Goal status accordingly
Known gotchas
The closed-loop referral pattern requires that the receiving CBO supports FHIR Task updates — many CBOs do not have FHIR-capable systems and the Task may need to be intermediated by a coordination platform that translates FHIR Tasks to email, phone, or portal workflows
Task.status of rejected versus failed have different meanings — rejected means the CBO declined to accept the referral before starting, while failed means the service was attempted but could not be completed; these distinctions matter for quality reporting
ServiceRequest and Task codes must align with Gravity value sets by SDOH domain; a mismatch between the ServiceRequest.category SDOH domain and the Task.code value set domain will fail cross-profile consistency checks
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