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. You can typically 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 (a) you want raw XML data or (b) you want you to pick what documents to view or retrieve. If you’re familiar with our Redox data models, this is the FHIR® representation of the ClinicalSummary.DocumentGet. Learn more about the DocumentGet event type. Or, if you only want to retrieve the patient’s latest CDA, check out the PatientQuery event type.

You can receive, retrieve, or save document references.

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

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
}