FHIR Chat · Remove contained from resource · hapi

Stream: hapi

Topic: Remove contained from resource


view this post on Zulip Kevin Mayfield (Mar 16 2017 at 12:25):

Using Dstu2 latest HAPI. I'm working with an API call which returns a number of contained resources and I want to turn this into a Bundle with the contained resources moved from the ReferralRequest resource into the bundle (alongside the Binary resources which I also retrieve). This bit woks ok but I can't remove the original contained resources in the ReferralRequest. Have tried referral.getContained().getContainedResources().clear();

view this post on Zulip Kevin Mayfield (Mar 16 2017 at 12:26):

referral.getContained().getContainedResources().remove(c)

view this post on Zulip Kevin Mayfield (Mar 16 2017 at 12:27):

Any others? I'm tempted to turn the resource into json and delete them that way

view this post on Zulip Kevin Mayfield (Mar 16 2017 at 13:33):

The answer was to alter the resource id's.


Last updated: Apr 12 2022 at 19:14 UTC