{
  "resourceType" : "OperationDefinition",
  "id" : "ahd-complete",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition ahd-complete</b></p><a name=\"ahd-complete\"> </a><a name=\"hcahd-complete\"> </a><p>URL: [base]/QuestionnaireResponse/$complete</p><p>URL: [base]/QuestionnaireResponse/[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>0..1</td><td><a href=\"http://hl7.org/fhir/R5/binary.html\">Binary</a></td><td/><td><div><p>Digitally signed PET (ASiC-E container) as a Binary resource.</p>\n</div></td></tr><tr><td>IN</td><td>bundle</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/bundle.html\">Bundle</a></td><td/><td><div><p>Collection Bundle with the QuestionnaireResponse and the paper-signing Provenance.</p>\n</div></td></tr><tr><td>OUT</td><td>questionnaireResponse</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 PET version.</p>\n</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>\n</div></td></tr><tr><td>OUT</td><td>signedBinary</td><td/><td>0..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 (digital signing only).</p>\n</div></td></tr></table></div>"
  },
  "url" : "https://fhir.ee/ahd/OperationDefinition/ahd-complete",
  "version" : "0.1.0",
  "name" : "AHDQuestionnaireResponseComplete",
  "title" : "PET confirmation ($complete)",
  "status" : "active",
  "kind" : "operation",
  "experimental" : false,
  "date" : "2026-09-04T09:27:54+00:00",
  "publisher" : "TEHIK",
  "contact" : [{
    "name" : "TEHIK",
    "telecom" : [{
      "system" : "url",
      "value" : "https://tehik.ee"
    },
    {
      "system" : "email",
      "value" : "abi@tehik.ee"
    }]
  }],
  "description" : "UC-AHD-055: confirms a patient's end-of-life directive (PET). Input is exactly one of: a digitally signed PET as a Binary (signedBinary) or a QuestionnaireResponse and Provenance collection Bundle for paper signing (bundle). Under the stage-1 mock configuration, the digital path parses the ASiC-E container without DigiDoc signature verification and stores it locally instead of DRIT. Where digital signing is not enabled, the digital path responds with HTTP 501.",
  "affectsState" : true,
  "code" : "complete",
  "resource" : ["QuestionnaireResponse"],
  "system" : false,
  "type" : true,
  "instance" : true,
  "parameter" : [{
    "name" : "signedBinary",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Digitally signed PET (ASiC-E container) as a Binary resource.",
    "type" : "Binary"
  },
  {
    "name" : "bundle",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Collection Bundle with the QuestionnaireResponse and the paper-signing Provenance.",
    "type" : "Bundle"
  },
  {
    "name" : "questionnaireResponse",
    "use" : "out",
    "min" : 1,
    "max" : "1",
    "documentation" : "Reference to the stored PET version.",
    "type" : "Reference"
  },
  {
    "name" : "provenance",
    "use" : "out",
    "min" : 1,
    "max" : "1",
    "documentation" : "Reference to the stored signing Provenance.",
    "type" : "Reference"
  },
  {
    "name" : "signedBinary",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "documentation" : "Reference to the stored signed Binary (digital signing only).",
    "type" : "Reference"
  }]
}