Stream: hapi
Topic: sample code for creation of FHIR Document
John Moehrke (Dec 09 2020 at 14:59):
I need help using HAPI to create a FHIR Document. Is there a tutorial or section of documentation that gets to the HAPI specifics? I have a profile, and example. That was the easy part.
Jens Villadsen (Dec 09 2020 at 15:11):
Have a look at either https://hapifhir.io/hapi-fhir/docs/client/generic_client.html or https://hapifhir.io/hapi-fhir/docs/client/examples.html
John Moehrke (Dec 09 2020 at 15:12):
specifically I am looking for how to setup the bundle of type document for seralization to download on a web page...
Jens Villadsen (Dec 09 2020 at 15:16):
sorry - I somehow read it as you needed to build a document ...
John Moehrke (Dec 09 2020 at 15:18):
well, yes. a FHIR Document... which is a bundle of type document made up of a Composition and a bunch of other stuff.. I have the composition, I have the other stuff.. I just don't have a clear code fragment that creates in HAPI the Bundle
Jens Villadsen (Dec 09 2020 at 15:18):
the server side part ?
John Moehrke (Dec 09 2020 at 15:19):
client. No server will be involved. My client is assembling the FHIR Document, and seralizing it into a json blob for the user to download
John Moehrke (Dec 09 2020 at 15:20):
thus the FHIR Document bundle never is 'created' on a server. It is just 'created' in the app.....
Jens Villadsen (Dec 09 2020 at 15:26):
something like ...
new Bundle().setType(Bundle.BundleType.DOCUMENT)
.addEntry(new Bundle.BundleEntryComponent().setResource(new Composition()))
.addEntry(new Bundle.BundleEntryComponent().setResource(new Patient())))
?
John Moehrke (Dec 09 2020 at 15:30):
I guess?
Jens Villadsen (Dec 09 2020 at 15:41):
well that snippet creates a bundle for you that is of type document with to empty placeholder resources in it
Last updated: Apr 12 2022 at 19:14 UTC