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

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="patient-resolve-reference"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition patient-resolve-reference</b></p><a name="patient-resolve-reference"> </a><a name="hcpatient-resolve-reference"> </a><p>URL: [base]/Patient/$resolve-reference</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>identifier</td><td/><td>1..*</td><td><a href="http://hl7.org/fhir/R5/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>Patient identifier to resolve. At least one is required, and system and value are mandatory. identifier.system must be a code of the https://fhir.ee/ValueSet/patsiendi-identifikaatorite-domeen value set, or the value of that code's oid property. At most 100 identifiers per request.</p>
</div></td></tr><tr><td>OUT</td><td>match</td><td/><td>1..*</td><td/><td/><td><div><p>Result for each submitted identifier. Contains either <code>patient</code> or <code>issue</code>. Clients should pair results with the request by <code>match.identifier</code>.</p>
</div></td></tr><tr><td>OUT</td><td>match.identifier</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R5/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>Identifier as submitted in the request.</p>
</div></td></tr><tr><td>OUT</td><td>match.patient</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R5/references.html#Reference">Reference</a> (<a href="StructureDefinition-ee-mpi-patient.html" title="https://fhir.ee/mpi/StructureDefinition/ee-mpi-patient">EE MPI Patient</a>)</td><td/><td><div><p>Reference to the found patient.</p>
</div></td></tr><tr><td>OUT</td><td>match.issue</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R5/operationoutcome.html">OperationOutcome</a></td><td/><td><div><p>OperationOutcome for this identifier: warning if patient not found, error if identifier.system is not allowed.</p>
</div></td></tr></table><div><p>Only POST is supported. identifier.system must be a code of the patsiendi-identifikaatorite-domeen value set, or the value of that code's oid property. An identifier without system or value fails the whole request. If the total number of identifiers exceeds 100, the whole request fails. An invalid system is returned in match.issue. Per-identifier issues do not fail the request: the response is HTTP 200 with a Parameters resource, even if every identifier has an issue.</p>
</div></div>
  </text>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="1"/>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use"/>
  </extension>
  <url value="https://fhir.ee/mpi/OperationDefinition/patient-resolve-reference"/>
  <version value="1.5.0"/>
  <name value="EEMPIPatientResolveReference"/>
  <title value="Resolve Patient Reference"/>
  <status value="active"/>
  <kind value="operation"/>
  <experimental value="false"/>
  <date value="2026-09-30T10:44:40+00:00"/>
  <publisher value="TEHIK"/>
  <contact>
    <name value="TEHIK"/>
    <telecom>
      <system value="url"/>
      <value value="https://tehik.ee"/>
    </telecom>
  </contact>
  <description value="Resolves patient identifiers to MPI Patient references."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="EE"/>
      <display value="Estonia"/>
    </coding>
  </jurisdiction>
  <affectsState value="false"/>
  <code value="resolve-reference"/>
  <comment value="Only POST is supported. identifier.system must be a code of the patsiendi-identifikaatorite-domeen value set, or the value of that code's oid property. An identifier without system or value fails the whole request. If the total number of identifiers exceeds 100, the whole request fails. An invalid system is returned in match.issue. Per-identifier issues do not fail the request: the response is HTTP 200 with a Parameters resource, even if every identifier has an issue."/>
  <resource value="Patient"/>
  <system value="false"/>
  <type value="true"/>
  <instance value="false"/>
  <parameter>
    <name value="identifier"/>
    <use value="in"/>
    <min value="1"/>
    <max value="*"/>
    <documentation value="Patient identifier to resolve. At least one is required, and system and value are mandatory. identifier.system must be a code of the https://fhir.ee/ValueSet/patsiendi-identifikaatorite-domeen value set, or the value of that code's oid property. At most 100 identifiers per request."/>
    <type value="Identifier"/>
  </parameter>
  <parameter>
    <name value="match"/>
    <use value="out"/>
    <min value="1"/>
    <max value="*"/>
    <documentation value="Result for each submitted identifier. Contains either `patient` or `issue`. Clients should pair results with the request by `match.identifier`."/>
    <part>
      <name value="identifier"/>
      <use value="out"/>
      <min value="1"/>
      <max value="1"/>
      <documentation value="Identifier as submitted in the request."/>
      <type value="Identifier"/>
    </part>
    <part>
      <name value="patient"/>
      <use value="out"/>
      <min value="0"/>
      <max value="1"/>
      <documentation value="Reference to the found patient."/>
      <type value="Reference"/>
      <targetProfile value="https://fhir.ee/mpi/StructureDefinition/ee-mpi-patient"/>
    </part>
    <part>
      <name value="issue"/>
      <use value="out"/>
      <min value="0"/>
      <max value="1"/>
      <documentation value="OperationOutcome for this identifier: warning if patient not found, error if identifier.system is not allowed."/>
      <type value="OperationOutcome"/>
    </part>
  </parameter>
</OperationDefinition>