@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message> a fhir:OperationDefinition ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "MessageHeader-process-message"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition MessageHeader-process-message</b></p><a name=\"MessageHeader-process-message\"> </a><a name=\"hcMessageHeader-process-message\"> </a><p>URL: [base]/$process-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>content</td><td/><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The message to process (or, if using asynchronous messaging, it may be a response message to accept)</p>\n</div></td></tr><tr><td>IN</td><td>async</td><td/><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If 'true' the message is processed using the asynchronous messaging pattern</p>\n</div></td></tr><tr><td>IN</td><td>response-url</td><td/><td>0..1</td><td><a href=\"datatypes.html#url\">url</a></td><td/><td><div><p>A URL to submit response messages to, if asynchronous messaging is being used, and if the MessageHeader.source.endpoint is not the appropriate place to submit responses</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>0..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>A response message, if synchronous messaging is being used (mandatory in this case). For asynchronous messaging, there is no return value</p>\n</div></td></tr></table><div><p>This operation does not use the parameters resource; the parameters \"async\" and \"response-url\" always go in the URL, if they are used, and the \"content\" parameter is always the body of the HTTP message.</p>\n<p>When processing messages, a server may return one of several status codes:</p>\n<ul>\n<li><strong>200 OK</strong>: Indicates that the message has been fully processed.  If an application-level response is expected for the submitted message, that response SHALL be returned as the body of the 200 response.</li>\n<li><strong>202 Accepted</strong>: Indicates that the receiving system has accepted custody of the message</li>\n<li><strong>204 No Content</strong>: Indicates that the message has been fully processed and would normally have had an application-level response, but because of instructions from the sender (e.g. the <a href=\"https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-messageheader-response-request.html\">http://hl7.org/fhir/StructureDefinition/messageheader-response-request</a> extension), no response is being provided</li>\n<li><strong>300+</strong>: Indicates that the message was not successfully processed.  The server MAY return an <a href=\"operationoutcome.html\">OperationOutcome</a> with additional information, and SHOULD do so if the response code is 400 or greater. The client SHALL interpret a 4xx response to indicate that there is no point resubmitting the unaltered message, and a 5xx response to indicate an unexpected error occurred on the part of the server, with the implication that it may be appropriate to resubmit the original message. Doing so SHOULD NOT result in a duplicate message response. Repeated failures indicate either a fatal problem with the submission or a problem with the receiving application.</li>\n</ul>\n<p>The following rules apply when using $process-message:</p>\n<ul>\n<li>The operation only accepts POST transactions - any other HTTP method will result in an HTTP error</li>\n<li>The request content type submitted is always <a href=\"bundle.html\">Bundle</a> with type \"message\" containing a <a href=\"messageheader.html\">Message Header</a> resource as the first resource</li>\n<li>The response content type returned, if not empty, is always <a href=\"bundle.html\">Bundle</a> with type \"message\" containing a <a href=\"messageheader.html\">Message Header</a> resource as the first resource, or an HTTP error</li>\n<li>If the response is an error, the body SHOULD be an <a href=\"operationoutcome.html\">OperationOutcome</a> resource with full details of the Errors ∓ Warning</li>\n<li>The mailbox may be authenticated using standard HTTP authentication methods, including OAuth</li>\n</ul>\n<p>The $process-message operation can be used by any HTTP end-point that accepts FHIR messages, not just FHIR RESTful servers.</p>\n<p>In order to ensure consistency of processing, the <a href=\"messaging.html#reliable\">logical rules regarding processing of Bundle.id and message id</a> SHALL be followed when messages are processed using this operation.</p>\n<p>The $process-message operation may be used synchronously, or asynchronously.</p>\n<p>The following rules apply when using the $process-message operation synchronously:</p>\n<ul>\n<li>The URL (http://server/base/$process-message) has no parameters</li>\n<li>It is an error if the sender POSTs a message that requires multiple response messages</li>\n<li>Servers SHALL accept multiple concurrent message submissions and process them correctly (they are allowed to process them sequentially internally, but multiple concurrent submissions is not an error in its own right)</li>\n</ul>\n<p>The following rules apply when using the $process-message operation asynchronously:</p>\n<ul>\n<li>The URL has at least one parameter: http://server/base/$process-message?async=true</li>\n<li>The server acknowledges the message with a 200 OK with no body, or returns an HTTP error if the message cannot be processed</li>\n<li>Accepting the message means that the server has understood the message enough to know where to respond</li>\n<li>An <a href=\"operationoutcome.html\">OperationOutcome</a> SHOULD be returned in either case</li>\n<li>By default, the server responds by invoking the $process-message using the sender's stated end-point in the message: POST [MessageHeader.source.endpoint]/$process-message]</li>\n<li>Since the source end-point may be manipulated by message transfer engines, an alternative response address may be specified using the parameter \"response-url\": http://server/base/$process-message?async=true&amp;response-url=http://server2.com/base/anything.  The endpoint at the specified URL SHALL implement the signature of the $process-message operation (parameter async=true, accept a Bundle, return a 200 OK or an error)</li>\n<li>The server submits response messages to the appropriate end-point with the parameter async=true. There is no response message for the response messages</li>\n</ul>\n</div></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:extension ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm>
     ] ;
     fhir:value [
       a fhir:Integer ;
       fhir:v 4
     ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status>
     ] ;
     fhir:value [
       a fhir:Code ;
       fhir:v "normative"
     ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-wg>
     ] ;
     fhir:value [
       a fhir:Code ;
       fhir:v "inm"
     ]
  ] ) ; # 
  fhir:url [
     fhir:v "http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message"^^xsd:anyURI ;
     fhir:l <http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message>
  ] ; # 
  fhir:version [ fhir:v "6.0.0-ballot4"] ; # 
  fhir:name [ fhir:v "ProcessMessage"] ; # 
  fhir:title [ fhir:v "Process Message"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:kind [ fhir:v "operation"] ; # 
  fhir:experimental [ fhir:v false] ; # 
  fhir:date [ fhir:v "2026-06-11T13:08:54+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "HL7 International / Infrastructure And Messaging"] ; # 
  fhir:contact ( [
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "http://hl7.org/fhir" ]
     ] [
       fhir:system [ fhir:v "email" ] ;
       fhir:value [ fhir:v "fhir@lists.hl7.org" ]
     ] )
  ] [
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "http://www.hl7.org/Special/committees/inm" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "This operation accepts a message, processes it according to the definition of the event in the message header, and returns one or more response messages.  \n\nIn addition to processing the message event, a server may choose to retain all or some the resources and make them available on a RESTful interface, but is not required to do so."] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm"^^xsd:anyURI ;
         fhir:l <http://unstats.un.org/unsd/methods/m49/m49.htm>
       ] ;
       fhir:code [ fhir:v "001" ] ;
       fhir:display [ fhir:v "World" ]
     ] )
  ] ) ; # 
  fhir:affectsState [ fhir:v true] ; # 
  fhir:code [ fhir:v "process-message"] ; # 
  fhir:comment [ fhir:v "This operation does not use the parameters resource; the parameters \"async\" and \"response-url\" always go in the URL, if they are used, and the \"content\" parameter is always the body of the HTTP message.\n\nWhen processing messages, a server may return one of several status codes:\n* **200 OK**: Indicates that the message has been fully processed.  If an application-level response is expected for the submitted message, that response SHALL be returned as the body of the 200 response.\n* **202 Accepted**: Indicates that the receiving system has accepted custody of the message\n* **204 No Content**: Indicates that the message has been fully processed and would normally have had an application-level response, but because of instructions from the sender (e.g. the [http://hl7.org/fhir/StructureDefinition/messageheader-response-request](https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-messageheader-response-request.html) extension), no response is being provided\n* **300+**: Indicates that the message was not successfully processed.  The server MAY return an [OperationOutcome](operationoutcome.html) with additional information, and SHOULD do so if the response code is 400 or greater. The client SHALL interpret a 4xx response to indicate that there is no point resubmitting the unaltered message, and a 5xx response to indicate an unexpected error occurred on the part of the server, with the implication that it may be appropriate to resubmit the original message. Doing so SHOULD NOT result in a duplicate message response. Repeated failures indicate either a fatal problem with the submission or a problem with the receiving application.\n\nThe following rules apply when using $process-message:\n\n* The operation only accepts POST transactions - any other HTTP method will result in an HTTP error\n* The request content type submitted is always [Bundle](bundle.html) with type \"message\" containing a [Message Header](messageheader.html) resource as the first resource\n* The response content type returned, if not empty, is always [Bundle](bundle.html) with type \"message\" containing a [Message Header](messageheader.html) resource as the first resource, or an HTTP error\n* If the response is an error, the body SHOULD be an [OperationOutcome](operationoutcome.html) resource with full details of the Errors &mp; Warning\n* The mailbox may be authenticated using standard HTTP authentication methods, including OAuth\n\nThe $process-message operation can be used by any HTTP end-point that accepts FHIR messages, not just FHIR RESTful servers.\n\nIn order to ensure consistency of processing, the [logical rules regarding processing of Bundle.id and message id](messaging.html#reliable) SHALL be followed when messages are processed using this operation.\n\nThe $process-message operation may be used synchronously, or asynchronously.\n\nThe following rules apply when using the $process-message operation synchronously:\n\n* The URL (http://server/base/$process-message) has no parameters\n* It is an error if the sender POSTs a message that requires multiple response messages\n* Servers SHALL accept multiple concurrent message submissions and process them correctly (they are allowed to process them sequentially internally, but multiple concurrent submissions is not an error in its own right)\n\nThe following rules apply when using the $process-message operation asynchronously:\n\n* The URL has at least one parameter: http://server/base/$process-message?async=true\n* The server acknowledges the message with a 200 OK with no body, or returns an HTTP error if the message cannot be processed\n* Accepting the message means that the server has understood the message enough to know where to respond\n* An [OperationOutcome](operationoutcome.html) SHOULD be returned in either case\n* By default, the server responds by invoking the $process-message using the sender's stated end-point in the message: POST [MessageHeader.source.endpoint]/$process-message]\n* Since the source end-point may be manipulated by message transfer engines, an alternative response address may be specified using the parameter \"response-url\": http://server/base/$process-message?async=true&amp;response-url=http://server2.com/base/anything.  The endpoint at the specified URL SHALL implement the signature of the $process-message operation (parameter async=true, accept a Bundle, return a 200 OK or an error)\n* The server submits response messages to the appropriate end-point with the parameter async=true. There is no response message for the response messages"] ; # 
  fhir:resource ( [ fhir:v "MessageHeader"] ) ; # 
  fhir:system [ fhir:v true] ; # 
  fhir:type [ fhir:v false] ; # 
  fhir:instance [ fhir:v false] ; # 
  fhir:parameter ( [
     fhir:name [ fhir:v "content" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "1"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The message to process (or, if using asynchronous messaging, it may be a response message to accept)" ] ;
     fhir:type [ fhir:v "Bundle" ]
  ] [
     fhir:name [ fhir:v "async" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "If 'true' the message is processed using the asynchronous messaging pattern" ] ;
     fhir:type [ fhir:v "boolean" ]
  ] [
     fhir:name [ fhir:v "response-url" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "A URL to submit response messages to, if asynchronous messaging is being used, and if the MessageHeader.source.endpoint is not the appropriate place to submit responses" ] ;
     fhir:type [ fhir:v "url" ]
  ] [
     fhir:name [ fhir:v "return" ] ;
     fhir:use [ fhir:v "out" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "A response message, if synchronous messaging is being used (mandatory in this case). For asynchronous messaging, there is no return value" ] ;
     fhir:type [ fhir:v "Bundle" ]
  ] ) . # 

# -------------------------------------------------------------------------------------

