DocumentReference _search

post/DocumentReference/_search
Page View

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. Or, if you only want to retrieve the patient’s latest CDA, refer to the PatientQuery schema.

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

_search

Query for details about a document for a patient, visit, or other clinical concept from one provider.

This is a flexible option with query parameters to refine your search. The response returns a bundle of resources, known as a searchset bundle type. Learn about bundles and bundle types in our FHIR® glossary.

Request parameters and payload

When querying for this resource, one of the following sets of parameters must always be sent. Additional parameters may be sent at any time.
  • _id
  • identifier
  • patient

cURL request example

bash
1
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/DocumentReference/_search' \
2
--request POST \
3
--header 'Authorization: Bearer $API_TOKEN' \
4
--header 'Content-Type: application/x-www-form-urlencoded' \
5
--data-urlencode 'type=string' \
6
--data-urlencode 'category=string' \
7
--data-urlencode 'patient=string' \
8
--data-urlencode 'patient.identifier=string' \
9
--data-urlencode 'date=string' \
10
--data-urlencode 'encounter-identifier=string' \
11
--data-urlencode 'encounter=string' \
12
--data-urlencode 'encounter.identifier=string' \
13
--data-urlencode 'identifier=string' \
14
--data-urlencode 'period=string' \
15
--data-urlencode '_elements=string'

Request Body Schema

  • type
    Array of string

    Kind of document

  • category
    Array of string

    The categorization of the document. Pass urn:redox:document_kind|CDA to retrieve XML-formatted CDA documents.

  • patient
    Array of string

    Who is the subject of the document

  • patient.identifier
    Array of string

    One or more external identifiers for the patient

  • date
    Array of string

    The date/time this document reference was created

  • encounter-identifier
    Array of string

    Identifier for encounter associated with documents

  • encounter
    Array of string

    The encounter associated with the document reference.

  • encounter.identifier
    Array of string

    Identifier(s) by which this encounter is known

  • identifier
    Array of string

    A master version specific identifier for the document reference

  • period
    Array of string

    The time of service that is being documented

  • _elements
    Array of string

    A comma-separated list of DocumentReference field names to return. This is helpful in reducing the initial response size, especially for DocumentReferences resources where content can carry binary data.

    Redox recommends passing subject,masterIdentifier,date,type,context to retrieve meaningful fields while still omitting the content which can be retrieved via subsequent searches or GET operations.

Response fields and example

