<Bundle xmlns="http://hl7.org/fhir">
  <type value="message" />
  <entry>
    <resource>
      <MessageHeader>
        <id value="uuid-000000" />
        <destination>
          <name value="Caredove" />
          <endpoint value="https://fhir.caredove.com:1800/MessageHeader/$process-message" />
        </destination>
        <source>
          <name value="Referrer Agency Incorporated" />
          <software value="EMR X" />
          <version value="3.1.45" />
          <contact>
            <system value="email" />
            <value value="support@referreragencyinc.com" />
            <use value="work" />
          </contact>
          <endpoint value="www.referreragencyinc.com/endpoint" />
        </source>
        <focus>
          <identifier>
            <system value="X-TRC-HUBLY-LID" />
            <value value="94c6b597-d19a-41c2-bb9a-3070b35bd9ae" />
          </identifier>
        </focus>
        <eventCoding>
          <code value="cds-service-request" />
        </eventCoding>
      </MessageHeader>
    </resource>
    <request>
      <method value="POST" />
      <url value="MessageHeader" />
    </request>
  </entry>
  <entry>
    <resource>
      <ServiceRequest>
        <id value="uuid-0" />
        <text>
          <status value="generated" />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.</text>
        <identifier>
          <type>
            <text value="XYZ Source System Referral ID" />
          </type>
          <value value="7654321" />
        </identifier>
        <identifier>
          <type>
            <text value="ABC Relay System Tracking ID" />
          </type>
          <value value="1234567" />
        </identifier>
        <status value="active" />
        <intent value="proposal" />
        <priority value="routine" />
        <subject>
          <reference value="Patient/uuid-1" />
        </subject>
        <authoredOn value="2018-03-09T15:21:51Z" />
        <requester>
          <reference value="PractitionerRole/uuid-2a" />
        </requester>
        <performer>
          <reference value="https://fhir.caredove.com/api/FHIR4_v1/HealthcareService/16770" />
        </performer>
        <reasonCode>
          <text value="Reason for referral narrative goes here" />
        </reasonCode>
        <note>
          <text value="Allergies: Penicillin &#xA;Food Allergies: Peanuts" />
        </note>
        <note>
          <text value="Social History: History of family conflict &#xA;low social interaction" />
        </note>
      </ServiceRequest>
    </resource>
    <request>
      <method value="POST" />
      <url value="ServiceRequest" />
    </request>
  </entry>
  <entry>
    <resource>
      <Patient>
        <id value="uuid-1" />
        <identifier>
          <extension url="https://www.caredove.com/FHIR3/StructureDefinition/caredove-healthcardversion">
            <valueString value="H" />
          </extension>
          <type>
            <coding>
              <system value="http://hl7.org/fhir/v2/0203" />
              <code value="JHN" />
            </coding>
            <text value="Ontario PHN" />
          </type>
          <system value="http://ehealthontario.ca/API/FHIR/NamingSystem/ca-on-patient-hcn" />
          <value value="4455 044 033" />
        </identifier>
        <identifier>
          <type>
            <text value="Student Card #" />
          </type>
          <value value="3699098" />
        </identifier>
        <name>
          <family value="O'Subject" />
          <given value="Patty" />
          <given value="Atient" />
        </name>
        <telecom>
          <system value="phone" />
          <value value="(555) 111-1111 x1ARY" />
          <use value="mobile" />
          <rank value="1" />
        </telecom>
        <telecom>
          <system value="phone" />
          <value value="(555) 222-2222 x2ARY" />
          <rank value="2" />
        </telecom>
        <telecom>
          <system value="email" />
          <value value="testpatient@caredove.com" />
        </telecom>
        <gender value="male" />
        <birthDate value="1928-06-29" />
        <address>
          <use value="home" />
          <type value="physical" />
          <line value="Unit 2" />
          <line value="50 Albert St." />
          <city value="Waterloo" />
          <state value="ON" />
          <postalCode value="K8N 1N1" />
          <country value="Can" />
        </address>
        <maritalStatus>
          <coding>
            <code value="M" />
            <display value="Married" />
          </coding>
          <text value="Married" />
        </maritalStatus>
        <contact>
          <relationship>
            <text value="Emergency Contact" />
          </relationship>
          <name>
            <family value="McContact" />
            <given value="Shemergency" />
            <given value="David" />
          </name>
          <telecom>
            <system value="phone" />
            <value value="(555) 111-1111 xEM1ARY" />
            <use value="mobile" />
            <rank value="1" />
          </telecom>
          <telecom>
            <system value="phone" />
            <value value="(555) 222-2222 xEM2ARY" />
            <rank value="2" />
          </telecom>
          <telecom>
            <system value="email" />
            <value value="testcontact@caredove.com" />
          </telecom>
          <address>
            <use value="home" />
            <type value="physical" />
            <line value="Unit 2" />
            <line value="50 Albert St." />
            <city value="Waterloo" />
            <state value="ON" />
            <postalCode value="32819" />
            <country value="Can" />
          </address>
          <gender value="female" />
        </contact>
        <communication>
          <language>
            <coding>
              <code value="en" />
              <display value="English" />
            </coding>
            <text value="English" />
          </language>
          <preferred value="true" />
        </communication>
        <generalPractitioner>
          <reference value="PractitionerRole/uuid-3a" />
        </generalPractitioner>
      </Patient>
    </resource>
    <request>
      <method value="POST" />
      <url value="Patient" />
    </request>
  </entry>
  <entry>
    <resource>
      <PractitionerRole>
        <id value="uuid-2a" />
        <practitioner>
          <reference value="Practitioner/uuid-2b" />
          <display value="Requesty McSenderson" />
        </practitioner>
        <organization>
          <reference value="Organization/uuid-2c" />
          <display value="North Sender Clinic" />
        </organization>
        <code>
          <text value="Community Case Manager" />
        </code>
        <location>
          <reference value="Location/uuid-2d" />
          <display value="Suite 11, 11 King st. West, Kitchener, ON, Can" />
        </location>
        <telecom>
          <system value="phone" />
          <value value="(555) 111-1111" />
          <use value="work" />
        </telecom>
        <telecom>
          <system value="email" />
          <value value="testsender@caredove.com" />
          <use value="work" />
        </telecom>
      </PractitionerRole>
    </resource>
    <request>
      <method value="POST" />
      <url value="PractitionerRole" />
    </request>
  </entry>
  <entry>
    <resource>
      <Practitioner>
        <id value="uuid-2b" />
        <name>
          <family value="McSenderson" />
          <given value="Requesty" />
        </name>
      </Practitioner>
    </resource>
    <request>
      <method value="POST" />
      <url value="Practitioner" />
    </request>
  </entry>
  <entry>
    <resource>
      <Organization>
        <id value="uuid-2c" />
        <type>
          <coding>
            <system value="http://hl7.org/fhir/ValueSet/organization-type" />
            <version value="3.5.0" />
            <code value="prov" />
            <display value="Healthcare Provider" />
          </coding>
        </type>
        <name value="North Sender Clinic" />
      </Organization>
    </resource>
    <request>
      <method value="POST" />
      <url value="Organization" />
    </request>
  </entry>
  <entry>
    <resource>
      <Location>
        <id value="uuid-2d" />
        <name value="Downtown Sender Hub" />
        <address>
          <use value="work" />
          <type value="physical" />
          <line value="Suite 11" />
          <line value="11 King st. West" />
          <city value="Kitchener" />
          <state value="ON" />
          <postalCode value="N2L 1T1" />
          <country value="Can" />
        </address>
      </Location>
    </resource>
    <request>
      <method value="POST" />
      <url value="Location" />
    </request>
  </entry>
  <entry>
    <resource>
      <PractitionerRole>
        <id value="uuid-3a" />
        <practitioner>
          <reference value="Practitioner/uuid-3b" />
          <display value="Dr. Prim Caredove" />
        </practitioner>
        <organization>
          <reference value="Organization/uuid-3c" />
          <display value="Star Family Health Team" />
        </organization>
        <specialty>
          <coding>
            <system value="http://hl7.org/fhir/ValueSet/c80-practice-codes" />
            <version value="20091109" />
            <code value="419772000" />
            <display value="Family practice" />
          </coding>
        </specialty>
        <location>
          <reference value="Location/uuid-3d" />
          <display value="22 Weber st. East, Kitchener ON, Can" />
        </location>
        <telecom>
          <system value="phone" />
          <value value="(555) 222-2222" />
          <use value="work" />
        </telecom>
        <telecom>
          <system value="email" />
          <value value="familydoc@caredove.com" />
          <use value="work" />
        </telecom>
      </PractitionerRole>
    </resource>
    <request>
      <method value="POST" />
      <url value="PractitionerRole" />
    </request>
  </entry>
  <entry>
    <resource>
      <Practitioner>
        <id value="uuid-3b" />
        <name>
          <family value="Caredoc" />
          <given value="Dr. Prim" />
        </name>
      </Practitioner>
    </resource>
    <request>
      <method value="POST" />
      <url value="Practitioner" />
    </request>
  </entry>
  <entry>
    <resource>
      <Organization>
        <id value="uuid-3c" />
        <type>
          <coding>
            <system value="http://hl7.org/fhir/ValueSet/organization-type" />
            <version value="3.5.0" />
            <code value="prov" />
            <display value="Healthcare Provider" />
          </coding>
        </type>
        <name value="Star Family Health Team" />
      </Organization>
    </resource>
    <request>
      <method value="POST" />
      <url value="Organization" />
    </request>
  </entry>
  <entry>
    <resource>
      <Location>
        <id value="uuid-3d" />
        <name value="West Side GP Office" />
        <address>
          <use value="work" />
          <type value="physical" />
          <line value="22 Weber st. East" />
          <city value="Kitchener" />
          <state value="ON" />
          <postalCode value="N2L 2T2" />
          <country value="Can" />
        </address>
      </Location>
    </resource>
    <request>
      <method value="POST" />
      <url value="Location" />
    </request>
  </entry>
</Bundle>