# DocumentReference read

`GET /DocumentReference/{id}`

This resource contains metadata for any kind of document so that you can locate the document in a system. Typically, you may use this as a reference in another resource type that includes the subject, author, and context for a related document. 

You may want to use this resource if:

- You want raw XML data.
- You want to pick which documents to view or retrieve.

If you’re familiar with our Redox data models, this is the FHIR representation of the `ClinicalSummary.DocumentGet`. [Refer to the DocumentGet schema](https://developer.redoxengine.com/data-models/ClinicalSummary.html#DocumentGet). Or, if you only want to retrieve the patient’s latest CDA, [refer to  the PatientQuery schema](https://developer.redoxengine.com/data-models/ClinicalSummary.html#PatientQuery).

You can review, retrieve, create, edit, or convert document records.

> **Supported fields and schema examples**
>
> We support any valid FHIR field. However, we only display fields we’ve defined in our schema, which are usually based on what’s included in the U.S. Core profile. We recommend relying on U.S. Core requirements. 
>
> Our schema examples show the shape and possibility of each FHIR resource; they aren’t code for real-time API calls. We don’t currently recommend copying and pasting these schema examples for your API calls. [Consider reviewing FHIR API actions](/fhir-api-actions) for realistic examples for particular use cases.

### read

Review a specific `DocumentReference` resource with metadata for a document related to a patient, visit, or other clinical concept.

> **FHIR read**
>
> To use a `read` interaction, you must know the related resource ID, which you may not have in your real workflows. A `read` is likely only a follow-up option after receiving the specific resource in a recent FHIR passthrough or data on demand exchange.
>
> Typically, you should use the more flexible `_search` with query parameters, unless you're guaranteed to request data directly from a FHIR server using the resource ID. [Learn more about using FHIR identifiers](https://docs.redoxengine.com/permalink/3D5vEc8GfbxZ0SLhMbLfuQ).

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | DocumentReference identifier |

## Request example

```bash
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/DocumentReference/{id}' \
--request GET \
--header 'Authorization: Bearer $API_TOKEN'
```

## Responses

### 200

The DocumentReference

#### Any of: Redox DocumentReference CDA

Documents stored in Redox

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: DocumentReference |
| `status` | string | Yes | The status of this document reference. Possible values: current, superseded, entered-in-error |
| `content` | Array of object | Yes | The document and format referenced. There may be multiple content element repetitions, each with a different format. |
| `content[].attachment` | object | Yes | The document or URL of the document along with critical metadata to prove content has integrity. |
| `content[].attachment.contentType` | string | No | Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. Value: text/xml |
| `content[].attachment.data` | string | No | The actual data of the attachment - a sequence of bytes, base64 encoded. |
| `id` | string | No | The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. |
| `masterIdentifier` | object | No | Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. |
| `masterIdentifier.extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `masterIdentifier.extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `masterIdentifier.extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (String).valueString` | string | No | A single value for the extension. |
| `masterIdentifier.extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `masterIdentifier.extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `masterIdentifier.extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `masterIdentifier.extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `masterIdentifier.extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `masterIdentifier.extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `masterIdentifier.extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `masterIdentifier.use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `masterIdentifier.system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `masterIdentifier.value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `type` | object | No | Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. |
| `type.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `type.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `type.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `type.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `category` | Array of object | No | A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. |
| `category[].coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `category[].coding[].system` | string | Yes | The identification of the code system that defines the meaning of the symbol in the code. Value: urn:redox:document_kind |
| `category[].coding[].code` | string | Yes | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). Value: CDA |
| `category[].text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `subject` | object | No | Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). Must reference one of the following types of resources: - `Patient` - `Practitioner` - `Group` - `Device` |
| `subject.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `date` | string | No | When the document reference was created. |
| `author` | Array of object | No | Identifies who is responsible for adding the information to the document. Must reference one of the following types of resources: - `Practitioner` - `PractitionerRole` - `Organization` - `Device` - `Patient` - `RelatedPerson` |
| `author[].reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `authenticator` | object | No | Which person or organization authenticates that this document is valid. Must reference one of the following types of resources: - `Practitioner` - `PractitionerRole` - `Organization` |
| `authenticator.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `relatesTo` | Array of object | No | Relationships that this document has with other document references that already exist. |
| `relatesTo[].code` | string | Yes | The type of relationship that this document has with anther document. Possible values: replaces, transforms, signs, appends |
| `relatesTo[].target` | object | Yes | The target document of this relationship. Must be a resource of type `DocumentReference`. |
| `relatesTo[].target.extension` | Array of object | No | Additional information about the related document |
| `relatesTo[].target.extension[].url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. Value: http://hl7.org/fhir/us/ccda/StructureDefinition/VersionNumber |
| `relatesTo[].target.extension[].valueInteger` | number | No | Value of extension - must be one of a constrained set of the data types (see Extensibility for a list). |
| `relatesTo[].target.identifier` | object | No | An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. |
| `relatesTo[].target.identifier.extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `relatesTo[].target.identifier.extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `relatesTo[].target.identifier.extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `relatesTo[].target.identifier.extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `relatesTo[].target.identifier.extension[] (String).valueString` | string | No | A single value for the extension. |
| `relatesTo[].target.identifier.extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `relatesTo[].target.identifier.extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `relatesTo[].target.identifier.extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `relatesTo[].target.identifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `relatesTo[].target.identifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `relatesTo[].target.identifier.extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `relatesTo[].target.identifier.extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `relatesTo[].target.identifier.extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `relatesTo[].target.identifier.extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `relatesTo[].target.identifier.extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `relatesTo[].target.identifier.extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `relatesTo[].target.identifier.extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `relatesTo[].target.identifier.extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `relatesTo[].target.identifier.extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `relatesTo[].target.identifier.extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `relatesTo[].target.identifier.extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `relatesTo[].target.identifier.extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `relatesTo[].target.identifier.extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `relatesTo[].target.identifier.use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `relatesTo[].target.identifier.system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `relatesTo[].target.identifier.value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `description` | string | No | Human-readable description of the source document. |
| `context` | object | No | The clinical context in which the document was prepared. |
| `context.encounter` | Array of object | No | Describes the clinical encounter or type of care that the document content is associated with. Must reference one of the following types of resources: - `Encounter` - `EpisodeOfCare` |
| `context.encounter[].identifier` | object | No | An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. |
| `context.encounter[].identifier.extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `context.encounter[].identifier.extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (String).valueString` | string | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `context.encounter[].identifier.extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `context.encounter[].identifier.extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `context.encounter[].identifier.extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `context.encounter[].identifier.extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `context.encounter[].identifier.use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `context.encounter[].identifier.system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `context.encounter[].identifier.value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `context.period` | object | No | The time period over which the service that is described by the document was provided. |
| `context.period.start` | string | No | The start of the period. The boundary is inclusive. |
| `context.period.end` | string | No | The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. |

#### Any of: Redox DocumentReference

Documents stored in Redox

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: DocumentReference |
| `status` | string | Yes | The status of this document reference. Possible values: current, superseded, entered-in-error |
| `content` | Array of object | Yes | The document and format referenced. There may be multiple content element repetitions, each with a different format. |
| `content[].attachment` | object | Yes | The document or URL of the document along with critical metadata to prove content has integrity. |
| `content[].attachment.contentType` | string | No | Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. |
| `content[].attachment.data` | string | No | The actual data of the attachment - a sequence of bytes, base64 encoded. |
| `id` | string | No | The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. |
| `masterIdentifier` | object | No | Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. |
| `masterIdentifier.extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `masterIdentifier.extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `masterIdentifier.extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (String).valueString` | string | No | A single value for the extension. |
| `masterIdentifier.extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `masterIdentifier.extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `masterIdentifier.extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `masterIdentifier.extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `masterIdentifier.extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `masterIdentifier.extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `masterIdentifier.extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `masterIdentifier.extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `masterIdentifier.extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `masterIdentifier.extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `masterIdentifier.use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `masterIdentifier.system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `masterIdentifier.value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `type` | object | No | Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. |
| `type.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `type.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `type.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `type.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `category` | Array of object | No | A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. |
| `category[].coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `category[].coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `category[].coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `category[].text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `subject` | object | No | Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). Must reference one of the following types of resources: - `Patient` - `Practitioner` - `Group` - `Device` |
| `subject.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `date` | string | No | When the document reference was created. |
| `author` | Array of object | No | Identifies who is responsible for adding the information to the document. Must reference one of the following types of resources: - `Practitioner` - `PractitionerRole` - `Organization` - `Device` - `Patient` - `RelatedPerson` |
| `author[].reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `authenticator` | object | No | Which person or organization authenticates that this document is valid. Must reference one of the following types of resources: - `Practitioner` - `PractitionerRole` - `Organization` |
| `authenticator.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `description` | string | No | Human-readable description of the source document. |
| `context` | object | No | The clinical context in which the document was prepared. |
| `context.encounter` | Array of object | No | Describes the clinical encounter or type of care that the document content is associated with. Must reference one of the following types of resources: - `Encounter` - `EpisodeOfCare` |
| `context.encounter[].identifier` | object | No | An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. |
| `context.encounter[].identifier.extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `context.encounter[].identifier.extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (String).valueString` | string | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `context.encounter[].identifier.extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `context.encounter[].identifier.extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `context.encounter[].identifier.extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `context.encounter[].identifier.extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `context.encounter[].identifier.extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `context.encounter[].identifier.extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `context.encounter[].identifier.extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `context.encounter[].identifier.extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `context.encounter[].identifier.use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `context.encounter[].identifier.system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `context.encounter[].identifier.value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `context.period` | object | No | The time period over which the service that is described by the document was provided. |
| `context.period.start` | string | No | The start of the period. The boundary is inclusive. |
| `context.period.end` | string | No | The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "resourceType": "DocumentReference",
  "id": "string",
  "masterIdentifier": {
    "extension": [
      {
        "url": "string",
        "valueBoolean": true
      }
    ],
    "use": "usual",
    "system": "string",
    "value": "string"
  },
  "status": "current",
  "type": {
    "coding": [
      {
        "system": "string",
        "code": "string"
      }
    ],
    "text": "string"
  },
  "category": [
    {
      "coding": [
        {
          "code": "string",
          "system": "string"
        }
      ],
      "text": "string"
    }
  ],
  "subject": {
    "reference": "string"
  },
  "date": "string",
  "author": [
    {
      "reference": "string"
    }
  ],
  "authenticator": {
    "reference": "string"
  },
  "relatesTo": [
    {
      "code": "replaces",
      "target": {
        "extension": [
          {
            "url": "http://hl7.org/fhir/us/ccda/StructureDefinition/VersionNumber",
            "valueInteger": 0
          }
        ],
        "identifier": {
          "extension": [
            {
              "url": "string",
              "valueBoolean": true
            }
          ],
          "use": "usual",
          "system": "string",
          "value": "string"
        }
      }
    }
  ],
  "description": "string",
  "content": [
    {
      "attachment": {
        "contentType": "text/xml",
        "data": "string"
      }
    }
  ],
  "context": {
    "encounter": [
      {
        "identifier": {
          "extension": [
            {
              "url": "string",
              "valueBoolean": true
            }
          ],
          "use": "usual",
          "system": "string",
          "value": "string"
        }
      }
    ],
    "period": {
      "start": "string",
      "end": "string"
    }
  }
}
```

