R5 Final QA

This page is part of the FHIR Specification (v5.0.0-draft-final: Final QA Preview for R5 - see ballot notes). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

Orders and Observations icon Work Group Maturity Level: 3Trial Use Compartments: N/A

A client can ask a server to generate a document reference from a document. The server reads the existing document and generates a matching DocumentReference resource, or returns one it has previously generated. Servers may be able to return or generate document references for the following types of content:.

The canonical URL for this operation definition is

 http://hl7.org/fhir/OperationDefinition/DocumentReference-generate

Formal Definition (as a OperationDefinition).

URL: [base]/DocumentReference/$generate

This is not an idempotent operation

In Parameters:
NameScopeCardinalityTypeBindingProfileDocumentation
url1..1uri

The URL to the source document. This may be a general URL or a Binary or a Composition or a Bundle.

persist0..1boolean

Whether to store the document at the document end-point (/Document) or not, once it is generated (default is for the server to decide).

Out Parameters:
NameScopeCardinalityTypeBindingProfileDocumentation
docRef0..1DocumentReference

The server either returns a single document reference, or it returns an error. If the input url refers to another server, it is at the discretion of the server whether to retrieve it or return an error.

The server either returns a search result containing a single document reference, or it returns an error. If the URI refers to another server, it is at the discretion of the server whether to retrieve it or return an error.

Request: Example of $generate on a Document


POST /open/DocumentReference/$generate
[some headers]

{
  "resourceType": "Parameters",
  "id": "example",
  "parameter": [
    {
      "name": "url",
	  "valueUrl": "Binary/example"
    },
    {
      "name": "persist",
      "valueBoolean": "true"
    }
  ]
}

Response: Results from $generate


HTTP/1.1 200 OK
[other headers]

{
  "resourceType": "Bundle",
  "id": "26419249-18b3-45de-b10e-dca0b2e72a",
  "meta": {
    "lastUpdated": "2016-03-18T03:28:49Z"
  },
  "type": "searchset",
  "total": 1,
  "entry": [{
    "fullUrl": "http://server/path/DocumentReference/example",
    "resource": {
      "resourceType": "DocumentReference",
      "id": "example",
      .. snip ...
    }
  }]
}

 

For more information about operations, including how they are invoked, see Operations.