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

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="search-from-Kanta"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition search-from-Kanta</b></p><a name="search-from-Kanta"> </a><a name="hcsearch-from-Kanta"> </a><p>URL: [base]/Appointment/$search-from-Kanta</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>patientIdentifier</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>patient.identifier - Identifier of the patient who is the subject of the appointment.</p>
</div></td></tr><tr><td>IN</td><td>identifier</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>appointment.identifier - Business identifier of the appointment.</p>
</div></td></tr><tr><td>IN</td><td>serviceOrganiser</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Provenance.agent.who.identifier - Organiser of the booked service.</p>
</div></td></tr><tr><td>IN</td><td>appointmentServiceProvider</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>organization.partOf.identifier - Provider of the booked service. For social and health care organizations, the Kanta code system '1.2.246.537.6.202.2008' and a valid code value should be provided. For independent practitioners, use Kanta code system '1.2.246.537.6.203.2014'.</p>
</div></td></tr><tr><td>IN</td><td>appointmentServiceProviderUnit</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>organization.identifier - Organization where the booked service takes place. For social and health care organizations, the Kanta code system '1.2.246.537.6.202.2008' and a valid code should be provided. For independent practitioners, use Kanta code system '1.2.246.537.6.203.2014'.</p>
</div></td></tr><tr><td>IN</td><td>producingServiceProviderUnit</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Provenance.agent.who.identifier - Organization that produced the Appointment resource. If this parameter is provided, the service provider parameter 'appointment-service-provider' must also be provided (in addition to the patient identifier). For social and health care organizations, the Kanta code system '1.2.246.537.6.202.2008' and a valid code should be provided. For independent practitioners, use Kanta code system '1.2.246.537.6.203.2014'.</p>
</div></td></tr><tr><td>IN</td><td>date</td><td/><td>0..2</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>appointment.start – Start time of the appointment. The accepted date formats are yyyy-mm-dd, yyyy-mm-ddThh:mm:ss or yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm]. A value entered without a time zone is treated as the Helsinki time zone. Mandatory prefix options include eq, gt, lt, ge, le. When two dates are provided, they must not include the eq prefix. The eq prefix can only be used with a single date.</p>
</div></td></tr><tr><td>IN</td><td>recorded</td><td/><td>0..2</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>provenance.recorded - Creation time of the appointment, i.e. the moment when the Appointment resource was created. The accepted date formats are yyyy-mm-dd, yyyy-mm-ddThh:mm:ss or yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm]. A value entered without a time zone is treated as the Helsinki time zone. Mandatory prefix options include eq, gt, lt, ge, le. When two recorded are provided, they must not include the eq prefix. The eq prefix can only be used with a single recorded.</p>
</div></td></tr><tr><td>IN</td><td>registerTypeCode</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>provenance.extension.RegisterType - Patient register identifier.</p>
</div></td></tr><tr><td>IN</td><td>serviceEvent</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>provenance.extension.ServiceEvent - Service event identifier used as a search filter.</p>
</div></td></tr><tr><td>IN</td><td>disclosureServiceEventId</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>Disclosure service event identifier. This parameter must be provided if performing a disclosure search.</p>
</div></td></tr><tr><td>IN</td><td>includeOwn</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#boolean">boolean</a></td><td/><td><div><p>Whether the search result should return data from the inquirer’s own register or exclude it (default: true).</p>
</div></td></tr><tr><td>IN</td><td>count</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#integer">integer</a></td><td/><td><div><p>Maximum number of search results to return in one response. When continuing a paged search, provide resultSetKey and originalXRequestId along with the same count value as in the previous search request.</p>
</div></td></tr><tr><td>IN</td><td>resultSetKey</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>Result set identifier used for continuing a paged appointment search. This parameter must be provided together with originalXRequestId and count. Omit both resultSetKey and originalXRequestId when starting a new search.</p>
</div></td></tr><tr><td>IN</td><td>originalXRequestId</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>Original X-Request-ID used for continuing a paged appointment search. This parameter must be provided together with resultSetKey and count. Omit both resultSetKey and originalXRequestId when starting a new search.</p>
</div></td></tr><tr><td>IN</td><td>confirmed-protected-content</td><td/><td>0..*</td><td/><td/><td><div><p>Codes of protected contents views that are included in the search result, and information on whether viewing the protected content has been confirmed automatically. The user must be asked for separate confirmation before showing protected content unless viewing that content has been separately defined as part of the user's work tasks.</p>
</div></td></tr><tr><td>IN</td><td>confirmed-protected-content.content</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td><a href="ValueSet-fipta-vs-tableofcontentsprotected.html">fipta-vs-tableofcontentsprotected</a> (Required)</td><td><div><p>The value must be from ValueSet fipta-vs-tableofcontentsprotected.</p>
</div></td></tr><tr><td>IN</td><td>confirmed-protected-content.automatic</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#boolean">boolean</a></td><td/><td><div><p>Whether viewing the protected content has been confirmed automatically without asking the user. The default value is false.</p>
</div></td></tr><tr><td>IN</td><td>confirmed-protected-content.reason</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>Optional free-text reason for showing the protected content.</p>
</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/bundle.html">Bundle</a></td><td/><td><div><p>Appointment and Provenance (appointment meta information) resource pairs that matched the given search parameters. If search results were filtered because of protected content, the response Bundle also contains an OperationOutcome that describes which protected table of contents views were omitted from the result.</p>
</div></td></tr></table></div>
  </text>
  <url value="https://eradocumentation.atostek.com/OperationDefinition/Appointment-search-from-Kanta"/>
  <version value="1.0.0"/>
  <name value="search-from-Kanta"/>
  <title value="AppointmentFi Search From Kanta"/>
  <status value="draft"/>
  <kind value="operation"/>
  <date value="2026-10-28T11:52:12+00:00"/>
  <publisher value="Atostek"/>
  <contact>
    <name value="Atostek"/>
    <telecom>
      <system value="url"/>
      <value value="https://atostek.com/"/>
    </telecom>
  </contact>
  <description value="The operation can be used to search for appointments from the Kanta Patient Data Repository. &#xA;&#xA;The operation requires an active ERA session and the client registry ID. Please provide these in the request header."/>
  <code value="search-from-Kanta"/>
  <resource value="Appointment"/>
  <system value="false"/>
  <type value="true"/>
  <instance value="false"/>
  <parameter>
    <name value="patientIdentifier"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="patient.identifier - Identifier of the patient who is the subject of the appointment."/>
    <type value="Identifier"/>
  </parameter>
  <parameter>
    <name value="identifier"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="appointment.identifier - Business identifier of the appointment."/>
    <type value="Identifier"/>
  </parameter>
  <parameter>
    <name value="serviceOrganiser"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Provenance.agent.who.identifier - Organiser of the booked service."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="appointmentServiceProvider"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="organization.partOf.identifier - Provider of the booked service. For social and health care organizations, the Kanta code system '1.2.246.537.6.202.2008' and a valid code value should be provided. For independent practitioners, use Kanta code system '1.2.246.537.6.203.2014'."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="appointmentServiceProviderUnit"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="organization.identifier - Organization where the booked service takes place. For social and health care organizations, the Kanta code system '1.2.246.537.6.202.2008' and a valid code should be provided. For independent practitioners, use Kanta code system '1.2.246.537.6.203.2014'."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="producingServiceProviderUnit"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Provenance.agent.who.identifier - Organization that produced the Appointment resource. If this parameter is provided, the service provider parameter 'appointment-service-provider' must also be provided (in addition to the patient identifier). For social and health care organizations, the Kanta code system '1.2.246.537.6.202.2008' and a valid code should be provided. For independent practitioners, use Kanta code system '1.2.246.537.6.203.2014'."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="date"/>
    <use value="in"/>
    <min value="0"/>
    <max value="2"/>
    <documentation value="appointment.start – Start time of the appointment. The accepted date formats are yyyy-mm-dd, yyyy-mm-ddThh:mm:ss or yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm]. A value entered without a time zone is treated as the Helsinki time zone. Mandatory prefix options include eq, gt, lt, ge, le. When two dates are provided, they must not include the eq prefix. The eq prefix can only be used with a single date."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="recorded"/>
    <use value="in"/>
    <min value="0"/>
    <max value="2"/>
    <documentation value="provenance.recorded - Creation time of the appointment, i.e. the moment when the Appointment resource was created. The accepted date formats are yyyy-mm-dd, yyyy-mm-ddThh:mm:ss or yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm]. A value entered without a time zone is treated as the Helsinki time zone. Mandatory prefix options include eq, gt, lt, ge, le. When two recorded are provided, they must not include the eq prefix. The eq prefix can only be used with a single recorded."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="registerTypeCode"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="provenance.extension.RegisterType - Patient register identifier."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="serviceEvent"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="provenance.extension.ServiceEvent - Service event identifier used as a search filter."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="disclosureServiceEventId"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Disclosure service event identifier. This parameter must be provided if performing a disclosure search."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="includeOwn"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Whether the search result should return data from the inquirer’s own register or exclude it (default: true)."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="count"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Maximum number of search results to return in one response. When continuing a paged search, provide resultSetKey and originalXRequestId along with the same count value as in the previous search request."/>
    <type value="integer"/>
  </parameter>
  <parameter>
    <name value="resultSetKey"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Result set identifier used for continuing a paged appointment search. This parameter must be provided together with originalXRequestId and count. Omit both resultSetKey and originalXRequestId when starting a new search."/>
    <type value="Identifier"/>
  </parameter>
  <parameter>
    <name value="originalXRequestId"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Original X-Request-ID used for continuing a paged appointment search. This parameter must be provided together with resultSetKey and count. Omit both resultSetKey and originalXRequestId when starting a new search."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="confirmed-protected-content"/>
    <use value="in"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Codes of protected contents views that are included in the search result, and information on whether viewing the protected content has been confirmed automatically. The user must be asked for separate confirmation before showing protected content unless viewing that content has been separately defined as part of the user's work tasks."/>
    <part>
      <name value="content"/>
      <use value="in"/>
      <min value="1"/>
      <max value="1"/>
      <documentation value="The value must be from ValueSet fipta-vs-tableofcontentsprotected."/>
      <type value="Coding"/>
      <binding>
        <strength value="required"/>
        <valueSet value="https://pta.kanta.fi/fhir/ValueSet/fipta-vs-tableofcontentsprotected"/>
      </binding>
    </part>
    <part>
      <name value="automatic"/>
      <use value="in"/>
      <min value="0"/>
      <max value="1"/>
      <documentation value="Whether viewing the protected content has been confirmed automatically without asking the user. The default value is false."/>
      <type value="boolean"/>
    </part>
    <part>
      <name value="reason"/>
      <use value="in"/>
      <min value="0"/>
      <max value="1"/>
      <documentation value="Optional free-text reason for showing the protected content."/>
      <type value="string"/>
    </part>
  </parameter>
  <parameter>
    <name value="return"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Appointment and Provenance (appointment meta information) resource pairs that matched the given search parameters. If search results were filtered because of protected content, the response Bundle also contains an OperationOutcome that describes which protected table of contents views were omitted from the result."/>
    <type value="Bundle"/>
  </parameter>
</OperationDefinition>