Customize the
Bundle
structure to add missing elements.
Before you begin
About this task
Bundle
resource. The corresponding structure created from the FHIR specification does not include the
resource
element under entry
. Since entry
needs at least one resource
, it needs to be added manually. In this example,
the sample file contains the Medication
and
MedicationRequest
resources, but you can add other resources as
needed.Note: Make sure to avoid adding another
Bundle
structure
as a resource; this could cause serious performance
issues.{
"resourceType": "Bundle",
"id": "bundle-example",
"meta": {
"lastUpdated": "2014-08-18T01:43:30Z",
"tag": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
"code": "HTEST",
"display": "test health data"
}
]
},
"type": "searchset",
"total": 3,
"link": [
{
"relation": "self",
"url": "https://example.com/base/MedicationRequest?patient\u003d347\u0026_include\u003dMedicationRequest.medication\u0026_count\u003d2"
},
{
"relation": "next",
"url": "https://example.com/base/MedicationRequest?patient\u003d347\u0026searchId\u003dff15fd40-ff71-4b48-b366-09c706bed9d0\u0026page\u003d2"
}
],
"entry": [
{
"fullUrl": "https://example.com/base/MedicationRequest/3123",
"resource": {
"resourceType": "MedicationRequest",
"id": "3123",
"text": {
"status": "generated",
"div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\u003cp\u003e\u003cb\u003eGenerated Narrative with Details\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eid\u003c/b\u003e: 3123\u003c/p\u003e\u003cp\u003e\u003cb\u003estatus\u003c/b\u003e: unknown\u003c/p\u003e\u003cp\u003e\u003cb\u003eintent\u003c/b\u003e: order\u003c/p\u003e\u003cp\u003e\u003cb\u003emedication\u003c/b\u003e: \u003ca\u003eMedication/example\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003esubject\u003c/b\u003e: \u003ca\u003ePatient/347\u003c/a\u003e\u003c/p\u003e\u003c/div\u003e"
},
"status": "unknown",
"intent": "order",
"medicationReference": {
"reference": "Medication/example"
},
"subject": {
"reference": "Patient/347"
}
},
"search": {
"mode": "match",
"score": 1
}
},
{
"fullUrl": "https://example.com/base/Medication/example",
"resource": {
"resourceType": "Medication",
"id": "example",
"text": {
"status": "generated",
"div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\u003cp\u003e\u003cb\u003eGenerated Narrative with Details\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eid\u003c/b\u003e: example\u003c/p\u003e\u003c/div\u003e"
}
},
"search": {
"mode": "include"
}
}
]
}
Procedure
- Double-click the Bundle structure in the folder where you imported the FHIR specification.
-
Right-click the
entry
element and click New Element to create aresource
element. -
Right-click the new
resource
element and create new elements under it. In this example you needMedication
andMedicationRequest
. -
Click the
resource
element and change the value of the Group Type property to Choice. -
Click the
Medication
element, and select the Medication structure from the FHIR Schema in the Inherits From field. -
Click the
MedicationRequest
element and select the MedicationRequest structure in the Inherits From field.