resources chart with createdat
# support
t
I want to plot a chart of createdAt records for a specific list of FHIR resources over a certain period. However, createdAt does not exist. I am aware of https://www.medplum.com/docs/fhir-datastore/resource-history#accessing-the-_history-endpoint There's a link suggesting using _history. What would be a good way to generate the chart? For example, can I create a bar chart showing the daily total number of patient resources created over the past month?
n
Also a medplum user- the
_history
endpoint is for a single resource, so I'm not sure it'll fit your use case, unless you first requested the dataset's population and then made a
_history
request for each resource to get the original version's
meta.lastUpdated
, which could be a lot. The note on the doc you linked titled 'Resource Creation Time' explains it well. You could, perhaps, save the creation time as an [extension](https://www.medplum.com/blog/fhir-extensions-intro) ? Also if you know the resources haven't been modified since they were created, then
meta.lastUpdated
may === the creation time. Extreme tangent- I'd be very interested in learning if there is a fhir implementation backed by something like [xtdb](https://github.com/xtdb/xtdb)
t
extension
seems to be the best...
n
[Here's a thread](https://chat.fhir.org/#narrow/channel/179166-implementers/topic/get.20createTime) in the fhir forums about other options
185 Views