[Profiles & Operations](https://simplifier.net/guide/eReferralOntario/ProfilesandOperations) > Update Referral
### Update Referral **Update Referral** interaction should be implemented by defined FHIR messaging context in HL7 FHIR. In FHIR messaging, a "request message" is sent from a source application to a destination application when an event happens. Events mostly correspond to things that happen in the real world. The request message consists of a Bundle identified by the type "message", with the first resource in the bundle being a MessageHeader resource. The MessageHeader resource has a code - the message event - that identifies the nature of the request message, and it also carries additional request metadata. The other resources in the bundle depend on the type of the request. The events supported in this specification , along with the resources that are included in them are mentioned in MessageHeader. The destination application processes the request and returns one or more response messages which are also a bundle of resources identified by the type "message", with the first resource in each bundle being a **MessageHeader resource** with a response section that reports the outcome of processing the message and any additional response resources required. ### Scope These transactions involves a request/response by an FHIR Client Application for the submission of an updated referral.Request is sent via a /Bundle PUT to an endpoint hosted by the eReferral server and response will be HTTP success message . ### Interaction Diagrams The following diagram illustrates the high-level interaction between an FHIR submitting system and receiving system. {{render:ereferral-ontario/updatedservicerequest-jpg}} **Actor:** FHIR Requester Application **Role:** Send updated referral for a single patient based on a known identifier-ServiceRequest ID. **Actor:** FHIR Receiving Application **Role:** Returns an HTTP Success 200 response ### Update eReferral Operation This operation supports an HTTP PUT specifying the allowed identifiers(ServiceRequest identifiers) of a single patient instance from the FHIR requester application to send the updated referral to receiving application. UpdateReferral **Trigger Events** 1. When an FHIR requester Application initiates the request for an updated referral submission for a patient, it invokes an update referral request and send it to the receiving system. 2. When an FHIR receiving system recieves updated referral from an eReferral server,it invokes the Successful HTTP response and send it to the requester system, or an OperationOutcome resource, if an internal error occurs. **Summary of Supported Operations** The table below shows the allowed transactions for each profile and how they support FHIR endpoints, resources and their corresponding HTTP operations (https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html): |Resource | Transaction | HTTP Operations|URL|Request Body Resource|Response Body Resource |- |SeviceRequest|PUT|PUT|[base]/Servicerequest?|[ServiceRequest](https://simplifier.net/guide/eReferraldraftiGuide/ServiceRequest)|200 or Operation Outcome| The interaction summary table below lists the HTTP status codes that may be returned for the PUT operations for Submit Referral and Relay Referral. |Interaction|Content-Type|Body|Location|Versioning|HTTP Status Codes|Comments |- |PUT|R|R: ServiceRequest|Bundle|N/A|200,400,500| | **Expected Behavior** eReferral SHALL send the updated request bundle containing ServiceRequest resource that corresponds to the ServiceRequest ID provided by the FHIR requesting application. eReferral SHALL respond with a HTTP 200 success code if the mesaage is recieved successfully or an OperationOutcome resource, if an internal error occurs. ### Resource Profiles This eReferral FHIR operation is based on the HL7 FHIR STU R4 PUT operation. **Update Referral** **eReferral Requester Systems** will submit a FHIR Bundle containing a ServiceRequest + other relevant resources to the endpoint of a pre-selected target HealthcareService, hosted by an eReferral server. On successful submission, the sending system will receive a HTTP success response or an OperationOutcome. **Sending an eReferral has three key components: 1. Build a /Bundle including the /ServiceRequest and other relevant resources Include the target /HealthcareService in the payload for routing (usually retrieved during the Choose Recipient process) 2. PUT to the target service's /Endpoint (which is specified in the/HealthcareService) ***'PUT [endpoint.address]'*** 3. Referral attachments may be included by using the ServiceRequest.SupportingInfo element to reference a /DocumentReference resource, which in turn references /Binary resources. Small /Binary attachments can be included in the transmission /Bundle. Large /Binary attachments should be included as references. Due to potential API performance and reliability issues, any /Binary over 100kb should be sent as a reference. A referral text/HTML summary can be included using the http-response-header - additional_referral_info, formatted as HTML, to send custom data that is not otherwise mapped to FHIR data elements. **eReferral Response** The response from an eReferral request operation is an HTTP success response, and if an error occurs it may include an OperationOutcome with further advice. **Examples**