R6 Ballot (1st Draft)

This page is part of the FHIR Specification v6.0.0-ballot1: Release 6 Ballot (1st Draft) (see Ballot Notes). The current 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
return1..1Bundle

The bundle type is "searchset"containing DocumentReference resource and may include a Binary. If the input url refers to another server, it is at the discretion of the server whether to retrieve it or return an error.

Note: as this is the only out parameter, it is a resource, and it has the name 'return', the result of this operation is returned directly as a resource

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.