{
  "resourceType" : "OperationDefinition",
  "id" : "Appointment-send-message",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition Appointment-send-message</b></p><a name=\"Appointment-send-message\"> </a><a name=\"hcAppointment-send-message\"> </a><p>URL: [base]/Appointment/[id]/$send-message</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>recipient</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/references.html#Reference\">Reference</a> (<a href=\"StructureDefinition-ehealth-relatedperson.html\" title=\"http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-relatedperson\">ehealth-relatedperson</a>)</td><td/><td><div><p>The related person to receive the message. Must be listed as a participant on the target Appointment.</p>\n</div></td></tr><tr><td>IN</td><td>channel</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#code\">code</a></td><td><a href=\"ValueSet-ehealth-message-channel.html\">eHealth Message Channel</a> (Required)</td><td><div><p>The channel to use when sending the message.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/communication.html\">Communication</a></td><td/><td><div><p>The created Communication resource, conforming to the <a href=\"StructureDefinition-ehealth-message.html\">ehealth-message</a> profile. <code>Communication.status</code> is <code>completed</code> on successful dispatch or <code>stopped</code> when the downstream gateway rejected the send.</p>\n</div></td></tr></table><div><p>The following preconditions must be satisfied — otherwise the operation returns <code>HTTP 400 Bad Request</code> with an OperationOutcome describing the violated rule:</p>\n<ul>\n<li><code>Appointment.meta.profile</code> is <a href=\"StructureDefinition-ehealth-videoappointment.html\">ehealth-videoappointment</a> or <a href=\"StructureDefinition-ehealth-group-videoappointment.html\">ehealth-group-videoappointment</a>.</li>\n<li><code>Appointment.status</code> is <code>booked</code> or <code>pending</code>.</li>\n<li>The <code>recipient</code> RelatedPerson is on <code>Appointment.participant[]</code> with <code>status</code> <code>accepted</code>, <code>tentative</code>, or <code>needs-action</code>.</li>\n<li><code>RelatedPerson.active</code> = <code>true</code>.</li>\n<li><code>RelatedPerson.period</code> has begun and has not ended.</li>\n<li><code>RelatedPerson.telecom[]</code> has exactly one element with <code>system</code> = <code>sms</code> and an <a href=\"StructureDefinition-ehealth-telecom-purpose.html\">ehealth-telecom-purpose</a> extension bound to <code>video-appointment-reminder-sms</code>.</li>\n</ul>\n<p>The operation is synchronous and idempotent only from the FHIR caller's point of view: every successful call dispatches a new outbound message and creates a new Communication. The returned Communication has <code>status</code> = <code>completed</code> on successful dispatch or <code>status</code> = <code>stopped</code> when the downstream gateway rejected the send (the resource is still persisted so the failed attempt is auditable).</p>\n</div></div>"
  },
  "url" : "http://ehealth.sundhed.dk/fhir/OperationDefinition/Appointment-send-message",
  "version" : "10.0.0",
  "name" : "Appointment-send-message",
  "title" : "Send message",
  "status" : "active",
  "kind" : "operation",
  "date" : "2026-08-06T13:29:38+00:00",
  "publisher" : "Den telemedicinske infrastruktur (eHealth Infrastructure)",
  "contact" : [{
    "name" : "Den telemedicinske infrastruktur (eHealth Infrastructure)",
    "telecom" : [{
      "system" : "url",
      "value" : "http://ehealth.sundhed.dk"
    }]
  }],
  "description" : "Sends a message to a [RelatedPerson](StructureDefinition-ehealth-relatedperson.html) associated with a video appointment ([ehealth-videoappointment](StructureDefinition-ehealth-videoappointment.html) or [ehealth-group-videoappointment](StructureDefinition-ehealth-group-videoappointment.html)) via the specified channel. The recipient must be a RelatedPerson listed as a participant on the target Appointment. The created [ehealth-message](StructureDefinition-ehealth-message.html) resource is system-generated; its `sender` is a contained Device representing the issuing system.",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "urn:iso:std:iso:3166",
      "code" : "DK",
      "display" : "Denmark"
    }]
  }],
  "affectsState" : true,
  "code" : "send-message",
  "comment" : "The following preconditions must be satisfied — otherwise the operation returns `HTTP 400 Bad Request` with an OperationOutcome describing the violated rule:\n\n* `Appointment.meta.profile` is [ehealth-videoappointment](StructureDefinition-ehealth-videoappointment.html) or [ehealth-group-videoappointment](StructureDefinition-ehealth-group-videoappointment.html).\n* `Appointment.status` is `booked` or `pending`.\n* The `recipient` RelatedPerson is on `Appointment.participant[]` with `status` `accepted`, `tentative`, or `needs-action`.\n* `RelatedPerson.active` = `true`.\n* `RelatedPerson.period` has begun and has not ended.\n* `RelatedPerson.telecom[]` has exactly one element with `system` = `sms` and an [ehealth-telecom-purpose](StructureDefinition-ehealth-telecom-purpose.html) extension bound to `video-appointment-reminder-sms`.\n\nThe operation is synchronous and idempotent only from the FHIR caller's point of view: every successful call dispatches a new outbound message and creates a new Communication. The returned Communication has `status` = `completed` on successful dispatch or `status` = `stopped` when the downstream gateway rejected the send (the resource is still persisted so the failed attempt is auditable).",
  "resource" : ["Appointment"],
  "system" : false,
  "type" : false,
  "instance" : true,
  "parameter" : [{
    "name" : "recipient",
    "use" : "in",
    "min" : 1,
    "max" : "1",
    "documentation" : "The related person to receive the message. Must be listed as a participant on the target Appointment.",
    "type" : "Reference",
    "targetProfile" : ["http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-relatedperson"]
  },
  {
    "name" : "channel",
    "use" : "in",
    "min" : 1,
    "max" : "1",
    "documentation" : "The channel to use when sending the message.",
    "type" : "code",
    "binding" : {
      "strength" : "required",
      "valueSet" : "http://ehealth.sundhed.dk/vs/ehealth-message-channel"
    }
  },
  {
    "name" : "return",
    "use" : "out",
    "min" : 1,
    "max" : "1",
    "documentation" : "The created Communication resource, conforming to the [ehealth-message](StructureDefinition-ehealth-message.html) profile. `Communication.status` is `completed` on successful dispatch or `stopped` when the downstream gateway rejected the send.",
    "type" : "Communication"
  }]
}