<?xml version="1.0" encoding="UTF-8"?>

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="FindAppointments"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition FindAppointments</b></p><a name="FindAppointments"> </a><a name="hcFindAppointments"> </a><p>URL: [base]/Appointment/$find</p><p>Output parameters Profile:<a href="StructureDefinition-portal-available-appointment.html">Available Appointment Portal</a></p><h3>Parameters</h3><table class="grid"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>start</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#dateTime">dateTime</a></td><td/><td><div><p>Start of the requested time window for which available appointment opportunities (slots) should be returned.
This parameter is mandatory as per IHE ITI Scheduling $find.</p>
</div></td></tr><tr><td>IN</td><td>end</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#dateTime">dateTime</a></td><td/><td><div><p>End of the requested time window for which available appointment opportunities (slots) should be returned.
This parameter is mandatory as per IHE ITI Scheduling $find.</p>
</div></td></tr><tr><td>IN</td><td>practitioner</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/references.html#Reference">Reference</a></td><td/><td><div><p>Restrict the search to Appointments where a specific Practitioner is the performer.</p>
<p>Practitioner is not exposed as a standalone API resource in WOF Portal. This parameter therefore uses a <code>Reference</code> with <code>identifier</code> populated for the logical Practitioner concept, instead of a resolvable FHIR resource reference.</p>
<p>This follows the IHE ITI-style parameter pattern where the parameter type remains <code>Reference</code>, but the logical target is carried using <code>Reference.identifier</code>.</p>
<p><strong>Reference.identifier.system:</strong> <code>https://canonical.fhir.link/servicewell/wof-portal/identifier-system/endpoint-identifier-system-for-practitioner/{endpointId}</code></p>
<p><strong>Reference.identifier.value:</strong> source-system primary key for the practitioner</p>
</div></td></tr><tr><td>IN</td><td>location</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/references.html#Reference">Reference</a> (<a href="StructureDefinition-LocationArea.html" title="http://portal.wof.purified.link/fhir/StructureDefinition/LocationArea">Location Area</a>)</td><td/><td><div><p>Restrict the search to Appointments at a specific location.</p>
<p><strong>Format:</strong> <code>Location/{id}</code></p>
<p><strong>Example:</strong> <code>?location=Location/1234</code></p>
</div></td></tr><tr><td>IN</td><td>organization</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/references.html#Reference">Reference</a></td><td/><td><div><p>Restrict the search to Appointments associated with a specific billing organization.</p>
<p>BillingOrganization is not exposed as a standalone API resource in WOF Portal. This parameter therefore uses a <code>Reference</code> with <code>identifier</code> populated for the logical BillingOrganization concept, instead of a resolvable FHIR resource reference.</p>
<p>This follows the IHE ITI -style parameter pattern where the parameter type remains <code>Reference</code>, but the logical target is carried using <code>Reference.identifier</code>.</p>
<p><strong>Reference.identifier.system:</strong> <code>https://canonical.fhir.link/servicewell/wof-portal/identifier-system/endpoint-identifier-system-for-billingorganization/{endpointId}</code></p>
<p><strong>Reference.identifier.value:</strong> source-system primary key for the billing organization</p>
</div></td></tr><tr><td>IN</td><td>visit-type</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>Restrict the search to a specific visit type (service type). In this implementation, visit-type
typically carries a WOF Connect service-type identifier (e.g., [system]|[code] where code maps to treatmentId).</p>
</div></td></tr><tr><td>IN</td><td>healthcareService</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/references.html#Reference">Reference</a> (<a href="StructureDefinition-healthcare-service-portal.html" title="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/healthcare-service-portal">HealthcareServicePortal</a>)</td><td/><td><div><p>Restrict the search to a specific HealthcareService.</p>
<p><strong>Format:</strong> <code>HealthcareService/{id}</code></p>
<p><strong>Example:</strong> <code>?healthcareService=HealthcareService/1234</code></p>
</div></td></tr><tr><td>IN</td><td>practitionerRole</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/references.html#Reference">Reference</a> (<a href="StructureDefinition-practitioner-role-portal.html" title="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/practitioner-role-portal">PractitionerRolePortal</a>)</td><td/><td><div><p>Restrict the search to a specific PractitionerRole.</p>
<p><strong>Format:</strong> <code>PractitionerRole/{id}</code></p>
<p><strong>Example:</strong> <code>?practitionerRole=PractitionerRole/1234</code></p>
</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/bundle.html">Bundle</a> (<a href="StructureDefinition-portal-find-appointment-bundle.html" title="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/portal-find-appointment-bundle">Portal Find Appointment response</a>)</td><td/><td><div><p>On success, returns a Bundle that SHALL conform to ihe-sched-avail-bundle, containing the resulting Appointment:</p>
<ul>
<li>status 'proposed' for available appointment opportunities (slots)</li>
</ul>
<p>Bundels conforming to ihe-sched-avail-bundle:</p>
<ul>
<li><a href="./StructureDefinition-portal-find-appointment-bundle.html">portal-find-appointment-bundle</a><br/>
If the operation fails, an OperationOutcome is returned instead of this parameter.</li>
</ul>
</div></td></tr></table></div>
  </text>
  <url value="https://canonical.fhir.link/servicewell/wof-portal/OperationDefinition/FindAppointments"/>
  <version value="1.0.0"/>
  <name value="FindAppointments"/>
  <title value="Find Appointments (Available Slots)"/>
  <status value="active"/>
  <kind value="operation"/>
  <date value="2026-04-20T08:10:56+00:00"/>
  <publisher value="Service Well AB"/>
  <contact>
    <name value="Service Well AB"/>
    <telecom>
      <system value="url"/>
      <value value="https://servicewell.se"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="info@servicewell.se"/>
    </telecom>
  </contact>
  <contact>
    <name value="Service well"/>
    <telecom>
      <system value="email"/>
      <value value="info@servicewell.se"/>
      <use value="work"/>
    </telecom>
  </contact>
  <description value="Finds available appointment opportunities (slots) and returns them as proposed Appointments.&#xA;&#xA;This operation corresponds to the IHE ITI Scheduling $find operation and returns&#xA;a Bundle of Appointment resources conforming to the IHE Scheduled Availability Bundle profile."/>
  <affectsState value="false"/>
  <code value="find"/>
  <base value="https://profiles.ihe.net/ITI/Scheduling/OperationDefinition/appointment-find"/>
  <resource value="Appointment"/>
  <system value="false"/>
  <type value="true"/>
  <instance value="false"/>
  <outputProfile value="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/portal-available-appointment"/>
  <parameter>
    <name value="start"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Start of the requested time window for which available appointment opportunities (slots) should be returned.&#xA;This parameter is mandatory as per IHE ITI Scheduling $find."/>
    <type value="dateTime"/>
  </parameter>
  <parameter>
    <name value="end"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="End of the requested time window for which available appointment opportunities (slots) should be returned.&#xA;This parameter is mandatory as per IHE ITI Scheduling $find."/>
    <type value="dateTime"/>
  </parameter>
  <parameter>
    <name value="practitioner"/>
    <use value="in"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Restrict the search to Appointments where a specific Practitioner is the performer.&#xA;&#xA;Practitioner is not exposed as a standalone API resource in WOF Portal. This parameter therefore uses a `Reference` with `identifier` populated for the logical Practitioner concept, instead of a resolvable FHIR resource reference.&#xA;&#xA;This follows the IHE ITI-style parameter pattern where the parameter type remains `Reference`, but the logical target is carried using `Reference.identifier`.&#xA;&#xA;**Reference.identifier.system:** `https://canonical.fhir.link/servicewell/wof-portal/identifier-system/endpoint-identifier-system-for-practitioner/{endpointId}`&#xA;&#xA;**Reference.identifier.value:** source-system primary key for the practitioner"/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="location"/>
    <use value="in"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Restrict the search to Appointments at a specific location.&#xA;&#xA;**Format:** `Location/{id}`  &#xA;&#xA;**Example:** `?location=Location/1234`"/>
    <type value="Reference"/>
    <targetProfile value="http://portal.wof.purified.link/fhir/StructureDefinition/LocationArea"/>
  </parameter>
  <parameter>
    <name value="organization"/>
    <use value="in"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Restrict the search to Appointments associated with a specific billing organization.&#xA;&#xA;BillingOrganization is not exposed as a standalone API resource in WOF Portal. This parameter therefore uses a `Reference` with `identifier` populated for the logical BillingOrganization concept, instead of a resolvable FHIR resource reference.&#xA;&#xA;This follows the IHE ITI -style parameter pattern where the parameter type remains `Reference`, but the logical target is carried using `Reference.identifier`.&#xA;&#xA;**Reference.identifier.system:** `https://canonical.fhir.link/servicewell/wof-portal/identifier-system/endpoint-identifier-system-for-billingorganization/{endpointId}`&#xA;&#xA;**Reference.identifier.value:** source-system primary key for the billing organization"/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="visit-type"/>
    <use value="in"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Restrict the search to a specific visit type (service type). In this implementation, visit-type&#xA;typically carries a WOF Connect service-type identifier (e.g., [system]|[code] where code maps to treatmentId)."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="healthcareService"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Restrict the search to a specific HealthcareService.&#xA;&#xA;**Format:** `HealthcareService/{id}`  &#xA;&#xA;**Example:** `?healthcareService=HealthcareService/1234`"/>
    <type value="Reference"/>
    <targetProfile value="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/healthcare-service-portal"/>
  </parameter>
  <parameter>
    <name value="practitionerRole"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Restrict the search to a specific PractitionerRole.&#xA;&#xA;**Format:** `PractitionerRole/{id}`  &#xA;&#xA;**Example:** `?practitionerRole=PractitionerRole/1234`"/>
    <type value="Reference"/>
    <targetProfile value="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/practitioner-role-portal"/>
  </parameter>
  <parameter>
    <name value="return"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="On success, returns a Bundle that SHALL conform to ihe-sched-avail-bundle, containing the resulting Appointment:&#xA;- status 'proposed' for available appointment opportunities (slots)&#xA;&#xA;Bundels conforming to ihe-sched-avail-bundle:&#xA;- [portal-find-appointment-bundle](./StructureDefinition-portal-find-appointment-bundle.html)  &#xA;If the operation fails, an OperationOutcome is returned instead of this parameter."/>
    <type value="Bundle"/>
    <targetProfile value="https://canonical.fhir.link/servicewell/wof-portal/StructureDefinition/portal-find-appointment-bundle"/>
  </parameter>
</OperationDefinition>