--- type: "operation" title: "DocumentReference $generate" resource: "DocumentReference" operation: "generate" --- # documentreference $generate Generate a DocumentReference from a document **Description:** 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: **Comments:** 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. **Affects State:** true **System:** false **Type:** true **Instance:** false **URL:** http://hl7.org/fhir/build/OperationDefinition/DocumentReference-generate ## Parameters - **url** [in] 1..1 uri — The URL to the source document. This may be a general URL or a Binary or a Composition or a Bundle. - **persist** [in] 0..1 boolean — Whether to store the document at the document end-point (/Document) or not, once it is generated (default is for the server to decide). - **return** [out] 1..1 Bundle — The bundle type is "searchset"containing [DocumentReference](documentreference.html) 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.