<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="hn-basis-AppointmentResponse" />
  <url value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-AppointmentResponse" />
  <version value="1.0.1" />
  <name value="HnBasisAppointmentResponse" />
  <title value="hn-basis-AppointmentResponse" />
  <status value="draft" />
  <description value="Basisprofil for AppointmentResponse used in 'ny timeløsning'." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="AppointmentResponse" />
  <baseDefinition value="http://hl7.no/fhir/StructureDefinition/no-basis-AppointmentResponse" />
  <derivation value="constraint" />
  <differential>
    <element id="AppointmentResponse.extension:changeConferenceType">
      <path value="AppointmentResponse.extension" />
      <sliceName value="changeConferenceType" />
      <definition value="Patient can ask for anouther type of conference" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-changeConferenceType" />
      </type>
    </element>
    <element id="AppointmentResponse.extension:changeConferenceType.value[x]">
      <path value="AppointmentResponse.extension.value[x]" />
      <definition value="Type of conference that Patient askes for" />
    </element>
    <element id="AppointmentResponse.identifier">
      <path value="AppointmentResponse.identifier" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="AppointmentResponse.identifier.system">
      <path value="AppointmentResponse.identifier.system" />
      <min value="1" />
    </element>
    <element id="AppointmentResponse.identifier.value">
      <path value="AppointmentResponse.identifier.value" />
      <min value="1" />
    </element>
    <element id="AppointmentResponse.appointment.reference">
      <path value="AppointmentResponse.appointment.reference" />
      <max value="0" />
    </element>
    <element id="AppointmentResponse.participantType.coding">
      <path value="AppointmentResponse.participantType.coding" />
      <constraint>
        <key value="inv-4" />
        <severity value="error" />
        <human value="If code is used in a codable consept the system must be used" />
        <expression value="code &gt; '' implies (system &gt; '' )" />
        <source value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-AppointmentResponse" />
      </constraint>
    </element>
    <element id="AppointmentResponse.actor">
      <path value="AppointmentResponse.actor" />
      <short value="Use only logical reference" />
      <definition value="Only use of logical reference is allowed for reference to an patient in this profile" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="AppointmentResponse.actor.reference">
      <path value="AppointmentResponse.actor.reference" />
      <max value="0" />
    </element>
    <element id="AppointmentResponse.actor.type">
      <path value="AppointmentResponse.actor.type" />
      <min value="1" />
      <patternUri value="Patient" />
    </element>
    <element id="AppointmentResponse.actor.identifier">
      <path value="AppointmentResponse.actor.identifier" />
      <min value="1" />
      <constraint>
        <key value="inv-a" />
        <severity value="error" />
        <human value="Only urn:oid:2.16.578.1.12.4.1.4.1 (FNR) or urn:oid:2.16.578.1.12.4.1.4.2 (DNR) are allowed as systems to identify patient in this profile." />
        <expression value="system = 'urn:oid:2.16.578.1.12.4.1.4.1' or system = 'urn:oid:2.16.578.1.12.4.1.4.2'" />
        <source value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-AppointmentResponse" />
      </constraint>
    </element>
    <element id="AppointmentResponse.actor.identifier.type.coding">
      <path value="AppointmentResponse.actor.identifier.type.coding" />
      <constraint>
        <key value="inv-3" />
        <severity value="error" />
        <human value="Only FNR or DNR number are allowed as codes to identify patient in this profile." />
        <expression value="code = 'FNR' or code = 'DNR'" />
        <source value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-AppointmentResponse" />
      </constraint>
    </element>
    <element id="AppointmentResponse.actor.identifier.system">
      <path value="AppointmentResponse.actor.identifier.system" />
      <min value="1" />
    </element>
    <element id="AppointmentResponse.actor.identifier.value">
      <path value="AppointmentResponse.actor.identifier.value" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>