{
  "resourceType" : "OperationDefinition",
  "id" : "Immunization-upsert",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition Immunization-upsert</b></p><a name=\"Immunization-upsert\"> </a><a name=\"hcImmunization-upsert\"> </a><p>URL: [base]/Immunization/$upsert</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>immunization</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/immunization.html\">Immunization</a></td><td/><td><div><p>The Immunization resource to be either updated (if an algorithmic match is found) or inserted (if no match is found) into ImmSOT.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/immunization.html\">Immunization</a></td><td/><td><div><p>The updated or created immunisation event (as an Immunization resource).</p>\n</div></td></tr><tr><td>OUT</td><td>failure</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>Error response</p>\n</div></td></tr></table></div>"
  },
  "url" : "https://standards.digital.health.nz/fhir/air/OperationDefinition/immunization-upsert",
  "version" : "2.7.0",
  "name" : "UpsertImmunisationEvent",
  "title" : "Upsert Immunisation Event",
  "status" : "active",
  "kind" : "operation",
  "experimental" : false,
  "date" : "2026-07-20T21:32:10+00:00",
  "publisher" : "Te Whatu Ora",
  "contact" : [{
    "name" : "Te Whatu Ora",
    "telecom" : [{
      "system" : "url",
      "value" : "https://tewhatuora.govt.nz"
    }]
  }],
  "description" : "Upsert an immunisation event based on a matching algorithm.",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "urn:iso:std:iso:3166",
      "code" : "US",
      "display" : "New Zealand"
    }]
  }],
  "affectsState" : true,
  "code" : "upsert",
  "resource" : ["Immunization"],
  "system" : false,
  "type" : true,
  "instance" : false,
  "parameter" : [{
    "name" : "immunization",
    "use" : "in",
    "min" : 1,
    "max" : "1",
    "documentation" : "The Immunization resource to be either updated (if an algorithmic match is found) or inserted (if no match is found) into ImmSOT.",
    "type" : "Immunization"
  },
  {
    "name" : "return",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "documentation" : "The updated or created immunisation event (as an Immunization resource).",
    "type" : "Immunization"
  },
  {
    "name" : "failure",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "documentation" : "Error response",
    "type" : "OperationOutcome"
  }]
}