Save snapshot to retrieve the exact information available in a particular moment

Hello, suppose this situation:

Day 1:
In a medical care system a practitioner inputs some fhir resources ( r1 and r2 )

Day 2:
In the same medical care system The practitioner input the resource r3 and removes r2. ( remaining resources: r1, r3)

Day 3:
The practitioner needs to retrieve all the “Day 1” information but that information was modified in “Day 2”

Could I use the Composition resource to save a snapshot of “Day 1” medical care in order to retrieve the exact information that was available in that day (r1 and r2)?

I was planning to use the Composition resource in the following way:

Day 1
Resources: r1, r2, ( the system creates composition1)

composition1.section.mode = ‘snapshot’
composition1.section.entry = [r1Reference, r2Reference]

Day 2
Resources: r1, r3, ( the system creates composition2)

composition2.section.mode = ‘snapshot’
composition2.section.entry = [r1Reference, r3Reference]

1 Like

That’s something you could do. That said, you might want to look at supporting history - that would allow you to re-assemble what content looked like at any particular point in time. (And wouldn’t have the overhead of tons of documents containing snapshots of things that hadn’t necessarily changed.)

2 Likes

In this case, we were planning to use the versioned reference of each resource, was that what you meant?
Or somehow have a date based filter in the resources that returned the most recent version giving that date?

1 Like

If you use the history, you can use the _at parameter to retrieve the specific snapshot of a resource as it was at a particular point in time.

2 Likes