A referring system posts a referral to a FHIR endpoint. The endpoint returns 201 Created. The sender shows “Accepted.” The receiving team has not seen the referral yet. Both systems can pass their interface tests and still leave the sender with the wrong impression about who owns the next step.
The interface needs to answer two different questions: did the server create a resource, and has the receiving team agreed to do the work? A third question follows later: what was actually completed? These are separate claims with different evidence.

What the HTTP response proves
In the FHIR R4 REST create interaction, a successful create returns 201 Created with a Location header identifying the new resource. That is evidence the endpoint created a FHIR resource. It does not, by itself, say a destination queue saw it, a team took it on, or an appointment was booked. If a particular endpoint promises additional outcomes, put those in the partner contract and test them. Do not infer them from the status code.
FHIR R4 ServiceRequest can represent the referral itself. In one implementation pattern, a separate Task tracks work on that referral and points to the request through Task.focus. That is a design option, not a requirement for every referral interface. A partner might have its own workflow API or implementation guide. Use its actual contract, but require it to make the same distinctions observable.
Write down what the receiving team is accepting
Consider a synthetic example: a referral portal sends a request to a scheduling service. In this design, the Task is specifically for intake processing, not for delivering the requested service. The intake team can accept the Task and later finish intake without any appointment having taken place. Agree on that boundary before choosing what the portal displays.
| Evidence | Safe wording in this design | What it does not prove |
|---|---|---|
| ServiceRequest created; no receiver decision recorded | Submitted; awaiting intake response | The destination has claimed the work |
Intake Task is received | Intake team is evaluating the request | The team agreed to process it |
Intake Task is accepted | Accepted for intake processing | The requested service is booked or complete |
Intake Task is rejected | Intake declined; see next step | The endpoint refused to create the referral |
Intake Task is completed | Intake processing complete | The underlying service was delivered |
The R4 Task status codes distinguish requested, when action is being sought, from received, when a potential performer has claimed it for evaluation. accepted is agreement to carry out the Task before work starts; rejected is a decision not to carry it out before acting on it. Be careful with the word “accepted”: the Task definition sets its scope. For this example, a decision about what gets scheduled may be a separate workflow outcome.
Make the handoff observable
Put three things in the interface contract. First, specify how the sender correlates a stable, namespaced business identifier for the referral with the receiver’s resource ID and intake Task. Avoid using patient identifiers as deduplication keys. A person can have more than one legitimate referral. Second, identify who may record a receiver decision, how the sender reads the decision, and whether both sides also expect a notification. A callback can speed up the update, but a missed callback should not strand the sender with stale information. Third, state who handles an overdue response, how rejections are communicated with appropriate access controls, and whether a decision applies to the original or an amended referral. Keep sensitive referral details out of general-purpose logs and alerts.
One failure is especially easy to miss: the endpoint saves the ServiceRequest but the intake handoff fails before a Task is created. If the agreed design expects a Task, monitor for requests with no linked Task after the agreed handoff window. Route those to the integration team, not the intake queue. An existing Task with no intake decision after the agreed response window is a different exception and can go to the queue owner. The two timers should not page the same team for the same reason.
Recover the resource and the work separately
If the sender times out, the resource may already exist. Where the endpoint supports it, R4 conditional create lets the sender use If-None-Exist with an agreed search criterion, such as the stable referral identifier. Zero matches proceeds with creation; one returns 200 OK without a second create; multiple matches returns 412 Precondition Failed. Verify support and matching behavior with the actual partner. Conditional create protects this resource interaction; it does not prove downstream work was created only once. Intake needs its own safe replay rule, keyed to the referral and the specific intake action.
What I would test before go-live
- Create succeeds; no Task appears. The portal never shows accepted, and the missing handoff is assigned to the integration team.
- The creation response is lost. Retry with the agreed recovery mechanism. One logical referral and one intake work item should be visible, with no ambiguous duplicate silently picked.
- The receiver declines after the portal saw submission. The portal shows the receiver’s decision and next step without mislabelling it as a transport error.
- A notification is delayed or missed. Reading the current receiver state restores the portal view. Closing the intake Task does not mark the requested service complete.
Put those cases in the acceptance tests. If the only proof of success is a green HTTP status, the integration has verified resource creation but has not verified the referral handoff.
Join the discussion
You must be logged in to post a comment.