<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="ppr-Location-match" />
  <url value="https://ehealthontario.ca/fhir/OperationDefinition/pcr-Location-match" />
  <name value="EMPILocationMatch" />
  <status value="draft" />
  <kind value="operation" />
  <date value="2021-07-09T01:45:48+00:00" />
  <publisher value="Ontario Health" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://ontariohealth.ca" />
    </telecom>
  </contact>
  <description value="This operation is a adaptation of the FHIR R4 Patient match operation, for use with the Location resources.  The operation takes a Parameters instance containing a single candidate Location resource populated with the characteristics of the location being searched for. The data provided is interpreted as an MPI input and  passed to an MPI algorithm of some kind that uses them to determine the most appropriate matches in the location set.  These matches may not result in an exact match of all specified criteria.  Allowances are made for variations in spelling as well as potential data entry errors.  The complete set of specified criteria are evaluated as a whole to deterimine the likelihood of each candidate location being a match.  The operation can only be invoked by POST with the Parameters resource (with inline Location resource instance) sent as the HTTP body." />
  <code value="match" />
  <comment value="The response from an &quot;mpi&quot; query is a bundle containing location records, ordered from most likely to least likely. If there are no location matches, the MPI SHALL return an empty search set with no error, but may include an operation outcome with further advice regarding location selection. All location records SHALL have a search score from 0 to 1, where 1 is the most certain match that indicates the MPI's position on the match quality." />
  <system value="false" />
  <type value="true" />
  <instance value="false" />
  <parameter>
    <name value="Location" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="Use this to provide an entire set of location details for the MPI to match against (e.g. POST a parameters instance containing the location record to Location/$match)." />
    <type value="canonical" />
    <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-ppr-location-matchreq-profile-Location|1.0.0" />
  </parameter>
  <parameter>
    <name value="count" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="The maximum number of records to return. If no value is provided, the server decides how many matches to return. Note that clients should be careful when using this, as it may prevent probable - and valid - matches from being returned" />
    <type value="integer" />
  </parameter>
  <parameter>
    <name value="return" />
    <use value="out" />
    <min value="1" />
    <max value="1" />
    <documentation value="A bundle contain a set of location records that represent possible matches" />
    <type value="canonical" />
    <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-ppr-location-response-profile-Bundle|1.0.0" />
  </parameter>
</OperationDefinition>