### 400

Request could not be processed or failed validation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: OperationOutcome |
| `issue` | Array of object | Yes | A structured respresentation of the error that occurred |
| `issue[].severity` | string | Yes | Generally `error` or `fatal` Possible values: fatal, error, warning, information |
| `issue[].code` | string | Yes | A FHIR category code that describes the general type of issue. See http://hl7.org/fhir/ValueSet/issue-type for details |
| `issue[].id` | string | No | If the error occurs in the RedoxEngine, this corresponds to an Error record in the organization. |
| `issue[].details` | object | No | Additional details about the error. This may be a text description of the error or a system code that identifies the error. |
| `issue[].details.coding` | Array of object | No | A more granular FHIR code for the specific error. Typically from http://hl7.org/fhir/ValueSet/operation-outcome |
| `issue[].details.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `issue[].details.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `issue[].details.text` | string | No | A human-readable interpretation of the issue code |
| `issue[].diagnostics` | string | No | Additional diagnostic information about the issue. |

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "invalid",
      "details": {
        "coding": [
          {
            "code": "MSG_BAD_SYNTAX",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid content found in request body."
      }
    }
  ]
}
```

### 401

Authorization is required

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "unknown",
      "details": {
        "coding": [
          {
            "code": "MSG_AUTH_REQUIRED",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid authorization token"
      }
    }
  ]
}
```

### 404

Not found or not supported

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "not-found",
      "details": {
        "coding": [
          {
            "code": "MSG_NO_MODULE",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "my-sandbox is not a recognized FHIR organization"
      }
    }
  ]
}
```

### 500

Internal server error

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "processing",
      "details": {
        "coding": [
          {
            "code": "MSG_RESOURCE_ID_FAIL",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Unable to allocate resource id."
      }
    }
  ]
}
```

### 503

Service unavailable

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "transient",
      "details": {
        "text": "System is unable to process this message at this time."
      }
    }
  ]
}
```
