DocumentReference $write

post/DocumentReference/$write
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.

$write

This operation allows you to save metadata for a document created or referenced in your system to your connection's system.

Request parameters and payload

cURL request example

1
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/DocumentReference/$write' \
2
--request POST \
3
--header 'Authorization: Bearer $API_TOKEN' \
4
--header 'Content-Type: application/fhir+json' \
5
--data '{
6
"resourceType": "Bundle",
7
"id": "RedoxBlobExampleTimothy",
8
"type": "message",
9
"timestamp": "2021-12-17T20:33:22.422Z",
10
"entry": [
11
{
12
"resource": {
13
"resourceType": "MessageHeader",
14
"id": "RedoxMessageHeaderExample",
15
"source": {
16
"name": "Good Health Clinics",
17
"endpoint": "05107c08-fe2f-4740-8c1d-c7107d18ebe5"
18
},
19
"eventCoding": {
20
"system": "urn:redox:event-type",
21
"code": "Media-New"
22
}
23
}
24
},
25
{
26
"resource": {
27
"resourceType": "Patient",
28
"id": "RedoxPatientExampleTimothyWrite",
29
"extension": [
30
{
31
"extension": [
32
{
33
"url": "text",
34
"valueString": "White"
35
}
36
],
37
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"
38
},
39
{
40
"extension": [
41
{
42
"url": "ombCategory",
43
"valueCoding": {
44
"code": "2135-2",
45
"system": "urn:oid:2.16.840.1.113883.6.238",
46
"display": "Hispanic or Latino"
47
}
48
},
49
{
50
"url": "text",
51
"valueString": "Hispanic"
52
}
53
],
54
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"
55
}
56
],
57
"name": [
58
{
59
"given": [
60
"Timothy",
61
"Paul"
62
],
63
"family": "Bixby",
64
"use": "official"
65
},
66
{
67
"text": "Billy",
68
"use": "usual"
69
}
70
],
71
"gender": "male",
72
"birthDate": "2008-01-06",
73
"telecom": [
74
{
75
"value": "+18088675301",
76
"system": "phone",
77
"use": "home"
78
},
79
{
80
"value": "+18008675309",
81
"system": "phone",
82
"use": "work"
83
},
84
{
85
"value": "timothy.bixby@redoxengine.com",
86
"system": "email"
87
}
88
],
89
"address": [
90
{
91
"line": [
92
"4762 Hickory Street"
93
],
94
"city": "Monroe",
95
"district": "Greene",
96
"state": "WI",
97
"postalCode": "53566",
98
"country": "US",
99
"use": "home"
100
}
101
],
102
"maritalStatus": {
103
"coding": [
104
{
105
"code": "M",
106
"system": "http://hl7.org/fhir/v3/MaritalStatus",
107
"display": "Married"
108
}
109
],
110
"text": "Married"
111
},
112
"communication": [
113
{
114
"language": {
115
"coding": [
116
{
117
"code": "en",
118
"system": "urn:ietf:bcp:47"
119
}
120
],
121
"text": "English"
122
}
123
}
124
],
125
"contact": [
126
{
127
"name": {
128
"given": [
129
"Barbara"
130
],
131
"family": "Bixby"
132
},
133
"telecom": [
134
{
135
"value": "+18088675303",
136
"system": "phone",
137
"use": "home"
138
},
139
{
140
"value": "barbara.bixby@redoxengine.com",
141
"system": "email"
142
}
143
],
144
"address": {
145
"line": [
146
"4762 Hickory St."
147
],
148
"city": "Monroe",
149
"district": "Green",
150
"state": "WI",
151
"postalCode": "53566",
152
"country": "USA"
153
},
154
"relationship": [
155
{
156
"coding": [
157
{
158
"code": "MTH",
159
"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
160
"display": "mother"
161
}
162
],
163
"text": "Mother"
164
},
165
{
166
"coding": [
167
{
168
"code": "C",
169
"system": "http://terminology.hl7.org/CodeSystem/v2-0131",
170
"display": "Emergency Contact"
171
}
172
],
173
"text": "Emergency Contact"
174
}
175
]
176
}
177
],
178
"generalPractitioner": [
179
{
180
"reference": "Practitioner/RedoxPractitionerExamplePat"
181
}
182
],
183
"managingOrganization": {
184
"reference": "Organization/RedoxOrganizationManagingExample"
185
},
186
"identifier": [
187
{
188
"value": "0000000001",
189
"type": {
190
"text": "MR"
191
}
192
}
193
]
194
}
195
},
196
{
197
"resource": {
198
"resourceType": "DocumentReference",
199
"id": "RedoxDocumentReferenceExampleBlobTimothy",
200
"masterIdentifier": {
201
"value": "129.6.58.92.88336",
202
"system": "urn:redox:test:media",
203
"extension": [
204
{
205
"url": "https://fhir.redoxengine.com/StructureDefinition/identifier-origin",
206
"valueString": "RedoxApi"
207
}
208
]
209
},
210
"subject": {
211
"reference": "Patient/RedoxPatientExampleTimothy"
212
},
213
"status": "current",
214
"description": "Test Description",
215
"type": {
216
"text": "Empty File"
217
},
218
"category": [
219
{
220
"coding": [
221
{
222
"system": "urn:redox:document_kind",
223
"code": "Media"
224
}
225
]
226
}
227
],
228
"context": {
229
"period": {
230
"start": "2015-05-06T06:00:58.872Z"
231
}
232
},
233
"content": [
234
{
235
"attachment": {
236
"url": "https://blob.redoxengine.com/123456789",
237
"contentType": "application/pdf",
238
"title": "SamplePDF-Order Specific Media"
239
}
240
}
241
]
242
}
243
}
244
]
245
}'

Request Body Schema

  • resourceType
    required, string

    Identifies the type of the resource

    Value: Bundle
  • type
    required, string

    Identifies this bundle as a message

    Value: message
  • entry
    required, Array of MessageHeader, DocumentReference, Patient or Other

    An entry in the bundle containing a FHIR resource

    • resource
      required, object

      Additional metadata about the message including the event

      • resourceType
        required, string

        Identifies the type of the resource

        Value: MessageHeader
      • source
        required, object

        Information about the sender of the message. This will typically be populated by Redox.

        • endpoint
          required, string

          Identifies the routing target to send acknowledgements to.

        • name
          string

          Human-readable name for the source system.

      • eventCoding
        required, object

        This describes the message being communicated

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

          Value: Notes-New
  • timestamp
    string

    The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.

Response fields and example

Example

1
"Operation Response"