FHIR Chat · Generate bundle with reference · students

Stream: students

Topic: Generate bundle with reference


view this post on Zulip Anthony Dagneaux (Dec 01 2019 at 15:35):

Hi all!

I'm curently working on a project which creates FHIR resources from a CDA file. It works well, but I have a question about bundles. In fact, when I receive a report from a laboratory, I have to create a lot of FHIR resources, so I have to do many requests on my server.

I managed to create my observations with a bundle. So it works, I have only one request on the server to create all my observations .

But my question is, can I create all my resources in only one bundle? I mean, some resources refer to others, like for example when I create a DiagnosticReport, I need the ID of the subject, the performer and all the IDs of the observations (result). But in fact if I do only one bundle I don't have all the IDs. So is it possible to put something like a variable in a bundle which will get the ID of the UPDATED/CREATED resource?

Thanks in advance for you help!

Anthony

view this post on Zulip Lloyd McKenzie (Dec 01 2019 at 15:49):

Have you looked at transaction (http://build.fhir.org/http.html#transaction)?

view this post on Zulip Anthony Dagneaux (Dec 01 2019 at 17:10):

Yes I looked and I used a transaction to create observations on the server, but maybe I've missed something.

In fact I'd like to do something like that:

{
"resourceType": "Bundle",
"id": "bundle-transaction",
"meta": {
"lastUpdated": "2014-08-18T01:43:30Z"
},
"type": "transaction",
"entry": [
{
"resource": {
"resourceType": "Patient",
"active": true,
...
},
"request": {
"method": "POST",
"url": "Patient"
}
}, {
"resourceType": "DocumentReference",
"identifier": [
{
"system": "urn:ietf:rfc:3986",
"value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"
}
],
...
},
"subject": {
"reference": "Patient/$idOfTheGeneratedPatient" --- Put the reference to the patient here ?
},
...
"request": {
"method": "POST",
"url": "DocumentReference"
}
}
]
}

Do you think I can do that with the transactions?


Last updated: Apr 12 2022 at 19:14 UTC