Skip to main content

Working with Bundles

Bundles provide a means to perform multiple actions at once. You may specify how you want these operations to execute; for example, if you want them executed atomically or independently.

Reading Resources with Bundles

let bundle = plasma.startBundle();
bundle = plasma.addReadToBundle(bundle, "Observation", { category: "laboratory" });
bundle = plasma.addReadToBundle(bundle, "AllergyIntolerance", { "clinical-status": "active" });
const response = await plasma.executeBundle(bundle);

Writing Resources with Bundles

let bundle = plasma.startBundle();
bundle = plasma.addWriteToBundle(bundle, "update", existingFamilyMember);
bundle = plasma.addWriteToBundle(bundle, "create", newFamilyMember);
const response = await plasma.executeBundle(bundle);