Stream: implementers
Topic: Bundle
Chris Lo (Apr 25 2018 at 19:45):
Can someone show a snippet of how to populate a bundle of patients. Thanks.
Richard Kavanagh (Apr 25 2018 at 19:56):
In what way is it not working?
Michael Xiao (Apr 25 2018 at 19:56):
Bundle.EntryComponent entrycom = new Bundle.EntryComponent();
entrycom .Resource = Patient;
Bundle.Entry.Add(entrycom);
Chris Lo (Apr 25 2018 at 19:57):
Thanks Michael Xiao,
That's what I discovered. the EntryComponent object was what I was missing.
Alex Goel (Mar 03 2020 at 01:46):
PCA_TransactionBundleExample1.json
We're having trouble with the bundle and retrieving the individual resources once we POST to test.fhir.org. and hapi. Do those servers support retrieving the individual resources or are we missing something in the resource?
Paul Church (Mar 03 2020 at 02:17):
I don't think the inter-references in the bundle are correct - when referring to a fullUrl inside the bundle, "Patient/urn:uuid:xxx" should just be "urn:uuid:xxx"
Paul Church (Mar 03 2020 at 02:17):
but what did the POST return?
Alex Goel (Mar 03 2020 at 03:13):
Paul Church said:
I don't think the inter-references in the bundle are correct - when referring to a fullUrl inside the bundle, "Patient/urn:uuid:xxx" should just be "urn:uuid:xxx"
I think you're right!
Transaction
XML or JSON representationOrganization ""
Tags: (no tags) +Better Health Clinic
{
"resourceType" : "Organization",
"meta" : {
"versionId" : "4",
"lastUpdated" : "2020-03-02T09:16:42.867+00:00",
"source" : "#MR3ZIt7jSeKKn7lh"
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n \n <p>Better Health Clinic</p>\n \n </div>"
},
"identifier" : [
{
"system" : "http://fakeurl.org",
"value" : "0155582719"
}
],
"name" : "Better Health Clinic",
"alias" : [
"BHC"
],
"telecom" : [
{
"system" : "phone",
"value" : "12012910"
}
],
"address" : [
{
"text" : "Muth Monen street."
}
]
}Encounter ""
Tags: (no tags) +Encounter with patient @example
{
"resourceType" : "Encounter",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Encounter with patient @example</div>"
},
"status" : "in-progress",
"class" : {
"system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code" : "IMP",
"display" : "inpatient encounter"
},
"subject" : {
"reference" : "Patient/urn:uuid:99f151c0-a954-468a-88bd-5ae15c08e059"
}
}Patient ""
Tags: (no tags) +Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321
{
"resourceType" : "Patient",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n \n <p>Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321</p>\n \n </div>"
},
"identifier" : [
{
"use" : "usual",
"type" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
"code" : "MR"
}
]
},
"system" : "urn:oid:0.1.2.3.4.5.6.7",
"value" : "654321"
}
],
"active" : true,
"name" : [
{
"use" : "official",
"family" : "Donald",
"given" : [
"Duck"
]
}
],
"gender" : "male",
"photo" : [
{
"contentType" : "image/gif",
"data" : "R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7"
}
],
"contact" : [
{
"relationship" : [
{
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/v2-0131",
"code" : "E"
}
]
}
],
"organization" : {
"reference" : "Organization/1",
"display" : "Walt Disney Corporation"
}
}
],
"managingOrganization" : {
"reference" : "Organization/urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059",
"display" : "Better Health Clinic"
},
"link" : [
{
"other" : {
"reference" : "Patient/pat2"
},
"type" : "seealso"
}
]
Alex Goel (Mar 03 2020 at 03:45):
Still not getting back logical ids for resources in the bundle without the patient/urn and instead using on urn
Paul Church (Mar 03 2020 at 04:03):
The Google server thinks your bundle is correct with urn instead of patient/urn, and referential integrity off so Patient/pat2 and Organization/1 don't cause errors.
Vibin_chander (Mar 03 2020 at 18:36):
Have a query regarding encounter
Vibin_chander (Mar 03 2020 at 18:36):
How do I identify the discharge of a patient in the encounter
Vibin_chander (Mar 03 2020 at 18:37):
In other words. Which field in the encounter resource of FHIR I can use to identify the discharged status of a patient
Vibin_chander (Mar 03 2020 at 18:38):
I have a scenario where a patient comes and becomes an inpatient. And discharged 2 days after. So, in this case I get notfied in the HL7v2 as patient discharged. But i cannot find a suitable FHIR element to place this status
Vibin_chander (Mar 03 2020 at 18:41):
This is a very basic use case in the healthcare world, Ideally i believe FHIR specification should provide a provision to query the encounter of a patient based on weather the patient is discharged or not.
Vibin_chander (Mar 03 2020 at 18:42):
Although under hospitalization we have discharge disposition, FHIR R4 dont have a search parameter for that. I would have to create an identifier extra to query it
Vibin_chander (Mar 03 2020 at 18:42):
Please let me know if my understanding is wrong in here
Lloyd McKenzie (Mar 03 2020 at 20:58):
Encounter.status of 'completed' would mean 'discharged' in the case of an inpatient encounter. (We use 'completed' rather than 'discharged' because Encounter is used for office visits, phone calls and other encounter types where 'discharged' wouldn't make any sense.)
Vibin_chander (Mar 04 2020 at 03:09):
Thanks Lloyd. Status has some required value like planned | arrived | triaged | in-progress | onleave | finished | cancelled and it is of binding strength Required. Do you mean Discharge means "finished"?
Lloyd McKenzie (Mar 04 2020 at 03:15):
I was looking at the draft of R5 rather than R4. (In R5, 'finished' has been changed to 'completed'.) But yes, in R4, a status of 'finished' would correspond to 'discharged' if the encounter represented an inpatient encounter.
Alex Goel (Mar 04 2020 at 03:22):
Paul Church said:
The Google server thinks your bundle is correct with urn instead of patient/urn, and referential integrity off so Patient/pat2 and Organization/1 don't cause errors.
Thanks for your help Paul! I still ran into problems getting separate resources using test.fhir.org and hapi
Vibin_chander (Mar 04 2020 at 03:38):
thanks @Lloyd McKenzie appreciate your help
Armin Griebler (Apr 21 2020 at 06:37):
Is it necessary that every resource in a bundle has its own entry? Or is one entry for all the resources in the bundle also possible?
Grahame Grieve (Apr 21 2020 at 06:38):
I don't think that's possible (since my response would be that if an entry contains all the resources it must contain another bundle)
Jean Duteau (Apr 21 2020 at 06:40):
Armin said:
Is it necessary that every resource in a bundle has its own entry? Or is one entry for all the resources in the bundle also possible?
Well, given that each entry can only hold one resource (entry.resource is 0..1), I think the spec answers your question. Each resource goes in one entry.
Armin Griebler (Apr 21 2020 at 06:42):
@Grahame Grieve @Jean Duteau thank you for your quick answers!
Armin Griebler (Apr 21 2020 at 07:26):
I am trying to store a bundle that contains several entries with resources like Observations, Patient, DiagnosticReport on my server but every time I do that, the server just recognizes the last resource in the bundle and ignores all the other ones. Does anyone know a solution to this problem?
René Spronk (Apr 21 2020 at 08:33):
If each and every entry in your bundle contains max 1 resource, and the server shows this behaviour, I'd suggest you take the issue up with the author/vendor of your server..
Lloyd McKenzie (Apr 21 2020 at 14:09):
That's odd server behavior. What kind of Bundle are you submitting - and what endpoint are you submitting it to?
Lloyd McKenzie (Apr 21 2020 at 14:11):
i.e. Are you POSTing it to [root] or [root]/Bundle? At the latter location, there's no expectation the content of the Bundle will be extracted, though some servers might choose to extract some or all. If you post to [root], your Bundle is expected to either be a 'batch' or 'transaction' with independent entries for each resource and a request indicating what operation you want to have happen to that resource.
Yogesha K (Mar 02 2021 at 03:20):
Is there a specific order for resources while posting bundles? I encountered a specific case, lets say I have a patient resource and practitioner resource where Patient resource occurs first in bundle and Practitioner occurs next , and Practitioner is referenced by Patient with BOTH RESOURCES HAVING CONDITIONAL CREATE then the reference from Patient resource to Practitioner resource is not built by the server.
IS THIS THE EXPECTED BEHAVIOUR?
If it is and one should arrange resource bundle how should resources be posted with conditional create eg: Encounter and Condition(which reference each other)
P.S. The reference is being built by server if conditional create was disabled
Lloyd McKenzie (Mar 02 2021 at 03:43):
There is no order to Bundle except a few specific requirements, such as Composition must be first for documents and MessageHeader must be first for messages. When processing a transaction, it's up to the consumer to determine interdependencies and figure out what order it wants to process things in. That's because the optimizations possible will vary from server to server. (The internal representation might not strictly correspond to the resource boundaries.)
Last updated: Apr 12 2022 at 19:14 UTC