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

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="ahd-task-complete"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition ahd-task-complete</b></p><a name="ahd-task-complete"> </a><a name="hcahd-task-complete"> </a><p>URL: [base]/Task/[id]/$complete</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>signedBinary</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R5/binary.html">Binary</a></td><td/><td><div><p>Digitally signed trusted person (ASiC-E container) as a Binary resource.</p>
</div></td></tr><tr><td>OUT</td><td>task</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R5/references.html#Reference">Reference</a></td><td/><td><div><p>Reference to the completed invitation (Task) version.</p>
</div></td></tr><tr><td>OUT</td><td>relatedPerson</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R5/references.html#Reference">Reference</a></td><td/><td><div><p>Reference to the confirmed trusted person (RelatedPerson) version.</p>
</div></td></tr><tr><td>OUT</td><td>provenance</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R5/references.html#Reference">Reference</a></td><td/><td><div><p>Reference to the stored signing Provenance.</p>
</div></td></tr><tr><td>OUT</td><td>signedBinary</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R5/references.html#Reference">Reference</a></td><td/><td><div><p>Reference to the stored signed Binary (the ASiC-E container).</p>
</div></td></tr></table></div>
  </text>
  <url value="https://fhir.ee/ahd/OperationDefinition/ahd-task-complete"/>
  <version value="0.1.0"/>
  <name value="AHDTrusteeInvitationComplete"/>
  <title value="Trusted person invitation acceptance ($complete)"/>
  <status value="draft"/>
  <kind value="operation"/>
  <experimental value="false"/>
  <date value="2026-09-04T09:27:54+00:00"/>
  <publisher value="TEHIK"/>
  <contact>
    <name value="TEHIK"/>
    <telecom>
      <system value="url"/>
      <value value="https://tehik.ee"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="abi@tehik.ee"/>
    </telecom>
  </contact>
  <description value="UC-AHD-060: the invitation recipient accepts the trusted person invitation with a digitally signed RelatedPerson (ASiC-E container). Under the stage-1 mock configuration, the operation parses the container without DigiDoc signature verification and stores it locally instead of DRIT. Where digital signing is not enabled, the operation responds with HTTP 501."/>
  <affectsState value="true"/>
  <code value="complete"/>
  <resource value="Task"/>
  <system value="false"/>
  <type value="false"/>
  <instance value="true"/>
  <parameter>
    <name value="signedBinary"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Digitally signed trusted person (ASiC-E container) as a Binary resource."/>
    <type value="Binary"/>
  </parameter>
  <parameter>
    <name value="task"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Reference to the completed invitation (Task) version."/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="relatedPerson"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Reference to the confirmed trusted person (RelatedPerson) version."/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="provenance"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Reference to the stored signing Provenance."/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="signedBinary"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Reference to the stored signed Binary (the ASiC-E container)."/>
    <type value="Reference"/>
  </parameter>
</OperationDefinition>