Search code examples
hl7-fhirdstu2-fhirsmart-on-fhir

Recommended workflow for creating an FHIR Document


We've built a system for generating anesthesia records.

We're now trying to model them as FHIR documents.

I understand that a Document (in FHIR terms) is supposed to end up being kind of a self-contained resource.

But, in our case, we have a process where this document will be gradually assembled.

What's the best way to handle this while we're gathering resources before we're ready to create a document.

We want to use FHIR to create and save various resources as we go, and then at the very end, assemble a document.

Assume the following:

  1. A patient
  2. A provider
  3. A health history
  4. Some info about the procedure being performed
  5. An extensive set of vitals observations
  6. An extensive set of drug doses administered
  7. Various procedure, and recovery notes
  8. A final signature by the provider that will "finalize" the report

I understand we can create and save various resources throughout. But we want to kind of keep them all lumped together so we can easily fetch everything related to what will ultimately become that document.

How would this work in terms of RESTful operations?

  1. POST /Bundle of type "document" with a composition as first element (to create document)
  2. Use resulting ID from bundle? Will I also get an ID for the composition?
  3. Then, how do I add/update/remove individual items from the composition? Do i need to do PUTs of the entire composition to add something?
  4. I have entire series of checkpoints every 5 minutes with full vitals (BP, SpO2, Temp, Respiratory rate, etc). Would I first create those observations with a POST, and then do a PUT to update the composition with a reference to them?

As I'm sure you can tell, I just want to understand how FHIR expects you to do this kind of thing in terms of HTTP operations.

Thanks in advance for any guidance!


Solution

  • You'd start by posting a Composition to have a focal point (table of contents) to update as you gather your data. You would then POST your individual Observations, Procedures, etc. and either PUT or PATCH the Composition to add references to the relevant data. Once you've got all of the relevant information gathered and tied into the Composition, you would then generate the document Bundle. You could create the Bundle earlier in the process and update it each time the Composition changes if you wanted to be able to render the draft document using a FHIR document rendering tool, but otherwise there's no real reason for the Bundle to exist until you're ready to lock down the document.