setting title, links , base url in Bundle

35 views
Skip to first unread message

zuk...@gmail.com

unread,
Oct 1, 2014, 12:18:40 PM10/1/14
to hapi...@googlegroups.com
Hi,
   I'm trying to build a Bundle to pack different resources which are involved in a transaction.
I can't find methods to set title or the baseurl to use relative references like in:
http://hl7.org/implement/standards/fhir/references.html#atom-rel

Also adding resources to the bundle I can't find a method to modify links or title in the BundleEntries.

Am I doing something wrong?

Does anyone have some bundle examples, we're using bundle internal references (between entries) instead of using "contained" resources, is this approach allowed?

Thanks

  andrea

James Agnew

unread,
Oct 1, 2014, 2:16:04 PM10/1/14
to zuk...@gmail.com, hapi...@googlegroups.com
Hi Andrea,

You're right actually, that is a strange omission.

There is a way to set title, links, dates, etc for BundleEntries but it isn't obvious. There is a getTitle() method which returns a StringDt instance which you can then set the value of.
E.g.
nextEntry.getTitle().setValue("This is the title");

..but I think we should also add a normal setter, since using a getter to set a value is pretty counterintuitive. Seeting links is a bit more intuitive:

nextEntry.setLinkSearch(new StringDt("http://foo"));

And (hopefully I'm understanding your second question correctly) using top level resources in a bundle as opposed to contained resources is the preferred mechanism in FHIR. Contained are allowed for when a resource doesn't have its own discrete identity but in general using top level resources is the right way to go.

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/502dc5dc-e35f-42e3-a038-61fb2c5aadf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages