Skip to content

Instantly share code, notes, and snippets.

@KevinMayfield
Created December 6, 2018 15:34
Show Gist options
  • Save KevinMayfield/72de3e3d7975f0d1876337d7b8811721 to your computer and use it in GitHub Desktop.
Save KevinMayfield/72de3e3d7975f0d1876337d7b8811721 to your computer and use it in GitHub Desktop.
Bundle bundle = new Bundle();
bundle.addEntry().setResource(doc).setFullUrl("urn:uuid:"+doc.getId());
bundle.addEntry().setResource(binary).setFullUrl("urn:uuid:"+binary.getId());
bundle.setType(Bundle.BundleType.COLLECTION);
System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment