## New Referral **New 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/receiving of referrals.These are sent via a /Bundle POST to an endpoint hosted by the eReferral server. ### Interaction Diagrams The following diagram illustrates the high-level interaction between an FHIR submitting system and receiving system. {{render:eReferral-Ontario/ServiceRequest-jpg}} **Actor:** FHIR Requester Application **Role:** Requests referrals for a single patient based on a known identifier-ServiceRequest ID **Actor:** FHIR Receiving Application **Role:** Returns a bundle containing the service ID for the single patient, in addition to the serviceRequest ID specified by the FHIR requester Application(if applicable). ### New Referral This operation supports an HTTP POST specifying the allowed identifiers( ServiceRequest identifiers) of a single patient instance from the FHIR requester application to send the referrals to receiving application. **Trigger Events** 1. When an FHIR requester application initiates the request for referral submission for a patient, it invokes a new referrals request and sends it to the receiving system. 2. When an FHIR receiving system recieves new referral from an eReferral server,it invokes the response and sends it to the requester system. **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|POST|POST|[base]/Servicerequest?|[ServiceRequest](https://simplifier.net/guide/eReferraldraftiGuide/ServiceRequest)|[ServiceRequest]( https://simplifier.net/guide/eReferraldraftiGuide/ServiceRequest)| The interaction summary table below lists the HTTP status codes that may be returned for the POST operations for new referral. |Interaction|Content-Type|Body|Location|Versioning|HTTP Status Codes|Comments |- |POST|R|R: ServiceRequest|Bundle|N/A|200,400,500(**TBD**)| | **Expected Behavior** eReferral SHALL send the request bundle containing ServiceRequest resource that corresponds to the ServiceRequest ID provided by the FHIR requesting application. eReferral SHALL respond with a bundle with a ServiceRequest resource that contains a ServiceRequest identifier provided by the FHIR receieving application, or an OperationOutcome resource if an internal error occurs. ### Resource Profiles This eReferral FHIR operation is based on the HL7 FHIR STU R4 POST operation. **New 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 response bundle, and the eReferral will be viewable in the eReferral Server system. **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. POST to the target service's /Endpoint (which is specified in the/HealthcareService) ***'POST [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 a bundle containing ServiceRequest resource (i.e. eReferral Response) . If eReferral does not found any serviceRequest based on the provided ID in Search Request, it will return an empty search result with no error, but may include an OperationOutcome with further advice. ### Examples ***New Referral example(JSON)***: The following is the reference payload used for submitting new eReferrals to an eReferral server. All eReferral servers should be able to process this payload successfully. This is sent via a /Bundle POST to an endpoint hosted by the eReferral server. **Content-Type: application/fhir+json;charset=utf-8** ~~~~ { "resourceType": "Bundle", "type": "message", "timestamp": "2018-03-09T15:21:51.2112Z", "entry": [ { "resource": { "resourceType": "MessageHeader", "id": "uuid-000000", "eventCodeing": { "code": "add-service-request" }, "destination": [ { "name": "Caredove", "endpoint": "https://www.caredove.com/api/FHIR4_v1" } ], "source": { "name": "Referrer Agency Incorporated", "software": "EMR X", "version": "3.1.45", "contact": { "system": "email", "value": "support@referreragencyinc.com", "use": "work" }, "endpoint": "www.referreragencyinc.com/endpoint" }, "focus": { "reference": "ServiceRequest/uuid-0" } }, "request": { "method": "POST", "url": "MessageHeader" } }, { "resource": { "resourceType": "ServiceRequest", "id": "uuid-0", "text": { "status": "generated", "div": "Human readable HTML narrative of entire ServiceRequest and related resources goes here. For brevity sake, it is omitted here, but can be included in an actual transmission." }, "identifier": [ { "type" : { "text" : "XYZ Source System Referral ID" }, "value": "7654321" }, { "type" : { "text" : "ABC Relay System Tracking ID" }, "value": "1234567" } ], "status": "active", "intent": "proposal", "priority": "routine", "subject": { "reference": "Patient/uuid-1" }, "authoredOn": "2018-03-09T15:21:51Z", "requester": { "reference": "PractitionerRole/uuid-2a" }, "performer": { "reference": "https://www.caredove.com/FHIR4/HealthcareService/8654" }, "reasonCode": [ { "text": "Reason for referral narrative goes here" } ], "note": [ { "text": "Allergies: Penicillin \nFood Allergies: Peanuts" }, { "text": "Social History: History of family conflict \nlow social interaction" } ] }, "request": { "method": "POST", "url": "ServiceRequest" } }, { "resource": { "resourceType": "Patient", "id": "uuid-1", "identifier": [ { "type": { "coding": [ { "code": "JHN", "system": "http://hl7.org/fhir/v2/0203" } ], "text": "Ontario PHN" }, "value": "4455 044 033", "system": "http://ehealthontario.ca/API/FHIR/NamingSystem/ca-on-patient-hcn", "extension": [ { "url": "https://www.caredove.com/FHIR3/StructureDefinition/caredove-healthcardversion", "valueString": "H" } ] }, { "type" : { "text" : "Student Card #" }, "value": "3699098" } ], "name": [ { "given": [ "Patty", "Atient" ], "family": "O'Subject" } ], "telecom": [ { "system": "phone", "value": "(555) 111-1111 x1ARY", "use": "mobile", "rank": 1 }, { "system": "phone", "value": "(555) 222-2222 x2ARY", "rank": 2 }, { "system": "email", "value": "testpatient@caredove.com" } ], "gender": "male", "birthDate": "1928-06-29", "address": [ { "use": "home", "type": "physical", "line": [ "Unit 2", "50 Albert St." ], "city": "Waterloo", "state": "ON", "postalCode": "K8N 1N1", "country": "Can" } ], "maritalStatus": { "coding": [ { "code": "M", "display": "Married" } ], "text": "Married" }, "contact": [ { "relationship": [ { "text": "Emergency Contact" } ], "name": { "given": [ "Shemergency", "David" ], "family": "McContact" }, "telecom": [ { "system": "phone", "value": "(555) 111-1111 xEM1ARY", "use": "mobile", "rank": 1 }, { "system": "phone", "value": "(555) 222-2222 xEM2ARY", "rank": 2 }, { "system": "email", "value": "testcontact@caredove.com" } ], "address": { "use": "home", "type": "physical", "line": [ "Unit 2", "50 Albert St." ], "city": "Waterloo", "state": "ON", "postalCode": "32819", "country": "Can" }, "gender": "female" } ], "communication": [ { "language": { "coding": [ { "code": "en", "display": "English" } ], "text": "English" }, "preferred": true } ], "generalPractitioner": [ { "reference": "PractitionerRole/uuid-3a" } ] }, "request": { "method": "POST", "url": "Patient" } }, { "resource": { "resourceType": "PractitionerRole", "id": "uuid-2a", "practitioner": { "reference": "Practitioner/uuid-2b", "display" : "Requesty McSenderson" }, "organization": { "reference": "Organization/uuid-2c", "display": "North Sender Clinic" }, "code" : { "text" : "Community Case Manager" }, "location": [ { "reference": "Location/uuid-2d", "display" : "Suite 11, 11 King st. West, Kitchener, ON, Can" } ], "telecom": [ { "system": "phone", "value": "(555) 111-1111", "use": "work" }, { "system": "email", "value": "testsender@caredove.com", "use": "work" } ] }, "request": { "method": "POST", "url": "PractitionerRole" } }, { "resource": { "resourceType": "Practitioner", "id": "uuid-2b", "name": [ { "given": [ "Requesty" ], "family": "McSenderson" } ] }, "request": { "method": "POST", "url": "Practitioner" } }, { "resource": { "resourceType": "Organization", "id": "uuid-2c", "type" : { "coding" : { "system" : "http://hl7.org/fhir/ValueSet/organization-type", "version" : "3.5.0", "code" : "prov", "display" : "Healthcare Provider" } }, "name": "North Sender Clinic" }, "request": { "method": "POST", "url": "Organization" } }, { "resource": { "resourceType": "Location", "id": "uuid-2d", "name": "Downtown Sender Hub", "address": { "use": "work", "type": "physical", "line": [ "Suite 11", "11 King st. West" ], "city": "Kitchener", "state": "ON", "postalCode": "N2L 1T1", "country": "Can" } }, "request": { "method": "POST", "url": "Location" } }, { "resource": { "resourceType": "PractitionerRole", "id": "uuid-3a", "practitioner": { "reference": "Practitioner/uuid-3b", "display" : "Dr. Prim Caredove" }, "organization": { "reference": "Organization/uuid-3c", "display" : "Star Family Health Team" }, "specialty" : { "coding" : { "system" : "http://hl7.org/fhir/ValueSet/c80-practice-codes", "version" : "20091109", "code" : "419772000", "display" : "Family practice" } }, "location": [ { "reference": "Location/uuid-3d", "display" : "22 Weber st. East, Kitchener ON, Can" } ], "telecom": [ { "system": "phone", "value": "(555) 222-2222", "use": "work" }, { "system": "email", "value": "familydoc@caredove.com", "use": "work" } ] }, "request": { "method": "POST", "url": "PractitionerRole" } }, { "resource": { "resourceType": "Practitioner", "id": "uuid-3b", "name": [ { "given": [ "Dr. Prim" ], "family": "Caredoc" } ] }, "request": { "method": "POST", "url": "Practitioner" } }, { "resource": { "resourceType": "Organization", "id": "uuid-3c", "type" : { "coding" : { "system" : "http://hl7.org/fhir/ValueSet/organization-type", "version" : "3.5.0", "code" : "prov", "display" : "Healthcare Provider" } }, "name": "Star Family Health Team" }, "request": { "method": "POST", "url": "Organization" } }, { "resource": { "resourceType": "Location", "id": "uuid-3d", "name": "West Side GP Office", "address": { "use": "work", "type": "physical", "line": [ "22 Weber st. East" ], "city": "Kitchener", "state": "ON", "postalCode": "N2L 2T2", "country": "Can" } }, "request": { "method": "POST", "url": "Location" } } ] }