Example payload generated from schema
1
{
2
"resourceType": "Bundle",
3
"type": "searchset",
4
"total": 1,
5
"entry": [
6
{
7
"resource": {
8
"resourceType": "DocumentReference",
9
"id": "string",
10
"masterIdentifier": {
11
"extension": [
12
{
13
"url": "string",
14
"valueBoolean": true
15
}
16
],
17
"use": "usual",
18
"system": "string",
19
"value": "string"
20
},
21
"status": "current",
22
"type": {
23
"coding": [
24
{
25
"system": "string",
26
"code": "string"
27
}
28
],
29
"text": "string"
30
},
31
"category": [
32
{
33
"coding": [
34
{
35
"code": "string",
36
"system": "string"
37
}
38
],
39
"text": "string"
40
}
41
],
42
"subject": {
43
"reference": "string"
44
},
45
"date": "string",
46
"author": [
47
{
48
"reference": "string"
49
}
50
],
51
"authenticator": {
52
"reference": "string"
53
},
54
"relatesTo": [
55
{
56
"code": "replaces",
57
"target": {
58
"extension": [
59
{
60
"url": "http://hl7.org/fhir/us/ccda/StructureDefinition/VersionNumber",
61
"valueInteger": 0
62
}
63
],
64
"identifier": {
65
"extension": [
66
{
67
"url": "string",
68
"valueBoolean": true
69
}
70
],
71
"use": "usual",
72
"system": "string",
73
"value": "string"
74
}
75
}
76
}
77
],
78
"description": "string",
79
"content": [
80
{
81
"attachment": {
82
"contentType": "text/xml",
83
"data": "string"
84
}
85
}
86
],
87
"context": {
88
"encounter": [
89
{
90
"identifier": {
91
"extension": [
92
{
93
"url": "string",
94
"valueBoolean": true
95
}
96
],
97
"use": "usual",
98
"system": "string",
99
"value": "string"
100
}
101
}
102
],
103
"period": {
104
"start": "string",
105
"end": "string"
106
}
107
}
108
},
109
"search": {
110
"mode": "match"
111
}
112
}
113
]
114
}

    This response type only supports documents in XML format, which is the standard format for CDA documents.

  • resourceType
    required, string

    Identifies the type of the resource

    Value: Bundle
  • type
    required, string

    Identifies this bundle as a response to a search

    Value: searchset
  • total
    required, number

    The total number of matches

  • entry
    Array of DocumentReference or Other

    A resource matching the search criteria or related to a matching resource

    • resource
      required, object

      A CDA XML document stored in Base64 encoded format

      • resourceType
        required, string

        Identifies the type of the resource

        Value: DocumentReference
      • status
        required, string

        The status of this document reference.

        Possible Values: current, superseded, entered-in-error
      • category
        required, Array of object

        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.

        • coding
          Array of object

          A reference to a code defined by a terminology system.

          • system
            required, string

            The identification of the code system that defines the meaning of the symbol in the code.

            Value: urn:redox:document_kind
          • code
            required, string

            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
        • text
          string

          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.

      • content
        required, Array of object

        The document and format referenced. There may be multiple content element repetitions, each with a different format.

        • attachment
          required, object

          The document or URL of the document along with critical metadata to prove content has integrity.

          • contentType
            string

            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
          • data
            string

            The actual data of the attachment - a sequence of bytes, base64 encoded.

      • id
        string

        The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.

      • masterIdentifier
        object

        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.

        • extension
          Array of Boolean, String, CodeableConcept, Coding

          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.

          • url
            required, string

            Source of the definition for the extension code - a logical name or a URL.

          • valueBoolean
            boolean

            A single value for the extension.

        • use
          string

          The purpose of this identifier.

          Possible Values: usual, official, temp, secondary, old (If known)
        • system
          string

          Establishes the namespace for the value - that is, a URL that describes a set values that are unique.

        • value
          string

          The portion of the identifier typically relevant to the user and which is unique within the context of the system.

      • type
        object

        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.

        • coding
          Array of object

          A reference to a code defined by a terminology system.

          • system
            string

            The identification of the code system that defines the meaning of the symbol in the code.

          • code
            string

            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).

        • text
          string

          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

        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
        • reference
          string

          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

        When the document reference was created.

      • author
        Array of object

        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
        • reference
          string

          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

        Which person or organization authenticates that this document is valid.

        Must reference one of the following types of resources:

        • Practitioner
        • PractitionerRole
        • Organization
        • reference
          string

          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

        Relationships that this document has with other document references that already exist.

        • code
          required, string

          The type of relationship that this document has with anther document.

          Possible Values: replaces, transforms, signs, appends
        • target
          required, object

          The target document of this relationship.

          Must be a resource of type DocumentReference.

          • extension
            Array of object

            Additional information about the related document

            • url
              required, string

              Source of the definition for the extension code - a logical name or a URL.

              Value: http://hl7.org/fhir/us/ccda/StructureDefinition/VersionNumber
            • valueInteger
              number

              Value of extension - must be one of a constrained set of the data types (see Extensibility for a list).

          • identifier
            object

            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.

            • extension
              Array of Boolean, String, CodeableConcept, Coding

              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.

              • url
                required, string

                Source of the definition for the extension code - a logical name or a URL.

              • valueBoolean
                boolean

                A single value for the extension.

            • use
              string

              The purpose of this identifier.

              Possible Values: usual, official, temp, secondary, old (If known)
            • system
              string

              Establishes the namespace for the value - that is, a URL that describes a set values that are unique.

            • value
              string

              The portion of the identifier typically relevant to the user and which is unique within the context of the system.

      • description
        string

        Human-readable description of the source document.

      • context
        object

        The clinical context in which the document was prepared.

        • encounter
          Array of object

          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
          • identifier
            object

            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.

            • extension
              Array of Boolean, String, CodeableConcept, Coding

              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.

              • url
                required, string

                Source of the definition for the extension code - a logical name or a URL.

              • valueBoolean
                boolean

                A single value for the extension.

            • use
              string

              The purpose of this identifier.

              Possible Values: usual, official, temp, secondary, old (If known)
            • system
              string

              Establishes the namespace for the value - that is, a URL that describes a set values that are unique.

            • value
              string

              The portion of the identifier typically relevant to the user and which is unique within the context of the system.

        • period
          object

          The time period over which the service that is described by the document was provided.

          • start
            string

            The start of the period. The boundary is inclusive.

          • end
            string

            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.

    • search
      required, object

      Information about the search process that lead to the creation of this entry.

      • mode
        required, string

        Identifies the DocumentReference as matching the search parameters

        Value: match