Release 5 Preview #3

This page is part of the FHIR Specification (v4.5.0: R5 Preview #3). 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 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 official 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:
NameCardinalityTypeBindingProfileDocumentation
url1..1uri
persist0..1Binary

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:
NameCardinalityTypeBindingProfileDocumentation
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.